int min = 0;
int loc = INSN_LOCATOR (insn);
+ /* When block_locators_locs was initialized, the pro- and epilogue
+ insns didn't exist yet and can therefore not be found this way.
+ But we know that they belong to the outer most block of the
+ current function.
+ Without this test, the prologue would be put inside the block of
+ the first valid instruction in the function and when that first
+ insn is part of an inlined function then the low_pc of that
+ inlined function is messed up. Likewise for the epilogue and
+ the last valid instruction. */
+ if (loc == prologue_locator || loc == epilogue_locator)
+ return DECL_INITIAL (cfun->decl);
+
if (!max || !loc)
return NULL;
while (1)
return VARRAY_TREE (block_locators_blocks, min);
}
-/* Return line number of the statement that produced this insn. */
+/* Return line number of the statement specified by the locator. */
int
-insn_line (rtx insn)
+locator_line (int loc)
{
int max = VARRAY_ACTIVE_SIZE (line_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
if (!max || !loc)
return 0;
return VARRAY_INT (line_locators_lines, min);
}
-/* Return source file of the statement that produced this insn. */
+/* Return line number of the statement that produced this insn. */
+int
+insn_line (rtx insn)
+{
+ return locator_line (INSN_LOCATOR (insn));
+}
+
+/* Return source file of the statement specified by LOC. */
const char *
-insn_file (rtx insn)
+locator_file (int loc)
{
int max = VARRAY_ACTIVE_SIZE (file_locators_locs);
int min = 0;
- int loc = INSN_LOCATOR (insn);
if (!max || !loc)
return NULL;
return VARRAY_CHAR_PTR (file_locators_files, min);
}
+/* Return source file of the statement that produced this insn. */
+const char *
+insn_file (rtx insn)
+{
+ return locator_file (INSN_LOCATOR (insn));
+}
+
/* Rebuild all the NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes based
on the scope tree and the newly reordered instructions. */
prev_bb->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = prev_bb;
- /* Anoying special case - jump around dead jumptables left in the code. */
+ /* Annoying special case - jump around dead jumptables left in the code. */
FOR_EACH_BB (bb)
{
edge e;