aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.c
diff options
authorChristopher Li <sparse@chrisli.org>2007-03-23 16:08:17 -0700
committerJosh Triplett <josh@freedesktop.org>2007-04-20 03:07:44 -0700
commit03d8dff35eff1454f3747ca3482cd1f3c21c4e0b (patch)
treee5fa229c5a905aed8b3378d85ae3183df7582191 /linearize.c
parent5ca722cb2092be289ddfb779420d7d0bc7914bf8 (diff)
downloadsparse-dev-03d8dff35eff1454f3747ca3482cd1f3c21c4e0b.tar.gz
Fix the annotated inline call position
Here is some diff comparing output between the sparse 0.2 and the tip of git. -mm/mmap.c:1631:2: warning: context imbalance in 'expand_stack' - different lock contexts for basic block +include/linux/rmap.h:55:2: warning: context imbalance in 'expand_stack' - diffe The change is introduced by the inline annotate instruction, which mark the bb->pos to the inline function. This change make it back to the caller position. Signed-Off-By: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'linearize.c')
-rw-r--r--linearize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linearize.c b/linearize.c
index 26f12b69..d428d924 100644
--- a/linearize.c
+++ b/linearize.c
@@ -1650,6 +1650,7 @@ static pseudo_t linearize_inlined_call(struct entrypoint *ep, struct statement *
{
struct instruction *insn = alloc_instruction(OP_INLINED_CALL, 0);
struct statement *args = stmt->args;
+ struct basic_block *bb;
pseudo_t pseudo;
if (args) {
@@ -1664,6 +1665,9 @@ static pseudo_t linearize_inlined_call(struct entrypoint *ep, struct statement *
insn->target = pseudo = linearize_compound_statement(ep, stmt);
use_pseudo(insn, symbol_pseudo(ep, stmt->inline_fn), &insn->func);
+ bb = ep->active;
+ if (bb && !bb->insns)
+ bb->pos = stmt->pos;
add_one_insn(ep, insn);
return pseudo;
}