From d4da8728baeaf722ff0c53c8b8d3b49c53486111 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 14 May 2013 21:04:00 +0000 Subject: 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 --- clang/lib/AST/ASTDumper.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/AST/ASTDumper.cpp') diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index 340cc41f7e8..790538fcd06 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -449,9 +449,7 @@ void ASTDumper::dumpBareDeclRef(const Decl *D) { if (const NamedDecl *ND = dyn_cast(D)) { ColorScope Color(*this, DeclNameColor); - OS << " '"; - ND->getDeclName().printName(OS); - OS << "'"; + OS << " '" << ND->getDeclName() << '\''; } if (const ValueDecl *VD = dyn_cast(D)) -- cgit v1.2.3