diff options
author | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-16 03:50:38 +0000 |
---|---|---|
committer | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-16 03:50:38 +0000 |
commit | 58191966bc55437ba5f6a246bae74635064c2d26 (patch) | |
tree | 7e795de94a9138af8d28986e989de917693f6768 /clang/lib/Checker | |
parent | 298d0fd1c8895122313dc88245f4c51d4570afdb (diff) | |
download | bcm5719-llvm-58191966bc55437ba5f6a246bae74635064c2d26.tar.gz bcm5719-llvm-58191966bc55437ba5f6a246bae74635064c2d26.zip |
Refactored BugReporter to refer to EndNode as ErrorNode. We currently make the assumption that EndNode == ErrorNode, but upcoming changes will break this.
llvm-svn: 114065
Diffstat (limited to 'clang/lib/Checker')
-rw-r--r-- | clang/lib/Checker/BugReporter.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Checker/CFRefCount.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Checker/GRExprEngine.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp index a3f4f032a28..b300a05b898 100644 --- a/clang/lib/Checker/BugReporter.cpp +++ b/clang/lib/Checker/BugReporter.cpp @@ -168,9 +168,9 @@ public: PathDiagnosticLocation ExecutionContinues(llvm::raw_string_ostream& os, const ExplodedNode* N); - Decl const &getCodeDecl() { return R->getEndNode()->getCodeDecl(); } + Decl const &getCodeDecl() { return R->getErrorNode()->getCodeDecl(); } - ParentMap& getParentMap() { return R->getEndNode()->getParentMap(); } + ParentMap& getParentMap() { return R->getErrorNode()->getParentMap(); } const Stmt *getParent(const Stmt *S) { return getParentMap().getParent(S); @@ -1216,13 +1216,13 @@ BugReport::~BugReport() {} RangedBugReport::~RangedBugReport() {} const Stmt* BugReport::getStmt() const { - ProgramPoint ProgP = EndNode->getLocation(); + ProgramPoint ProgP = ErrorNode->getLocation(); const Stmt *S = NULL; if (BlockEntrance* BE = dyn_cast<BlockEntrance>(&ProgP)) { CFGBlock &Exit = ProgP.getLocationContext()->getCFG()->getExit(); if (BE->getBlock() == &Exit) - S = GetPreviousStmt(EndNode); + S = GetPreviousStmt(ErrorNode); } if (!S) S = GetStmt(ProgP); @@ -1266,8 +1266,8 @@ void BugReport::getRanges(const SourceRange*& beg, const SourceRange*& end) { } SourceLocation BugReport::getLocation() const { - if (EndNode) - if (const Stmt* S = GetCurrentOrPreviousStmt(EndNode)) { + if (ErrorNode) + if (const Stmt* S = GetCurrentOrPreviousStmt(ErrorNode)) { // For member expressions, return the location of the '.' or '->'. if (const MemberExpr *ME = dyn_cast<MemberExpr>(S)) return ME->getMemberLoc(); @@ -1665,7 +1665,7 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ, // by a sink, simply add all the nodes in the equivalence class to 'Nodes'. if (!BT.isSuppressOnSink()) { for (BugReportEquivClass::iterator I=EQ.begin(), E=EQ.end(); I!=E; ++I) { - const ExplodedNode* N = I->getEndNode(); + const ExplodedNode* N = I->getErrorNode(); if (N) { R = *I; Nodes.push_back(N); @@ -1684,7 +1684,7 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ, for (; I != E; ++I) { R = *I; - const ExplodedNode *N = R->getEndNode(); + const ExplodedNode *N = R->getErrorNode(); if (!N) continue; diff --git a/clang/lib/Checker/CFRefCount.cpp b/clang/lib/Checker/CFRefCount.cpp index 6fa48b2923f..35451a18669 100644 --- a/clang/lib/Checker/CFRefCount.cpp +++ b/clang/lib/Checker/CFRefCount.cpp @@ -2442,7 +2442,7 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug& D, const CFRefCount &tf, const ExplodedNode* AllocNode = 0; llvm::tie(AllocNode, AllocBinding) = // Set AllocBinding. - GetAllocationSite(Eng.getStateManager(), getEndNode(), getSymbol()); + GetAllocationSite(Eng.getStateManager(), getErrorNode(), getSymbol()); // Get the SourceLocation for the allocation site. ProgramPoint P = AllocNode->getLocation(); diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp index e01c645a898..35f043f5cd8 100644 --- a/clang/lib/Checker/GRExprEngine.cpp +++ b/clang/lib/Checker/GRExprEngine.cpp @@ -3726,7 +3726,7 @@ void GRExprEngine::ViewGraph(bool trim) { I2!=E2; ++I2) { const BugReportEquivClass& EQ = *I2; const BugReport &R = **EQ.begin(); - ExplodedNode *N = const_cast<ExplodedNode*>(R.getEndNode()); + ExplodedNode *N = const_cast<ExplodedNode*>(R.getErrorNode()); if (N) Src.push_back(N); } } |