[cfe-commits] r90584 - /cfe/trunk/lib/Analysis/BugReporter.cpp
Ted Kremenek
kremenek at apple.com
Fri Dec 4 12:34:32 PST 2009
Author: kremenek
Date: Fri Dec 4 14:34:31 2009
New Revision: 90584
URL: http://llvm.org/viewvc/llvm-project?rev=90584&view=rev
Log:
Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.
Modified:
cfe/trunk/lib/Analysis/BugReporter.cpp
Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=90584&r1=90583&r2=90584&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Fri Dec 4 14:34:31 2009
@@ -204,10 +204,19 @@
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;
}
More information about the cfe-commits
mailing list