summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2019-09-25 14:50:12 +0000
committerIlya Biryukov <ibiryukov@google.com>2019-09-25 14:50:12 +0000
commit71472a3eeceb9ea513a1d3c672fc2e47d77cc741 (patch)
tree6008a87735cf52c6cffd3eb416a998b90044745e /clang/lib/AST/Decl.cpp
parenta1639b9bba7cc6ef32a6a0c4db4f98301b91f6be (diff)
downloadbcm5719-llvm-71472a3eeceb9ea513a1d3c672fc2e47d77cc741.tar.gz
bcm5719-llvm-71472a3eeceb9ea513a1d3c672fc2e47d77cc741.zip
Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Reason: causes a test failure, will investigate and re-land with a fix. llvm-svn: 372880
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 48d7c89ebba..b27ac907b8b 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1558,19 +1558,6 @@ void NamedDecl::printQualifiedName(raw_ostream &OS) const {
void NamedDecl::printQualifiedName(raw_ostream &OS,
const PrintingPolicy &P) const {
- printNestedNameSpecifier(OS, P);
- if (getDeclName() || isa<DecompositionDecl>(this))
- OS << *this;
- else
- OS << "(anonymous)";
-}
-
-void NamedDecl::printNestedNameSpecifier(raw_ostream &OS) const {
- printNestedNameSpecifier(OS, getASTContext().getPrintingPolicy());
-}
-
-void NamedDecl::printNestedNameSpecifier(raw_ostream &OS,
- const PrintingPolicy &P) const {
const DeclContext *Ctx = getDeclContext();
// For ObjC methods and properties, look through categories and use the
@@ -1584,8 +1571,10 @@ void NamedDecl::printNestedNameSpecifier(raw_ostream &OS,
Ctx = ID;
}
- if (Ctx->isFunctionOrMethod())
+ if (Ctx->isFunctionOrMethod()) {
+ printName(OS);
return;
+ }
using ContextsTy = SmallVector<const DeclContext *, 8>;
ContextsTy Contexts;
@@ -1655,6 +1644,11 @@ void NamedDecl::printNestedNameSpecifier(raw_ostream &OS,
}
OS << "::";
}
+
+ if (getDeclName() || isa<DecompositionDecl>(this))
+ OS << *this;
+ else
+ OS << "(anonymous)";
}
void NamedDecl::getNameForDiagnostic(raw_ostream &OS,
OpenPOWER on IntegriCloud