diff options
author | Richard Stallman <rms@gnu.org> | 1992-08-29 03:21:11 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-08-29 03:21:11 +0000 |
commit | c75ac904f80c5db92690d13f9a941bc68d311c00 (patch) | |
tree | 0375ec92fc972c2e895f6b7b93af5f28085ecc28 | |
parent | 7629c93617a9cbe51f9db77d5321ab03cb83f34d (diff) | |
download | gcc-c75ac904f80c5db92690d13f9a941bc68d311c00.zip gcc-c75ac904f80c5db92690d13f9a941bc68d311c00.tar.gz gcc-c75ac904f80c5db92690d13f9a941bc68d311c00.tar.bz2 |
(adjust_copied_decl_tree): New function.
(save_for_inline_copying): When making copies of NOTE_INSN_BLOCK_END
notes, stash a "forwarding" pointer in the original to point to the
copy. Also, when all BLOCKs & insns for a function have been copied,
call `adjust_copied_decl_tree' to fixup the end_note pointers in the
copied BLOCKs.
From-SVN: r1991
-rw-r--r-- | gcc/integrate.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index ba03ecf..ca91543 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -331,6 +331,30 @@ finish_inline (fndecl, head) DECL_INLINE (fndecl) = 1; } +/* Adjust the BLOCK_END_NOTE pointers in a given copied DECL tree so that + they all point to the new (copied) rtxs. */ + +static void +adjust_copied_decl_tree (block) + register tree block; +{ + register tree subblock; + register rtx original_end; + + original_end = BLOCK_END_NOTE (block); + if (original_end) + { + BLOCK_END_NOTE (block) = (rtx) NOTE_SOURCE_FILE (original_end); + NOTE_SOURCE_FILE (original_end) = 0; + } + + /* Process all subblocks. */ + for (subblock = BLOCK_SUBBLOCKS (block); + subblock; + subblock = TREE_CHAIN (subblock)) + adjust_copied_decl_tree (subblock); +} + /* Make the insns and PARM_DECLs of the current function permanent and record other information in DECL_SAVED_INSNS to allow inlining of this function in subsequent calls. @@ -509,8 +533,14 @@ save_for_inline_copying (fndecl) continue; copy = rtx_alloc (NOTE); - NOTE_SOURCE_FILE (copy) = NOTE_SOURCE_FILE (insn); NOTE_LINE_NUMBER (copy) = NOTE_LINE_NUMBER (insn); + if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END) + NOTE_SOURCE_FILE (copy) = NOTE_SOURCE_FILE (insn); + else + { + NOTE_SOURCE_FILE (insn) = (char *) copy; + NOTE_SOURCE_FILE (copy) = 0; + } break; case INSN: @@ -542,6 +572,8 @@ save_for_inline_copying (fndecl) last_insn = copy; } + adjust_copied_decl_tree (DECL_INITIAL (fndecl)); + /* Now copy the REG_NOTES. */ for (insn = NEXT_INSN (get_insns ()); insn; insn = NEXT_INSN (insn)) if (GET_RTX_CLASS (GET_CODE (insn)) == 'i' |