summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexUSRs.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-05-14 21:04:00 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-05-14 21:04:00 +0000
commitd4da8728baeaf722ff0c53c8b8d3b49c53486111 (patch)
tree077650393506345a7a2c767648824f47859c6a2f /clang/tools/libclang/CIndexUSRs.cpp
parent9fbc230de22d95bfc624571302c2738c994dd834 (diff)
downloadbcm5719-llvm-d4da8728baeaf722ff0c53c8b8d3b49c53486111.tar.gz
bcm5719-llvm-d4da8728baeaf722ff0c53c8b8d3b49c53486111.zip
Provide operator<< for stream output of DeclarationNames
ASTDumper was already trying to do this & instead got an implicit bool conversion by surprise (thus printing out 0 or 1 instead of the name of the declaration). To avoid that issue & simplify call sites, simply make it the normal/expected operator<<(raw_ostream&, ...) overload & simplify all the existing call sites. (bonus: this function doesn't need to be a member or friend, it's just using public API in DeclarationName) llvm-svn: 181832
Diffstat (limited to 'clang/tools/libclang/CIndexUSRs.cpp')
-rw-r--r--clang/tools/libclang/CIndexUSRs.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/tools/libclang/CIndexUSRs.cpp b/clang/tools/libclang/CIndexUSRs.cpp
index 96c1d2e11de..4e474359969 100644
--- a/clang/tools/libclang/CIndexUSRs.cpp
+++ b/clang/tools/libclang/CIndexUSRs.cpp
@@ -309,9 +309,8 @@ void USRGenerator::VisitObjCMethodDecl(const ObjCMethodDecl *D) {
// Ideally we would use 'GenObjCMethod', but this is such a hot path
// for Objective-C code that we don't want to use
// DeclarationName::getAsString().
- Out << (D->isInstanceMethod() ? "(im)" : "(cm)");
- DeclarationName N(D->getSelector());
- N.printName(Out);
+ Out << (D->isInstanceMethod() ? "(im)" : "(cm)")
+ << DeclarationName(D->getSelector());
}
void USRGenerator::VisitObjCContainerDecl(const ObjCContainerDecl *D) {
OpenPOWER on IntegriCloud