]> granicus.if.org Git - clang/commitdiff
Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with...
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 7 Feb 2012 11:57:45 +0000 (11:57 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 7 Feb 2012 11:57:45 +0000 (11:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149981 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp
lib/AST/Expr.cpp
lib/AST/Mangle.cpp
lib/CodeGen/CGObjCMac.cpp
lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp

index 59fcc2316fcae27022d154d96b18772528f08ae8..04fbf751e1e9d06aba3d66bf8d46d2e2b1872558 100644 (file)
@@ -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.
index 2b97cf568616a485b87a7a036503c42e262116a6..d0083855bb4ca16eacac71f542f4b412acd2338b 100644 (file)
@@ -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;
 }
 
index f2ebd8cf48bf6fc3d0e5251c9b0f4a957081ef02..398e27ea9717d5a8a5f51f3f208fbf6c4be763c5 100644 (file)
@@ -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();
index c1f762be9bafbbf35d379077f432b1d136e37542..73c9f5778f41e078ddede302661a1d2ac9d344f8 100644 (file)
@@ -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();
index 5d55cb1d8e9614f5ccc50cba94ed0efe37540db5..d2701f71b758d58c2a0289de2015731583044f5c 100644 (file)
@@ -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() << ']';
 }
 
index c325bb1517f333a3363dac4b37c02cfab54755d9..07383317c0e4704700590ab11efb6e7ab86589f9 100644 (file)
@@ -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])";