[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
This commit is contained in:
Yury Gribov 2016-02-03 13:35:33 +00:00
parent 82e1168989
commit 8f7d8b6c32
2 changed files with 27 additions and 1 deletions

View File

@ -274,7 +274,7 @@ public:
llvm::errs() << ": " << Loc.getFilename();
if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) {
const NamedDecl *ND = cast<NamedDecl>(D);
llvm::errs() << ' ' << *ND << '\n';
llvm::errs() << ' ' << ND->getQualifiedNameAsString() << '\n';
}
else if (isa<BlockDecl>(D)) {
llvm::errs() << ' ' << "block(line:" << Loc.getLine() << ",col:"

View File

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