diff options
| author | Craig Topper <craig.topper@gmail.com> | 2014-05-27 02:45:47 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2014-05-27 02:45:47 +0000 |
| commit | 1843a2095a5509f59f7108b17ab817b92e55c6eb (patch) | |
| tree | 9ed7a259162848318872a9fb37a7d50ba56d0e8d /lib/StaticAnalyzer/Core/ExplodedGraph.cpp | |
| parent | 9d0a0d8e196610bb7fef57a5fa034b2f628f870f (diff) | |
| download | clang-1843a2095a5509f59f7108b17ab817b92e55c6eb.tar.gz clang-1843a2095a5509f59f7108b17ab817b92e55c6eb.tar.bz2 clang-1843a2095a5509f59f7108b17ab817b92e55c6eb.tar.xz | |
[C++11] Use 'nullptr'. StaticAnalyzer edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
| -rw-r--r-- | lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index 7812c96f86..1c9a282b82 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) { @@ -276,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(); @@ -288,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; @@ -304,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); @@ -342,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; @@ -385,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(); @@ -400,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. |
