summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2017-11-23 05:38:20 +0000
committerSerge Pavlov <sepavloff@gmail.com>2017-11-23 05:38:20 +0000
commit842022a0f150e6653fd36ee606743a711db5f4f8 (patch)
treee61251f42c8052988bb11937df074821a3a57a4e /clang/lib/AST
parentc5b8e8b97f233f373607e817845904b6443add68 (diff)
downloadbcm5719-llvm-842022a0f150e6653fd36ee606743a711db5f4f8.tar.gz
bcm5719-llvm-842022a0f150e6653fd36ee606743a711db5f4f8.zip
[DeclPrinter] Allow printing fully qualified name of function declaration
When requesting a tooltip for a function call in an IDE, the fully qualified name helps to remove ambiguity in the function signature. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40013 llvm-svn: 318896
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index b810dd74738..b792c5920a5 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -580,13 +580,19 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
PrintingPolicy SubPolicy(Policy);
SubPolicy.SuppressSpecifiers = false;
std::string Proto;
- if (!Policy.SuppressScope) {
- if (const NestedNameSpecifier *NS = D->getQualifier()) {
- llvm::raw_string_ostream OS(Proto);
- NS->print(OS, Policy);
+
+ if (Policy.FullyQualifiedName) {
+ Proto += D->getQualifiedNameAsString();
+ } else {
+ if (!Policy.SuppressScope) {
+ if (const NestedNameSpecifier *NS = D->getQualifier()) {
+ llvm::raw_string_ostream OS(Proto);
+ NS->print(OS, Policy);
+ }
}
+ Proto += D->getNameInfo().getAsString();
}
- Proto += D->getNameInfo().getAsString();
+
if (GuideDecl)
Proto = GuideDecl->getDeducedTemplate()->getDeclName().getAsString();
if (const TemplateArgumentList *TArgs = D->getTemplateSpecializationArgs()) {
OpenPOWER on IntegriCloud