diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-07 11:57:45 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-07 11:57:45 +0000 |
commit | f978059b82db8c0d849c5f992036210b5ca53200 (patch) | |
tree | 7519cf9a37d26f83cc585900ad576d32eb6e7d22 | |
parent | 01d08018b7cf5ce1601707cfd7a84d22015fc04e (diff) |
Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with NamedDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149981 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclObjC.h | 6 | ||||
-rw-r--r-- | lib/AST/DeclObjC.cpp | 8 | ||||
-rw-r--r-- | lib/AST/Expr.cpp | 2 | ||||
-rw-r--r-- | lib/AST/Mangle.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 2 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp | 4 |
6 files changed, 11 insertions, 13 deletions
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 59fcc2316f..04fbf751e1 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -1498,8 +1498,7 @@ public: friend class ASTDeclWriter; }; -raw_ostream &operator<<(raw_ostream &OS, - const ObjCCategoryImplDecl *CID); +raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID); /// ObjCImplementationDecl - Represents a class definition - this is where /// method definitions are specified. For example: @@ -1643,8 +1642,7 @@ public: friend class ASTDeclWriter; }; -raw_ostream &operator<<(raw_ostream &OS, - const ObjCImplementationDecl *ID); +raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID); /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is /// declared as @compatibility_alias alias class. diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 2b97cf5686..d0083855bb 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -1191,8 +1191,8 @@ FindPropertyImplDecl(IdentifierInfo *Id) const { } raw_ostream &clang::operator<<(raw_ostream &OS, - const ObjCCategoryImplDecl *CID) { - OS << CID->getName(); + const ObjCCategoryImplDecl &CID) { + OS << CID.getName(); return OS; } @@ -1235,8 +1235,8 @@ void ObjCImplementationDecl::setIvarInitializers(ASTContext &C, } raw_ostream &clang::operator<<(raw_ostream &OS, - const ObjCImplementationDecl *ID) { - OS << ID->getName(); + const ObjCImplementationDecl &ID) { + OS << ID.getName(); return OS; } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index f2ebd8cf48..398e27ea97 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -433,7 +433,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext())) - Out << '(' << CID << ')'; + Out << '(' << *CID << ')'; Out << ' '; Out << MD->getSelector().getAsString(); diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp index c1f762be9b..73c9f5778f 100644 --- a/lib/AST/Mangle.cpp +++ b/lib/AST/Mangle.cpp @@ -124,7 +124,7 @@ void MangleContext::mangleObjCMethodName(const ObjCMethodDecl *MD, assert (CD && "Missing container decl in GetNameForMethod"); OS << (MD->isInstanceMethod() ? '-' : '+') << '[' << CD->getName(); if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD)) - OS << '(' << CID << ')'; + OS << '(' << *CID << ')'; OS << ' ' << MD->getSelector().getAsString() << ']'; Out << OS.str().size() << OS.str(); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 5d55cb1d8e..d2701f71b7 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -4208,7 +4208,7 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D, << '[' << CD->getName(); if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(D->getDeclContext())) - OS << '(' << CID << ')'; + OS << '(' << *CID << ')'; OS << ' ' << D->getSelector().getAsString() << ']'; } diff --git a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp index c325bb1517..07383317c0 100644 --- a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp @@ -177,7 +177,7 @@ static void checkObjCDealloc(const ObjCImplementationDecl *D, std::string buf; llvm::raw_string_ostream os(buf); - os << "Objective-C class '" << D << "' lacks a 'dealloc' instance method"; + os << "Objective-C class '" << *D << "' lacks a 'dealloc' instance method"; BR.EmitBasicReport(name, os.str(), DLoc); return; @@ -192,7 +192,7 @@ static void checkObjCDealloc(const ObjCImplementationDecl *D, std::string buf; llvm::raw_string_ostream os(buf); - os << "The 'dealloc' instance method in Objective-C class '" << D + os << "The 'dealloc' instance method in Objective-C class '" << *D << "' does not send a 'dealloc' message to its super class" " (missing [super dealloc])"; |