diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-17 09:33:03 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-17 09:33:03 +0000 |
commit | b11416d061f6710b0548bb6fbd730a32b8e66226 (patch) | |
tree | 6a69d5fda952634036fd64b7b0b1b89eb788cb3a /clang/lib/Index/ASTLocation.cpp | |
parent | ca0a53ac52992973d9aad654f4d8e2961d174de4 (diff) | |
download | bcm5719-llvm-b11416d061f6710b0548bb6fbd730a32b8e66226.tar.gz bcm5719-llvm-b11416d061f6710b0548bb6fbd730a32b8e66226.zip |
Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.
llvm-svn: 101632
Diffstat (limited to 'clang/lib/Index/ASTLocation.cpp')
-rw-r--r-- | clang/lib/Index/ASTLocation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Index/ASTLocation.cpp b/clang/lib/Index/ASTLocation.cpp index c24f3bf5b3c..091bc78c266 100644 --- a/clang/lib/Index/ASTLocation.cpp +++ b/clang/lib/Index/ASTLocation.cpp @@ -87,7 +87,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { case N_Decl: OS << "[Decl: " << AsDecl()->getDeclKindName() << " "; if (const NamedDecl *ND = dyn_cast<NamedDecl>(AsDecl())) - OS << ND->getNameAsString(); + OS << ND; break; case N_Stmt: @@ -97,7 +97,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { case N_NamedRef: OS << "[NamedRef: " << AsNamedRef().ND->getDeclKindName() << " "; - OS << AsNamedRef().ND->getNameAsString(); + OS << AsNamedRef().ND; break; case N_Type: { |