Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.

llvm-svn: 90584
This commit is contained in:
Ted Kremenek 2009-12-04 20:34:31 +00:00
parent 75d6fa27bd
commit ed2246aa2a
1 changed files with 13 additions and 4 deletions

View File

@ -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;
}