Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with NamedDecls.

llvm-svn: 149981
This commit is contained in:
Benjamin Kramer 2012-02-07 11:57:45 +00:00
parent 59580dbf52
commit 2f56992964
6 changed files with 11 additions and 13 deletions

View File

@ -1498,8 +1498,7 @@ public:
friend class ASTDeclWriter; friend class ASTDeclWriter;
}; };
raw_ostream &operator<<(raw_ostream &OS, raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);
const ObjCCategoryImplDecl *CID);
/// ObjCImplementationDecl - Represents a class definition - this is where /// ObjCImplementationDecl - Represents a class definition - this is where
/// method definitions are specified. For example: /// method definitions are specified. For example:
@ -1643,8 +1642,7 @@ public:
friend class ASTDeclWriter; friend class ASTDeclWriter;
}; };
raw_ostream &operator<<(raw_ostream &OS, raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);
const ObjCImplementationDecl *ID);
/// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
/// declared as @compatibility_alias alias class. /// declared as @compatibility_alias alias class.

View File

@ -1191,8 +1191,8 @@ FindPropertyImplDecl(IdentifierInfo *Id) const {
} }
raw_ostream &clang::operator<<(raw_ostream &OS, raw_ostream &clang::operator<<(raw_ostream &OS,
const ObjCCategoryImplDecl *CID) { const ObjCCategoryImplDecl &CID) {
OS << CID->getName(); OS << CID.getName();
return OS; return OS;
} }
@ -1235,8 +1235,8 @@ void ObjCImplementationDecl::setIvarInitializers(ASTContext &C,
} }
raw_ostream &clang::operator<<(raw_ostream &OS, raw_ostream &clang::operator<<(raw_ostream &OS,
const ObjCImplementationDecl *ID) { const ObjCImplementationDecl &ID) {
OS << ID->getName(); OS << ID.getName();
return OS; return OS;
} }

View File

@ -433,7 +433,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) {
if (const ObjCCategoryImplDecl *CID = if (const ObjCCategoryImplDecl *CID =
dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext())) dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext()))
Out << '(' << CID << ')'; Out << '(' << *CID << ')';
Out << ' '; Out << ' ';
Out << MD->getSelector().getAsString(); Out << MD->getSelector().getAsString();

View File

@ -124,7 +124,7 @@ void MangleContext::mangleObjCMethodName(const ObjCMethodDecl *MD,
assert (CD && "Missing container decl in GetNameForMethod"); assert (CD && "Missing container decl in GetNameForMethod");
OS << (MD->isInstanceMethod() ? '-' : '+') << '[' << CD->getName(); OS << (MD->isInstanceMethod() ? '-' : '+') << '[' << CD->getName();
if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD)) if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(CD))
OS << '(' << CID << ')'; OS << '(' << *CID << ')';
OS << ' ' << MD->getSelector().getAsString() << ']'; OS << ' ' << MD->getSelector().getAsString() << ']';
Out << OS.str().size() << OS.str(); Out << OS.str().size() << OS.str();

View File

@ -4208,7 +4208,7 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D,
<< '[' << CD->getName(); << '[' << CD->getName();
if (const ObjCCategoryImplDecl *CID = if (const ObjCCategoryImplDecl *CID =
dyn_cast<ObjCCategoryImplDecl>(D->getDeclContext())) dyn_cast<ObjCCategoryImplDecl>(D->getDeclContext()))
OS << '(' << CID << ')'; OS << '(' << *CID << ')';
OS << ' ' << D->getSelector().getAsString() << ']'; OS << ' ' << D->getSelector().getAsString() << ']';
} }

View File

@ -177,7 +177,7 @@ static void checkObjCDealloc(const ObjCImplementationDecl *D,
std::string buf; std::string buf;
llvm::raw_string_ostream os(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); BR.EmitBasicReport(name, os.str(), DLoc);
return; return;
@ -192,7 +192,7 @@ static void checkObjCDealloc(const ObjCImplementationDecl *D,
std::string buf; std::string buf;
llvm::raw_string_ostream os(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" << "' does not send a 'dealloc' message to its super class"
" (missing [super dealloc])"; " (missing [super dealloc])";