aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-04-17 09:33:03 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-04-17 09:33:03 +0000
commit900fc6388e803868a34b9483510c345e9b49d7eb (patch)
tree039296944edf1cf7ea7bcff92bcd42d550fb9c84 /lib/AST/DeclObjC.cpp
parent7a22f02a02616be8fd817529f1696a88a35ee041 (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/AST/DeclObjC.cpp')
-rw-r--r--lib/AST/DeclObjC.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index db46d89a76..dc4aacdb51 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -843,6 +843,12 @@ FindPropertyImplDecl(IdentifierInfo *Id) const {
return 0;
}
+llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
+ const ObjCCategoryImplDecl *CID) {
+ OS << CID->getName();
+ return OS;
+}
+
//===----------------------------------------------------------------------===//
// ObjCImplementationDecl
//===----------------------------------------------------------------------===//
@@ -855,6 +861,12 @@ ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC,
return new (C) ObjCImplementationDecl(DC, L, ClassInterface, SuperDecl);
}
+llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
+ const ObjCImplementationDecl *ID) {
+ OS << ID->getName();
+ return OS;
+}
+
//===----------------------------------------------------------------------===//
// ObjCCompatibleAliasDecl
//===----------------------------------------------------------------------===//