From: Yury Gribov Date: Wed, 3 Feb 2016 13:35:33 +0000 (+0000) Subject: [analyzer] AnalysisConsumer: print fully-qualified function name while displaying... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f7d8b6c32db2249e2f2788a22bea70e43d73e4a;p=platform%2Fupstream%2Fllvm.git [analyzer] AnalysisConsumer: print fully-qualified function name while displaying progress -analyzer-display progress option prints only function names which may be ambiguous. This patch forces AnalysisConsumer to print fully-qualified function names. Patch by Alex Sidorin! Differential Revision: http://reviews.llvm.org/D16804 llvm-svn: 259646 --- diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index d144685..083ee51 100644 --- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -274,7 +274,7 @@ public: llvm::errs() << ": " << Loc.getFilename(); if (isa(D) || isa(D)) { const NamedDecl *ND = cast(D); - llvm::errs() << ' ' << *ND << '\n'; + llvm::errs() << ' ' << ND->getQualifiedNameAsString() << '\n'; } else if (isa(D)) { llvm::errs() << ' ' << "block(line:" << Loc.getLine() << ",col:" diff --git a/clang/test/Analysis/analyze_display_progress.cpp b/clang/test/Analysis/analyze_display_progress.cpp new file mode 100644 index 0000000..c84ab63 --- /dev/null +++ b/clang/test/Analysis/analyze_display_progress.cpp @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s + +void f() {}; +void g() {}; +void h() {} + +struct SomeStruct { + void f() {} +}; + +struct SomeOtherStruct { + void f() {} +}; + +namespace ns { + struct SomeStruct { + void f() {} + }; +} + +// CHECK: analyze_display_progress.cpp f +// CHECK: analyze_display_progress.cpp g +// CHECK: analyze_display_progress.cpp h +// CHECK: analyze_display_progress.cpp SomeStruct::f +// CHECK: analyze_display_progress.cpp SomeOtherStruct::f +// CHECK: analyze_display_progress.cpp ns::SomeStruct::f