summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/AnalyzerStatsChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Checker/AnalyzerStatsChecker.cpp')
-rw-r--r--clang/lib/Checker/AnalyzerStatsChecker.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/Checker/AnalyzerStatsChecker.cpp b/clang/lib/Checker/AnalyzerStatsChecker.cpp
index 9badb79625d..c484537e957 100644
--- a/clang/lib/Checker/AnalyzerStatsChecker.cpp
+++ b/clang/lib/Checker/AnalyzerStatsChecker.cpp
@@ -83,16 +83,18 @@ void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G,
llvm::SmallString<128> buf;
llvm::raw_svector_ostream output(buf);
PresumedLoc Loc = SM.getPresumedLoc(D->getLocation());
- output << Loc.getFilename() << " : ";
+ if (Loc.isValid()) {
+ output << Loc.getFilename() << " : ";
- if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
- const NamedDecl *ND = cast<NamedDecl>(D);
- output << ND;
- }
- else if (isa<BlockDecl>(D)) {
- output << "block(line:" << Loc.getLine() << ":col:" << Loc.getColumn();
+ if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
+ const NamedDecl *ND = cast<NamedDecl>(D);
+ output << ND;
+ }
+ else if (isa<BlockDecl>(D)) {
+ output << "block(line:" << Loc.getLine() << ":col:" << Loc.getColumn();
+ }
}
-
+
output << " -> Total CFGBlocks: " << total << " | Unreachable CFGBlocks: "
<< unreachable << " | Aborted Block: "
<< (Eng.wasBlockAborted() ? "yes" : "no")
OpenPOWER on IntegriCloud