emit-rtl.c (emit_pattern_after_setloc): New function.
* emit-rtl.c (emit_pattern_after_setloc): New function. (emit_insn_after_setloc, emit_jump_insn_after_setloc): Call it. (emit_call_insn_after_setloc, emit_debug_insn_after_setloc): Likewise. (emit_pattern_after): New function. (emit_insn_after, emit_jump_insn_after): Call it. (emit_call_insn_after, emit_debug_insn_after): Likewise. (emit_pattern_before_setloc): New function. (emit_insn_before_setloc, emit_jump_insn_before_setloc): Call it. (emit_call_insn_before_setloc, emit_debug_insn_before_setloc): Likewise. (emit_pattern_before): New function. (emit_insn_before, emit_jump_insn_before): Call it. (emit_call_insn_before, emit_debug_insn_before): Likewise. From-SVN: r171817
This commit is contained in:
parent
576f85f168
commit
e8110d6f22
@ -1,3 +1,19 @@
|
|||||||
|
2011-03-31 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* emit-rtl.c (emit_pattern_after_setloc): New function.
|
||||||
|
(emit_insn_after_setloc, emit_jump_insn_after_setloc): Call it.
|
||||||
|
(emit_call_insn_after_setloc, emit_debug_insn_after_setloc): Likewise.
|
||||||
|
(emit_pattern_after): New function.
|
||||||
|
(emit_insn_after, emit_jump_insn_after): Call it.
|
||||||
|
(emit_call_insn_after, emit_debug_insn_after): Likewise.
|
||||||
|
(emit_pattern_before_setloc): New function.
|
||||||
|
(emit_insn_before_setloc, emit_jump_insn_before_setloc): Call it.
|
||||||
|
(emit_call_insn_before_setloc, emit_debug_insn_before_setloc):
|
||||||
|
Likewise.
|
||||||
|
(emit_pattern_before): New function.
|
||||||
|
(emit_insn_before, emit_jump_insn_before): Call it.
|
||||||
|
(emit_call_insn_before, emit_debug_insn_before): Likewise.
|
||||||
|
|
||||||
2011-03-31 Richard Henderson <rth@redhat.com>
|
2011-03-31 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* dwarf2out.c (dw_separate_line_info_ref): Remove.
|
* dwarf2out.c (dw_separate_line_info_ref): Remove.
|
||||||
|
281
gcc/emit-rtl.c
281
gcc/emit-rtl.c
@ -4319,11 +4319,14 @@ emit_note_after (enum insn_note subtype, rtx after)
|
|||||||
return note;
|
return note;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */
|
/* Insert PATTERN after AFTER, setting its INSN_LOCATION to LOC.
|
||||||
rtx
|
MAKE_RAW indicates how to turn PATTERN into a real insn. */
|
||||||
emit_insn_after_setloc (rtx pattern, rtx after, int loc)
|
|
||||||
|
static rtx
|
||||||
|
emit_pattern_after_setloc (rtx pattern, rtx after, int loc,
|
||||||
|
rtx (*make_raw) (rtx))
|
||||||
{
|
{
|
||||||
rtx last = emit_insn_after_noloc (pattern, after, NULL);
|
rtx last = emit_pattern_after_noloc (pattern, after, NULL, make_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX || !loc)
|
if (pattern == NULL_RTX || !loc)
|
||||||
return last;
|
return last;
|
||||||
@ -4340,130 +4343,96 @@ emit_insn_after_setloc (rtx pattern, rtx after, int loc)
|
|||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Insert PATTERN after AFTER. MAKE_RAW indicates how to turn PATTERN
|
||||||
|
into a real insn. SKIP_DEBUG_INSNS indicates whether to insert after
|
||||||
|
any DEBUG_INSNs. */
|
||||||
|
|
||||||
|
static rtx
|
||||||
|
emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns,
|
||||||
|
rtx (*make_raw) (rtx))
|
||||||
|
{
|
||||||
|
rtx prev = after;
|
||||||
|
|
||||||
|
if (skip_debug_insns)
|
||||||
|
while (DEBUG_INSN_P (prev))
|
||||||
|
prev = PREV_INSN (prev);
|
||||||
|
|
||||||
|
if (INSN_P (prev))
|
||||||
|
return emit_pattern_after_setloc (pattern, after, INSN_LOCATOR (prev),
|
||||||
|
make_raw);
|
||||||
|
else
|
||||||
|
return emit_pattern_after_noloc (pattern, after, NULL, make_raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
|
rtx
|
||||||
|
emit_insn_after_setloc (rtx pattern, rtx after, int loc)
|
||||||
|
{
|
||||||
|
return emit_pattern_after_setloc (pattern, after, loc, make_insn_raw);
|
||||||
|
}
|
||||||
|
|
||||||
/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
/* Like emit_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
||||||
rtx
|
rtx
|
||||||
emit_insn_after (rtx pattern, rtx after)
|
emit_insn_after (rtx pattern, rtx after)
|
||||||
{
|
{
|
||||||
rtx prev = after;
|
return emit_pattern_after (pattern, after, true, make_insn_raw);
|
||||||
|
|
||||||
while (DEBUG_INSN_P (prev))
|
|
||||||
prev = PREV_INSN (prev);
|
|
||||||
|
|
||||||
if (INSN_P (prev))
|
|
||||||
return emit_insn_after_setloc (pattern, after, INSN_LOCATOR (prev));
|
|
||||||
else
|
|
||||||
return emit_insn_after_noloc (pattern, after, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */
|
/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc)
|
emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc)
|
||||||
{
|
{
|
||||||
rtx last = emit_jump_insn_after_noloc (pattern, after);
|
return emit_pattern_after_setloc (pattern, after, loc, make_jump_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX || !loc)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (after) && !INSN_LOCATOR (after))
|
|
||||||
INSN_LOCATOR (after) = loc;
|
|
||||||
if (after == last)
|
|
||||||
break;
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
/* Like emit_jump_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
||||||
rtx
|
rtx
|
||||||
emit_jump_insn_after (rtx pattern, rtx after)
|
emit_jump_insn_after (rtx pattern, rtx after)
|
||||||
{
|
{
|
||||||
rtx prev = after;
|
return emit_pattern_after (pattern, after, true, make_jump_insn_raw);
|
||||||
|
|
||||||
while (DEBUG_INSN_P (prev))
|
|
||||||
prev = PREV_INSN (prev);
|
|
||||||
|
|
||||||
if (INSN_P (prev))
|
|
||||||
return emit_jump_insn_after_setloc (pattern, after, INSN_LOCATOR (prev));
|
|
||||||
else
|
|
||||||
return emit_jump_insn_after_noloc (pattern, after);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */
|
/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_call_insn_after_setloc (rtx pattern, rtx after, int loc)
|
emit_call_insn_after_setloc (rtx pattern, rtx after, int loc)
|
||||||
{
|
{
|
||||||
rtx last = emit_call_insn_after_noloc (pattern, after);
|
return emit_pattern_after_setloc (pattern, after, loc, make_call_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX || !loc)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (after) && !INSN_LOCATOR (after))
|
|
||||||
INSN_LOCATOR (after) = loc;
|
|
||||||
if (after == last)
|
|
||||||
break;
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
/* Like emit_call_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
||||||
rtx
|
rtx
|
||||||
emit_call_insn_after (rtx pattern, rtx after)
|
emit_call_insn_after (rtx pattern, rtx after)
|
||||||
{
|
{
|
||||||
rtx prev = after;
|
return emit_pattern_after (pattern, after, true, make_call_insn_raw);
|
||||||
|
|
||||||
while (DEBUG_INSN_P (prev))
|
|
||||||
prev = PREV_INSN (prev);
|
|
||||||
|
|
||||||
if (INSN_P (prev))
|
|
||||||
return emit_call_insn_after_setloc (pattern, after, INSN_LOCATOR (prev));
|
|
||||||
else
|
|
||||||
return emit_call_insn_after_noloc (pattern, after);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to SCOPE. */
|
/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_debug_insn_after_setloc (rtx pattern, rtx after, int loc)
|
emit_debug_insn_after_setloc (rtx pattern, rtx after, int loc)
|
||||||
{
|
{
|
||||||
rtx last = emit_debug_insn_after_noloc (pattern, after);
|
return emit_pattern_after_setloc (pattern, after, loc, make_debug_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX || !loc)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (after) && !INSN_LOCATOR (after))
|
|
||||||
INSN_LOCATOR (after) = loc;
|
|
||||||
if (after == last)
|
|
||||||
break;
|
|
||||||
after = NEXT_INSN (after);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
/* Like emit_debug_insn_after_noloc, but set INSN_LOCATOR according to AFTER. */
|
||||||
rtx
|
rtx
|
||||||
emit_debug_insn_after (rtx pattern, rtx after)
|
emit_debug_insn_after (rtx pattern, rtx after)
|
||||||
{
|
{
|
||||||
if (INSN_P (after))
|
return emit_pattern_after (pattern, after, false, make_debug_insn_raw);
|
||||||
return emit_debug_insn_after_setloc (pattern, after, INSN_LOCATOR (after));
|
|
||||||
else
|
|
||||||
return emit_debug_insn_after_noloc (pattern, after);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to SCOPE. */
|
/* Insert PATTERN before BEFORE, setting its INSN_LOCATION to LOC.
|
||||||
rtx
|
MAKE_RAW indicates how to turn PATTERN into a real insn. INSNP
|
||||||
emit_insn_before_setloc (rtx pattern, rtx before, int loc)
|
indicates if PATTERN is meant for an INSN as opposed to a JUMP_INSN,
|
||||||
|
CALL_INSN, etc. */
|
||||||
|
|
||||||
|
static rtx
|
||||||
|
emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp,
|
||||||
|
rtx (*make_raw) (rtx))
|
||||||
{
|
{
|
||||||
rtx first = PREV_INSN (before);
|
rtx first = PREV_INSN (before);
|
||||||
rtx last = emit_insn_before_noloc (pattern, before, NULL);
|
rtx last = emit_pattern_before_noloc (pattern, before,
|
||||||
|
insnp ? before : NULL_RTX,
|
||||||
|
NULL, make_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX || !loc)
|
if (pattern == NULL_RTX || !loc)
|
||||||
return last;
|
return last;
|
||||||
@ -4483,127 +4452,93 @@ emit_insn_before_setloc (rtx pattern, rtx before, int loc)
|
|||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Insert PATTERN before BEFORE. MAKE_RAW indicates how to turn PATTERN
|
||||||
|
into a real insn. SKIP_DEBUG_INSNS indicates whether to insert
|
||||||
|
before any DEBUG_INSNs. INSNP indicates if PATTERN is meant for an
|
||||||
|
INSN as opposed to a JUMP_INSN, CALL_INSN, etc. */
|
||||||
|
|
||||||
|
static rtx
|
||||||
|
emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns,
|
||||||
|
bool insnp, rtx (*make_raw) (rtx))
|
||||||
|
{
|
||||||
|
rtx next = before;
|
||||||
|
|
||||||
|
if (skip_debug_insns)
|
||||||
|
while (DEBUG_INSN_P (next))
|
||||||
|
next = PREV_INSN (next);
|
||||||
|
|
||||||
|
if (INSN_P (next))
|
||||||
|
return emit_pattern_before_setloc (pattern, before, INSN_LOCATOR (next),
|
||||||
|
insnp, make_raw);
|
||||||
|
else
|
||||||
|
return emit_pattern_before_noloc (pattern, before,
|
||||||
|
insnp ? before : NULL_RTX,
|
||||||
|
NULL, make_raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
|
rtx
|
||||||
|
emit_insn_before_setloc (rtx pattern, rtx before, int loc)
|
||||||
|
{
|
||||||
|
return emit_pattern_before_setloc (pattern, before, loc, true,
|
||||||
|
make_insn_raw);
|
||||||
|
}
|
||||||
|
|
||||||
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
|
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
|
||||||
rtx
|
rtx
|
||||||
emit_insn_before (rtx pattern, rtx before)
|
emit_insn_before (rtx pattern, rtx before)
|
||||||
{
|
{
|
||||||
rtx next = before;
|
return emit_pattern_before (pattern, before, true, true, make_insn_raw);
|
||||||
|
|
||||||
while (DEBUG_INSN_P (next))
|
|
||||||
next = PREV_INSN (next);
|
|
||||||
|
|
||||||
if (INSN_P (next))
|
|
||||||
return emit_insn_before_setloc (pattern, before, INSN_LOCATOR (next));
|
|
||||||
else
|
|
||||||
return emit_insn_before_noloc (pattern, before, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* like emit_insn_before_noloc, but set insn_locator according to scope. */
|
/* like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc)
|
emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc)
|
||||||
{
|
{
|
||||||
rtx first = PREV_INSN (before);
|
return emit_pattern_before_setloc (pattern, before, loc, false,
|
||||||
rtx last = emit_jump_insn_before_noloc (pattern, before);
|
make_jump_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (first) && !INSN_LOCATOR (first))
|
|
||||||
INSN_LOCATOR (first) = loc;
|
|
||||||
if (first == last)
|
|
||||||
break;
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like emit_jump_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
|
/* Like emit_jump_insn_before_noloc, but set INSN_LOCATOR according to BEFORE. */
|
||||||
rtx
|
rtx
|
||||||
emit_jump_insn_before (rtx pattern, rtx before)
|
emit_jump_insn_before (rtx pattern, rtx before)
|
||||||
{
|
{
|
||||||
rtx next = before;
|
return emit_pattern_before (pattern, before, true, false,
|
||||||
|
make_jump_insn_raw);
|
||||||
while (DEBUG_INSN_P (next))
|
|
||||||
next = PREV_INSN (next);
|
|
||||||
|
|
||||||
if (INSN_P (next))
|
|
||||||
return emit_jump_insn_before_setloc (pattern, before, INSN_LOCATOR (next));
|
|
||||||
else
|
|
||||||
return emit_jump_insn_before_noloc (pattern, before);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* like emit_insn_before_noloc, but set insn_locator according to scope. */
|
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
|
emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
|
||||||
{
|
{
|
||||||
rtx first = PREV_INSN (before);
|
return emit_pattern_before_setloc (pattern, before, loc, false,
|
||||||
rtx last = emit_call_insn_before_noloc (pattern, before);
|
make_call_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (first) && !INSN_LOCATOR (first))
|
|
||||||
INSN_LOCATOR (first) = loc;
|
|
||||||
if (first == last)
|
|
||||||
break;
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* like emit_call_insn_before_noloc,
|
/* Like emit_call_insn_before_noloc,
|
||||||
but set insn_locator according to before. */
|
but set insn_locator according to BEFORE. */
|
||||||
rtx
|
rtx
|
||||||
emit_call_insn_before (rtx pattern, rtx before)
|
emit_call_insn_before (rtx pattern, rtx before)
|
||||||
{
|
{
|
||||||
rtx next = before;
|
return emit_pattern_before (pattern, before, true, false,
|
||||||
|
make_call_insn_raw);
|
||||||
while (DEBUG_INSN_P (next))
|
|
||||||
next = PREV_INSN (next);
|
|
||||||
|
|
||||||
if (INSN_P (next))
|
|
||||||
return emit_call_insn_before_setloc (pattern, before, INSN_LOCATOR (next));
|
|
||||||
else
|
|
||||||
return emit_call_insn_before_noloc (pattern, before);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* like emit_insn_before_noloc, but set insn_locator according to scope. */
|
/* Like emit_insn_before_noloc, but set INSN_LOCATOR according to LOC. */
|
||||||
rtx
|
rtx
|
||||||
emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
|
emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
|
||||||
{
|
{
|
||||||
rtx first = PREV_INSN (before);
|
return emit_pattern_before_setloc (pattern, before, loc, false,
|
||||||
rtx last = emit_debug_insn_before_noloc (pattern, before);
|
make_debug_insn_raw);
|
||||||
|
|
||||||
if (pattern == NULL_RTX)
|
|
||||||
return last;
|
|
||||||
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (active_insn_p (first) && !INSN_LOCATOR (first))
|
|
||||||
INSN_LOCATOR (first) = loc;
|
|
||||||
if (first == last)
|
|
||||||
break;
|
|
||||||
first = NEXT_INSN (first);
|
|
||||||
}
|
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* like emit_debug_insn_before_noloc,
|
/* Like emit_debug_insn_before_noloc,
|
||||||
but set insn_locator according to before. */
|
but set insn_locator according to BEFORE. */
|
||||||
rtx
|
rtx
|
||||||
emit_debug_insn_before (rtx pattern, rtx before)
|
emit_debug_insn_before (rtx pattern, rtx before)
|
||||||
{
|
{
|
||||||
if (INSN_P (before))
|
return emit_pattern_before (pattern, before, false, false,
|
||||||
return emit_debug_insn_before_setloc (pattern, before, INSN_LOCATOR (before));
|
make_debug_insn_raw);
|
||||||
else
|
|
||||||
return emit_debug_insn_before_noloc (pattern, before);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Take X and emit it at the end of the doubly-linked
|
/* Take X and emit it at the end of the doubly-linked
|
||||||
|
Loading…
Reference in New Issue
Block a user