summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.h
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-15 06:05:44 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-15 06:05:44 +0000
commitc36aa54b39d1e97ac912dcbef8550750bb2dc760 (patch)
treeef0b3b5fe19860d399f60a0610fc54c9edee6d90 /gcc/emit-rtl.h
parent7502b19d938bde2fcfc9d5976e82003349dce04f (diff)
downloadgcc-c36aa54b39d1e97ac912dcbef8550750bb2dc760.tar.gz
* function.h (struct emit_status): Delete x_first_insn, x_last_insn
and sequence_stack. Add seq. (seq_stack): Delete. * function.c (prepare_function_start): Don't access x_last_insn. * emit-rtl.h (get_current_sequence, get_topmost_sequence): New. (get_insns, set_first_insn, get_last_insn, set_last_insn): Use them. * emit_rtl.c (start_sequence, push_topmost_sequence, pop_topmost_sequence, end_sequence, in_sequence_p, init_emit): Use sequence accessors. (get_last_insn_anywhere, add_insn_after_nobb, add_insn_before_nobb, remove_insn): Likewise. Simplify. * config/m32c/m32c.c (m32c_leaf_function_p): Use push_topmost_sequence and pop_topmost_sequence. (m32c_function_needs_enter): Use get_topmost_sequence. Ignore debug insns. * config/rs6000/rs6000.c (rs6000_call_aix): Use get_current_sequence. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222112 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.h')
-rw-r--r--gcc/emit-rtl.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index 3abe58ec7b0..7dce7ebef11 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -75,12 +75,36 @@ extern int mem_expr_equal_p (const_tree, const_tree);
extern bool need_atomic_barrier_p (enum memmodel, bool);
+/* Return the current sequence. */
+
+static inline struct sequence_stack *
+get_current_sequence (void)
+{
+ return &crtl->emit.seq;
+}
+
+/* Return the outermost sequence. */
+
+static inline struct sequence_stack *
+get_topmost_sequence (void)
+{
+ struct sequence_stack *seq, *top;
+
+ seq = get_current_sequence ();
+ do
+ {
+ top = seq;
+ seq = seq->next;
+ } while (seq);
+ return top;
+}
+
/* Return the first insn of the current sequence or current function. */
static inline rtx_insn *
get_insns (void)
{
- return crtl->emit.x_first_insn;
+ return get_current_sequence ()->first;
}
/* Specify a new insn as the first in the chain. */
@@ -89,7 +113,7 @@ static inline void
set_first_insn (rtx_insn *insn)
{
gcc_checking_assert (!insn || !PREV_INSN (insn));
- crtl->emit.x_first_insn = insn;
+ get_current_sequence ()->first = insn;
}
/* Return the last insn emitted in current sequence or current function. */
@@ -97,7 +121,7 @@ set_first_insn (rtx_insn *insn)
static inline rtx_insn *
get_last_insn (void)
{
- return crtl->emit.x_last_insn;
+ return get_current_sequence ()->last;
}
/* Specify a new insn as the last in the chain. */
@@ -106,7 +130,7 @@ static inline void
set_last_insn (rtx_insn *insn)
{
gcc_checking_assert (!insn || !NEXT_INSN (insn));
- crtl->emit.x_last_insn = insn;
+ get_current_sequence ()->last = insn;
}
/* Return a number larger than any instruction's uid in this function. */