diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-05-14 21:04:00 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-05-14 21:04:00 +0000 |
commit | d4da8728baeaf722ff0c53c8b8d3b49c53486111 (patch) | |
tree | 077650393506345a7a2c767648824f47859c6a2f /clang/lib/AST/ASTDiagnostic.cpp | |
parent | 9fbc230de22d95bfc624571302c2738c994dd834 (diff) | |
download | bcm5719-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/lib/AST/ASTDiagnostic.cpp')
-rw-r--r-- | clang/lib/AST/ASTDiagnostic.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 766a7a995b7..e0f552ba67c 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -300,8 +300,7 @@ void clang::FormatASTNodeDiagnosticArgument( assert(ModLen == 0 && ArgLen == 0 && "Invalid modifier for DeclarationName argument"); - DeclarationName N = DeclarationName::getFromOpaqueInteger(Val); - N.printName(OS); + OS << DeclarationName::getFromOpaqueInteger(Val); break; } case DiagnosticsEngine::ak_nameddecl: { |