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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2f9c2bd5e520f31ac9c2541debf1709bb6b4bab;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259646 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index d1446855e0..083ee51a99 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/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/test/Analysis/analyze_display_progress.cpp b/test/Analysis/analyze_display_progress.cpp new file mode 100644 index 0000000000..c84ab63de4 --- /dev/null +++ b/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