aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-08-18 08:46:04 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-08-18 08:46:04 +0000
commit50d5bc4e3b53eb8bb4ebf198f1213348a3fa0f38 (patch)
treefdc28428e13d0fe1622e349665af548a3c120301 /lib/Analysis/BugReporter.cpp
parent4f9449d8d84f10ecc645ead0a290006e3c95a898 (diff)
Now we can get the CFG from the ProgramPoint. No need to pass in the
BugReporter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 354bafd989..745e90c38e 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -1206,12 +1206,14 @@ void BugType::FlushReports(BugReporter &BR) {}
BugReport::~BugReport() {}
RangedBugReport::~RangedBugReport() {}
-const Stmt* BugReport::getStmt(BugReporter& BR) const {
+const Stmt* BugReport::getStmt() const {
ProgramPoint ProgP = EndNode->getLocation();
const Stmt *S = NULL;
if (BlockEntrance* BE = dyn_cast<BlockEntrance>(&ProgP)) {
- if (BE->getBlock() == &BR.getCFG()->getExit()) S = GetPreviousStmt(EndNode);
+ CFGBlock &Exit = ProgP.getContext()->getCFG()->getExit();
+ if (BE->getBlock() == &Exit)
+ S = GetPreviousStmt(EndNode);
}
if (!S)
S = GetStmt(ProgP);
@@ -1223,7 +1225,7 @@ PathDiagnosticPiece*
BugReport::getEndPath(BugReporterContext& BRC,
const ExplodedNode* EndPathNode) {
- const Stmt* S = getStmt(BRC.getBugReporter());
+ const Stmt* S = getStmt();
if (!S)
return NULL;
@@ -1246,7 +1248,7 @@ BugReport::getEndPath(BugReporterContext& BRC,
void BugReport::getRanges(BugReporter& BR, const SourceRange*& beg,
const SourceRange*& end) {
- if (const Expr* E = dyn_cast_or_null<Expr>(getStmt(BR))) {
+ if (const Expr* E = dyn_cast_or_null<Expr>(getStmt())) {
R = E->getSourceRange();
assert(R.isValid());
beg = &R;