Skip to content

Commit

Permalink
[analyzer] AnalysisConsumer: print fully-qualified function name whil…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
Yury Gribov committed Feb 3, 2016
1 parent 82e1168 commit 8f7d8b6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
Expand Up @@ -274,7 +274,7 @@ class AnalysisConsumer : public AnalysisASTConsumer,
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:"
Expand Down
26 changes: 26 additions & 0 deletions 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

0 comments on commit 8f7d8b6

Please sign in to comment.