diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-12-05 02:46:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-12-05 02:46:48 +0000 |
commit | 5679f678630cb03ba76592a426981297c0203d47 (patch) | |
tree | fea188fd25e14b1d9ef2e7f791838ee0f4e0d5c7 /gcc/cp/optimize.c | |
parent | 86fff623afa161dc0997319a2112ac51f62ef0ed (diff) | |
download | gcc-5679f678630cb03ba76592a426981297c0203d47.zip gcc-5679f678630cb03ba76592a426981297c0203d47.tar.gz gcc-5679f678630cb03ba76592a426981297c0203d47.tar.bz2 |
optimize.c (expand_call_inline): Wrap the expanded call in an EXPR_WITH_FILE_LOCATION node to get correct line...
* optimize.c (expand_call_inline): Wrap the expanded call in an
EXPR_WITH_FILE_LOCATION node to get correct line numbers for
inlined functions.
From-SVN: r30784
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r-- | gcc/cp/optimize.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 5716166..8e474a8 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -641,15 +641,20 @@ expand_call_inline (tp, walk_subtrees, data) /* The new expression has side-effects if the old one did. */ TREE_SIDE_EFFECTS (expr) = TREE_SIDE_EFFECTS (t); + + /* Replace the call by the inlined body. Wrap it in an + EXPR_WITH_FILE_LOCATION so that we'll get debugging line notes + pointing to the right place. */ + chain = TREE_CHAIN (*tp); + *tp = build_expr_wfl (expr, DECL_SOURCE_FILE (fn), DECL_SOURCE_LINE (fn), + /*col=*/0); + EXPR_WFL_EMIT_LINE_NOTE (*tp) = 1; + TREE_CHAIN (*tp) = chain; + /* If the value of the new expression is ignored, that's OK. We don't warn about this for CALL_EXPRs, so we shouldn't warn about the equivalent inlined version either. */ - TREE_USED (expr) = 1; - - /* Replace the call by the inlined body. */ - chain = TREE_CHAIN (*tp); - *tp = expr; - TREE_CHAIN (expr) = chain; + TREE_USED (*tp) = 1; /* Recurse into the body of the just inlined function. */ expand_calls_inline (tp, id); |