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 | 900fc6388e803868a34b9483510c345e9b49d7eb (patch) | |
tree | 039296944edf1cf7ea7bcff92bcd42d550fb9c84 /lib/Sema | |
parent | 7a22f02a02616be8fd817529f1696a88a35ee041 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/CodeCompleteConsumer.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaInit.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index 9f0ee5cde7..0ef9a15faa 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -425,7 +425,7 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, OS << "COMPLETION: "; switch (Results[I].Kind) { case Result::RK_Declaration: - OS << Results[I].Declaration->getNameAsString() ; + OS << Results[I].Declaration; if (Results[I].Hidden) OS << " (Hidden)"; if (CodeCompletionString *CCS diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index e50a860265..76de0729b5 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -4020,8 +4020,7 @@ void InitializationSequence::dump(llvm::raw_ostream &OS) const { break; case SK_UserConversion: - OS << "user-defined conversion via " - << S->Function.Function->getNameAsString(); + OS << "user-defined conversion via " << S->Function.Function; break; case SK_QualificationConversionRValue: diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 3d1fa434dc..c4a42cd1ef 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -226,7 +226,7 @@ void UserDefinedConversionSequence::DebugPrint() const { Before.DebugPrint(); OS << " -> "; } - OS << "'" << ConversionFunction->getNameAsString() << "'"; + OS << '\'' << ConversionFunction << '\''; if (After.First || After.Second || After.Third) { OS << " -> "; After.DebugPrint(); |