summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorGabor Horvath <xazax@google.com>2019-12-11 11:34:44 -0800
committerGabor Horvath <xazax@google.com>2019-12-11 17:15:12 -0800
commit9fdcae7c81f5ff92ad694f5d993a042a525fd6bc (patch)
treefb392a017fd46a9315d0a76abaf0c608a59e5d1a /clang/lib/Analysis
parent83e1bd36be988ffce4732f400ff6f06442c34011 (diff)
downloadbcm5719-llvm-9fdcae7c81f5ff92ad694f5d993a042a525fd6bc.tar.gz
bcm5719-llvm-9fdcae7c81f5ff92ad694f5d993a042a525fd6bc.zip
[analyzer] Do not cache out on some shared implicit AST nodes
Some AST nodes which stands for implicit initialization is shared. The analyzer will do the same evaluation on the same nodes resulting in the same state. The analyzer will "cache out", i.e. it thinks that it visited an already existing node in the exploded graph. This is not true in this case and we lose coverage. Since these nodes do not really require any processing from the analyzer we just omit them from the CFG. Differential Revision: https://reviews.llvm.org/D71371
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index bc21d1c9076..e10bfd80593 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -2135,6 +2135,11 @@ CFGBlock *CFGBuilder::Visit(Stmt * S, AddStmtChoice asc,
default:
return VisitStmt(S, asc);
+ case Stmt::ImplicitValueInitExprClass:
+ if (BuildOpts.OmitImplicitValueInitializers)
+ return Block;
+ return VisitStmt(S, asc);
+
case Stmt::AddrLabelExprClass:
return VisitAddrLabelExpr(cast<AddrLabelExpr>(S), asc);
OpenPOWER on IntegriCloud