summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-04 20:34:31 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-04 20:34:31 +0000
commited2246aa2a283eb178a3ef03f5aea1023de2d43b (patch)
treee7fa1c65bcf7510a2c5fdfd0e69dc6d87b958500 /clang/lib/Analysis/BugReporter.cpp
parent75d6fa27bdb5c23d255d1739e48ab3f4faf9057f (diff)
downloadbcm5719-llvm-ed2246aa2a283eb178a3ef03f5aea1023de2d43b.tar.gz
bcm5719-llvm-ed2246aa2a283eb178a3ef03f5aea1023de2d43b.zip
Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.
llvm-svn: 90584
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index c26a60af9c8..e6482698dd4 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -204,10 +204,19 @@ PathDiagnosticBuilder::ExecutionContinues(llvm::raw_string_ostream& os,
os << "Execution continues on line "
<< getSourceManager().getInstantiationLineNumber(Loc.asLocation())
<< '.';
- else
- os << "Execution jumps to the end of the "
- << (isa<ObjCMethodDecl>(N->getLocationContext()->getDecl()) ?
- "method" : "function") << '.';
+ else {
+ os << "Execution jumps to the end of the ";
+ const Decl *D = N->getLocationContext()->getDecl();
+ if (isa<ObjCMethodDecl>(D))
+ os << "method";
+ else if (isa<FunctionDecl>(D))
+ os << "function";
+ else {
+ assert(isa<BlockDecl>(D));
+ os << "anonymous block";
+ }
+ os << '.';
+ }
return Loc;
}
OpenPOWER on IntegriCloud