diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /lib/StaticAnalyzer/Core/ExplodedGraph.cpp | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index e9c4a35..1c9a282 100644 --- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -34,7 +34,7 @@ using namespace ento; ExplodedNode::Auditor::~Auditor() {} #ifndef NDEBUG -static ExplodedNode::Auditor* NodeAuditor = 0; +static ExplodedNode::Auditor* NodeAuditor = nullptr; #endif void ExplodedNode::SetAuditor(ExplodedNode::Auditor* A) { @@ -90,8 +90,9 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) { // (7) The LocationContext is the same as the predecessor. // (8) Expressions that are *not* lvalue expressions. // (9) The PostStmt isn't for a non-consumed Stmt or Expr. - // (10) The successor is not a CallExpr StmtPoint (so that we would - // be able to find it when retrying a call with no inlining). + // (10) The successor is neither a CallExpr StmtPoint nor a CallEnter or + // PreImplicitCall (so that we would be able to find it when retrying a + // call with no inlining). // FIXME: It may be safe to reclaim PreCall and PostCall nodes as well. // Conditions 1 and 2. @@ -153,6 +154,10 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) { if (CallEvent::isCallStmt(SP->getStmt())) return false; + // Condition 10, continuation. + if (SuccLoc.getAs<CallEnter>() || SuccLoc.getAs<PreImplicitCall>()) + return false; + return true; } @@ -271,11 +276,11 @@ unsigned ExplodedNode::NodeGroup::size() const { ExplodedNode * const *ExplodedNode::NodeGroup::begin() const { if (getFlag()) - return 0; + return nullptr; const GroupStorage &Storage = reinterpret_cast<const GroupStorage &>(P); if (Storage.isNull()) - return 0; + return nullptr; if (ExplodedNodeVector *V = Storage.dyn_cast<ExplodedNodeVector *>()) return V->begin(); return Storage.getAddrOfPtr1(); @@ -283,11 +288,11 @@ ExplodedNode * const *ExplodedNode::NodeGroup::begin() const { ExplodedNode * const *ExplodedNode::NodeGroup::end() const { if (getFlag()) - return 0; + return nullptr; const GroupStorage &Storage = reinterpret_cast<const GroupStorage &>(P); if (Storage.isNull()) - return 0; + return nullptr; if (ExplodedNodeVector *V = Storage.dyn_cast<ExplodedNodeVector *>()) return V->end(); return Storage.getAddrOfPtr1() + 1; @@ -299,7 +304,7 @@ ExplodedNode *ExplodedGraph::getNode(const ProgramPoint &L, bool* IsNew) { // Profile 'State' to determine if we already have an existing node. llvm::FoldingSetNodeID profile; - void *InsertPos = 0; + void *InsertPos = nullptr; NodeTy::Profile(profile, L, State, IsSink); NodeTy* V = Nodes.FindNodeOrInsertPos(profile, InsertPos); @@ -337,7 +342,7 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, InterExplodedGraphMap *InverseMap) const{ if (Nodes.empty()) - return 0; + return nullptr; typedef llvm::DenseSet<const ExplodedNode*> Pass1Ty; Pass1Ty Pass1; @@ -380,7 +385,7 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, // We didn't hit a root? Return with a null pointer for the new graph. if (WL2.empty()) - return 0; + return nullptr; // Create an empty graph. ExplodedGraph* G = MakeEmptyGraph(); @@ -395,7 +400,8 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, // Create the corresponding node in the new graph and record the mapping // from the old node to the new node. - ExplodedNode *NewN = G->getNode(N->getLocation(), N->State, N->isSink(), 0); + ExplodedNode *NewN = G->getNode(N->getLocation(), N->State, N->isSink(), + nullptr); Pass2[N] = NewN; // Also record the reverse mapping from the new node to the old node. |