diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-04 20:34:31 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-04 20:34:31 +0000 |
commit | 4f1db537722e8d46146cd95f5962a6dcf6e44e54 (patch) | |
tree | d348e2be5332e6c5189cd77da096423135b36bf1 /lib/Analysis/BugReporter.cpp | |
parent | 224451bf4ec994e51cdfd994eda3ed1b6a0dae3e (diff) |
Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index c26a60af9c..e6482698dd 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/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; } |