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/AST/Expr.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/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 7c715bd3c3a..88b5b5e5674 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -290,14 +290,12 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { // For incorrect code, there might not be an ObjCInterfaceDecl. Do // a null check to avoid a crash. if (const ObjCInterfaceDecl *ID = MD->getClassInterface()) - Out << ID->getNameAsString(); + Out << ID; if (const ObjCCategoryImplDecl *CID = - dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext())) { - Out << '('; - Out << CID->getNameAsString(); - Out << ')'; - } + dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext())) + Out << '(' << CID << ')'; + Out << ' '; Out << MD->getSelector().getAsString(); Out << ']'; |