From b8989f27f116ff2400e92a52c067a69846119eb5 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 14 Oct 2011 18:45:37 +0000 Subject: [PATCH] Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Decl.h | 5 +- lib/AST/Decl.cpp | 10 ++-- lib/AST/DeclPrinter.cpp | 56 +++++++++---------- lib/AST/DeclarationName.cpp | 6 +- lib/AST/Expr.cpp | 2 +- lib/AST/RecordLayoutBuilder.cpp | 8 +-- lib/AST/StmtDumper.cpp | 12 ++-- lib/AST/StmtPrinter.cpp | 6 +- lib/AST/TemplateName.cpp | 4 +- lib/Frontend/ASTConsumers.cpp | 48 ++++++++-------- lib/Index/ASTLocation.cpp | 4 +- lib/Sema/CodeCompleteConsumer.cpp | 2 +- lib/Sema/SemaInit.cpp | 4 +- lib/Sema/SemaOverload.cpp | 2 +- .../Checkers/AnalyzerStatsChecker.cpp | 2 +- .../Checkers/CStringChecker.cpp | 2 +- .../Checkers/CallAndMessageChecker.cpp | 4 +- .../Checkers/CheckObjCDealloc.cpp | 6 +- .../Checkers/CheckObjCInstMethSignature.cpp | 6 +- .../Checkers/CheckSecuritySyntaxOnly.cpp | 10 ++-- .../Checkers/DeadStoresChecker.cpp | 4 +- lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 2 +- .../Checkers/ObjCUnusedIVarsChecker.cpp | 2 +- .../Checkers/RetainCountChecker.cpp | 6 +- .../Checkers/StackAddrEscapeChecker.cpp | 2 +- lib/StaticAnalyzer/Core/BugReporter.cpp | 4 +- .../Core/BugReporterVisitors.cpp | 4 +- lib/StaticAnalyzer/Core/MemRegion.cpp | 6 +- .../Frontend/AnalysisConsumer.cpp | 2 +- tools/libclang/CIndexUSRs.cpp | 2 +- 30 files changed, 115 insertions(+), 118 deletions(-) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 09eb560f21..a02a2ce336 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -306,9 +306,8 @@ public: static bool classofKind(Kind K) { return K >= firstNamed && K <= lastNamed; } }; -inline raw_ostream &operator<<(raw_ostream &OS, - const NamedDecl *ND) { - ND->getDeclName().printName(OS); +inline raw_ostream &operator<<(raw_ostream &OS, const NamedDecl &ND) { + ND.printName(OS); return OS; } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 3e5c253737..95d52cb0fa 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -847,18 +847,18 @@ std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const { if (ND->isAnonymousNamespace()) OS << ""; else - OS << ND; + OS << *ND; } else if (const RecordDecl *RD = dyn_cast(*I)) { if (!RD->getIdentifier()) OS << "getKindName() << '>'; else - OS << RD; + OS << *RD; } else if (const FunctionDecl *FD = dyn_cast(*I)) { const FunctionProtoType *FT = 0; if (FD->hasWrittenPrototype()) FT = dyn_cast(FD->getType()->getAs()); - OS << FD << '('; + OS << *FD << '('; if (FT) { unsigned NumParams = FD->getNumParams(); for (unsigned i = 0; i < NumParams; ++i) { @@ -877,13 +877,13 @@ std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const { } OS << ')'; } else { - OS << cast(*I); + OS << *cast(*I); } OS << "::"; } if (getDeclName()) - OS << this; + OS << *this; else OS << ""; diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 4f3e8ad2d5..08a1ab5723 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -337,7 +337,7 @@ void DeclPrinter::VisitEnumDecl(EnumDecl *D) { else Out << "struct "; } - Out << D; + Out << *D; if (D->isFixed()) { std::string Underlying; @@ -357,7 +357,7 @@ void DeclPrinter::VisitRecordDecl(RecordDecl *D) { Out << "__module_private__ "; Out << D->getKindName(); if (D->getIdentifier()) - Out << ' ' << D; + Out << ' ' << *D; if (D->isCompleteDefinition()) { Out << " {\n"; @@ -367,7 +367,7 @@ void DeclPrinter::VisitRecordDecl(RecordDecl *D) { } void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) { - Out << D; + Out << *D; if (Expr *Init = D->getInitExpr()) { Out << " = "; Init->printPretty(Out, Context, 0, Policy, Indentation); @@ -491,10 +491,9 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { if (BMInitializer->isAnyMemberInitializer()) { FieldDecl *FD = BMInitializer->getAnyMember(); - Out << FD; + Out << *FD; } else { - Out << QualType(BMInitializer->getBaseClass(), - 0).getAsString(Policy); + Out << QualType(BMInitializer->getBaseClass(), 0).getAsString(Policy); } Out << "("; @@ -648,7 +647,7 @@ void DeclPrinter::VisitStaticAssertDecl(StaticAssertDecl *D) { // C++ declarations //---------------------------------------------------------------------------- void DeclPrinter::VisitNamespaceDecl(NamespaceDecl *D) { - Out << "namespace " << D << " {\n"; + Out << "namespace " << *D << " {\n"; VisitDeclContext(D); Indent() << "}"; } @@ -657,14 +656,14 @@ void DeclPrinter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { Out << "using namespace "; if (D->getQualifier()) D->getQualifier()->print(Out, Policy); - Out << D->getNominatedNamespaceAsWritten(); + Out << *D->getNominatedNamespaceAsWritten(); } void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { - Out << "namespace " << D << " = "; + Out << "namespace " << *D << " = "; if (D->getQualifier()) D->getQualifier()->print(Out, Policy); - Out << D->getAliasedNamespace(); + Out << *D->getAliasedNamespace(); } void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { @@ -672,7 +671,7 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { Out << "__module_private__ "; Out << D->getKindName(); if (D->getIdentifier()) - Out << ' ' << D; + Out << ' ' << *D; if (D->isCompleteDefinition()) { // Print the base classes @@ -831,8 +830,7 @@ void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { //---------------------------------------------------------------------------- void DeclPrinter::VisitObjCClassDecl(ObjCClassDecl *D) { - Out << "@class "; - Out << D->getForwardInterfaceDecl(); + Out << "@class " << *D->getForwardInterfaceDecl(); } void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) { @@ -848,9 +846,9 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) { for (ObjCMethodDecl::param_iterator PI = OMD->param_begin(), E = OMD->param_end(); PI != E; ++PI) { // FIXME: selector is missing here! - pos = name.find_first_of(":", lastPos); + pos = name.find_first_of(':', lastPos); Out << " " << name.substr(lastPos, pos - lastPos); - Out << ":(" << (*PI)->getType().getAsString(Policy) << ')' << *PI; + Out << ":(" << (*PI)->getType().getAsString(Policy) << ')' << **PI; lastPos = pos + 1; } @@ -872,7 +870,7 @@ void DeclPrinter::VisitObjCImplementationDecl(ObjCImplementationDecl *OID) { ObjCInterfaceDecl *SID = OID->getSuperClass(); if (SID) - Out << "@implementation " << I << " : " << SID; + Out << "@implementation " << I << " : " << *SID; else Out << "@implementation " << I; Out << "\n"; @@ -885,7 +883,7 @@ void DeclPrinter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *OID) { ObjCInterfaceDecl *SID = OID->getSuperClass(); if (SID) - Out << "@interface " << I << " : " << SID; + Out << "@interface " << I << " : " << *SID; else Out << "@interface " << I; @@ -894,7 +892,7 @@ void DeclPrinter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *OID) { if (!Protocols.empty()) { for (ObjCList::iterator I = Protocols.begin(), E = Protocols.end(); I != E; ++I) - Out << (I == Protocols.begin() ? '<' : ',') << *I; + Out << (I == Protocols.begin() ? '<' : ',') << **I; } if (!Protocols.empty()) @@ -905,7 +903,7 @@ void DeclPrinter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *OID) { Indentation += Policy.Indentation; for (ObjCInterfaceDecl::ivar_iterator I = OID->ivar_begin(), E = OID->ivar_end(); I != E; ++I) { - Indent() << (*I)->getType().getAsString(Policy) << ' ' << *I << ";\n"; + Indent() << (*I)->getType().getAsString(Policy) << ' ' << **I << ";\n"; } Indentation -= Policy.Indentation; Out << "}\n"; @@ -922,18 +920,18 @@ void DeclPrinter::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) { E = D->protocol_end(); I != E; ++I) { if (I != D->protocol_begin()) Out << ", "; - Out << *I; + Out << **I; } } void DeclPrinter::VisitObjCProtocolDecl(ObjCProtocolDecl *PID) { - Out << "@protocol " << PID << '\n'; + Out << "@protocol " << *PID << '\n'; VisitDeclContext(PID, false); Out << "@end"; } void DeclPrinter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *PID) { - Out << "@implementation " << PID->getClassInterface() << '(' << PID << ")\n"; + Out << "@implementation " << *PID->getClassInterface() << '(' << *PID <<")\n"; VisitDeclContext(PID, false); Out << "@end"; @@ -941,7 +939,7 @@ void DeclPrinter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *PID) { } void DeclPrinter::VisitObjCCategoryDecl(ObjCCategoryDecl *PID) { - Out << "@interface " << PID->getClassInterface() << '(' << PID << ")\n"; + Out << "@interface " << *PID->getClassInterface() << '(' << *PID << ")\n"; VisitDeclContext(PID, false); Out << "@end"; @@ -949,8 +947,8 @@ void DeclPrinter::VisitObjCCategoryDecl(ObjCCategoryDecl *PID) { } void DeclPrinter::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *AID) { - Out << "@compatibility_alias " << AID - << ' ' << AID->getClassInterface() << ";\n"; + Out << "@compatibility_alias " << *AID + << ' ' << *AID->getClassInterface() << ";\n"; } /// PrintObjCPropertyDecl - print a property declaration. @@ -1022,7 +1020,7 @@ void DeclPrinter::VisitObjCPropertyDecl(ObjCPropertyDecl *PDecl) { (void) first; // Silence dead store warning due to idiomatic code. Out << " )"; } - Out << ' ' << PDecl->getType().getAsString(Policy) << ' ' << PDecl; + Out << ' ' << PDecl->getType().getAsString(Policy) << ' ' << *PDecl; } void DeclPrinter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) { @@ -1030,15 +1028,15 @@ void DeclPrinter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) { Out << "@synthesize "; else Out << "@dynamic "; - Out << PID->getPropertyDecl(); + Out << *PID->getPropertyDecl(); if (PID->getPropertyIvarDecl()) - Out << '=' << PID->getPropertyIvarDecl(); + Out << '=' << *PID->getPropertyIvarDecl(); } void DeclPrinter::VisitUsingDecl(UsingDecl *D) { Out << "using "; D->getQualifier()->print(Out, Policy); - Out << D; + Out << *D; } void diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index 8dfca3e1e7..bf647ed7ac 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -224,7 +224,7 @@ void DeclarationName::printName(raw_ostream &OS) const { case CXXConstructorName: { QualType ClassType = getCXXNameType(); if (const RecordType *ClassRec = ClassType->getAs()) - OS << ClassRec->getDecl(); + OS << *ClassRec->getDecl(); else OS << ClassType.getAsString(); return; @@ -234,7 +234,7 @@ void DeclarationName::printName(raw_ostream &OS) const { OS << '~'; QualType Type = getCXXNameType(); if (const RecordType *Rec = Type->getAs()) - OS << Rec->getDecl(); + OS << *Rec->getDecl(); else OS << Type.getAsString(); return; @@ -265,7 +265,7 @@ void DeclarationName::printName(raw_ostream &OS) const { OS << "operator "; QualType Type = getCXXNameType(); if (const RecordType *Rec = Type->getAs()) - OS << Rec->getDecl(); + OS << *Rec->getDecl(); else OS << Type.getAsString(); return; diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 465b490d47..49a255a369 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -413,7 +413,7 @@ 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; + Out << *ID; if (const ObjCCategoryImplDecl *CID = dyn_cast(MD->getDeclContext())) diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index a3ccbd0850..bbd3fc0160 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -2185,12 +2185,12 @@ static void DumpCXXRecordLayout(raw_ostream &OS, // Vtable pointer. if (RD->isDynamicClass() && !PrimaryBase) { PrintOffset(OS, Offset, IndentLevel); - OS << '(' << RD << " vtable pointer)\n"; + OS << '(' << *RD << " vtable pointer)\n"; } if (HasVbptr && !PrimaryBase) { PrintOffset(OS, Offset + Layout.getVBPtrOffset(), IndentLevel); - OS << '(' << RD << " vbtable pointer)\n"; + OS << '(' << *RD << " vbtable pointer)\n"; // one vbtable per class HasVbptr = false; @@ -2216,7 +2216,7 @@ static void DumpCXXRecordLayout(raw_ostream &OS, // vbptr if (HasVbptr) { PrintOffset(OS, Offset + Layout.getVBPtrOffset(), IndentLevel); - OS << '(' << RD << " vbtable pointer)\n"; + OS << '(' << *RD << " vbtable pointer)\n"; } // Dump fields. @@ -2237,7 +2237,7 @@ static void DumpCXXRecordLayout(raw_ostream &OS, } PrintOffset(OS, FieldOffset, IndentLevel); - OS << Field->getType().getAsString() << ' ' << Field << '\n'; + OS << Field->getType().getAsString() << ' ' << *Field << '\n'; } if (!IncludeVirtualBases) diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp index 9357d9be67..2968739c22 100644 --- a/lib/AST/StmtDumper.cpp +++ b/lib/AST/StmtDumper.cpp @@ -235,9 +235,9 @@ void StmtDumper::DumpDeclarator(Decl *D) { // nodes are where they need to be. if (TypedefDecl *localType = dyn_cast(D)) { OS << "\"typedef " << localType->getUnderlyingType().getAsString() - << ' ' << localType << '"'; + << ' ' << *localType << '"'; } else if (TypeAliasDecl *localType = dyn_cast(D)) { - OS << "\"using " << localType << " = " + OS << "\"using " << *localType << " = " << localType->getUnderlyingType().getAsString() << '"'; } else if (ValueDecl *VD = dyn_cast(D)) { OS << "\""; @@ -407,7 +407,7 @@ void StmtDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { DumpExpr(Node); OS << " " << Node->getDecl()->getDeclKindName() - << "Decl='" << Node->getDecl() + << "Decl='" << *Node->getDecl() << "' " << (void*)Node->getDecl(); if (Node->isFreeIvar()) OS << " isFreeIvar"; @@ -480,7 +480,7 @@ void StmtDumper::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *Node) { void StmtDumper::VisitMemberExpr(MemberExpr *Node) { DumpExpr(Node); OS << " " << (Node->isArrow() ? "->" : ".") - << Node->getMemberDecl() << ' ' + << *Node->getMemberDecl() << ' ' << (void*)Node->getMemberDecl(); } void StmtDumper::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) { @@ -643,7 +643,7 @@ void StmtDumper::VisitObjCSelectorExpr(ObjCSelectorExpr *Node) { void StmtDumper::VisitObjCProtocolExpr(ObjCProtocolExpr *Node) { DumpExpr(Node); - OS << ' ' << Node->getProtocol(); + OS << ' ' <<* Node->getProtocol(); } void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { @@ -662,7 +662,7 @@ void StmtDumper::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { OS << "(null)"; OS << "\""; } else { - OS << " Kind=PropertyRef Property=\"" << Node->getExplicitProperty() << '"'; + OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty() <<'"'; } if (Node->isSuperReceiver()) diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 8a7c21bb41..daaa354ac3 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -564,7 +564,7 @@ void StmtPrinter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { PrintExpr(Node->getBase()); OS << (Node->isArrow() ? "->" : "."); } - OS << Node->getDecl(); + OS << *Node->getDecl(); } void StmtPrinter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) { @@ -1504,7 +1504,7 @@ void StmtPrinter::VisitObjCSelectorExpr(ObjCSelectorExpr *Node) { } void StmtPrinter::VisitObjCProtocolExpr(ObjCProtocolExpr *Node) { - OS << "@protocol(" << Node->getProtocol() << ')'; + OS << "@protocol(" << *Node->getProtocol() << ')'; } void StmtPrinter::VisitObjCMessageExpr(ObjCMessageExpr *Mess) { @@ -1586,7 +1586,7 @@ void StmtPrinter::VisitBlockExpr(BlockExpr *Node) { } void StmtPrinter::VisitBlockDeclRefExpr(BlockDeclRefExpr *Node) { - OS << Node->getDecl(); + OS << *Node->getDecl(); } void StmtPrinter::VisitOpaqueValueExpr(OpaqueValueExpr *Node) {} diff --git a/lib/AST/TemplateName.cpp b/lib/AST/TemplateName.cpp index 7cfd1cdbe0..a0487ba059 100644 --- a/lib/AST/TemplateName.cpp +++ b/lib/AST/TemplateName.cpp @@ -128,13 +128,13 @@ void TemplateName::print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS) const { if (TemplateDecl *Template = Storage.dyn_cast()) - OS << Template; + OS << *Template; else if (QualifiedTemplateName *QTN = getAsQualifiedTemplateName()) { if (!SuppressNNS) QTN->getQualifier()->print(OS, Policy); if (QTN->hasTemplateKeyword()) OS << "template "; - OS << QTN->getDecl(); + OS << *QTN->getDecl(); } else if (DependentTemplateName *DTN = getAsDependentTemplateName()) { if (!SuppressNNS && DTN->getQualifier()) DTN->getQualifier()->print(OS, Policy); diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 6f94aaa22c..54bb282728 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -118,7 +118,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, case Decl::Namespace: { Out << "[namespace] "; const NamespaceDecl* ND = cast(DC); - Out << ND; + Out << *ND; break; } case Decl::Enum: { @@ -127,7 +127,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "[enum] "; else Out << " "; - Out << ED; + Out << *ED; break; } case Decl::Record: { @@ -136,7 +136,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "[struct] "; else Out << " "; - Out << RD; + Out << *RD; break; } case Decl::CXXRecord: { @@ -145,7 +145,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "[class] "; else Out << " "; - Out << RD << ' ' << DC; + Out << *RD << ' ' << DC; break; } case Decl::ObjCMethod: @@ -178,7 +178,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "[function] "; else Out << " "; - Out << FD; + Out << *FD; // Print the parameters. Out << "("; bool PrintComma = false; @@ -188,7 +188,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << ", "; else PrintComma = true; - Out << *I; + Out << **I; } Out << ")"; break; @@ -201,7 +201,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "(c++ method) "; else Out << " "; - Out << D; + Out << *D; // Print the parameters. Out << "("; bool PrintComma = false; @@ -211,7 +211,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << ", "; else PrintComma = true; - Out << *I; + Out << **I; } Out << ")"; @@ -231,7 +231,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "(c++ ctor) "; else Out << " "; - Out << D; + Out << *D; // Print the parameters. Out << "("; bool PrintComma = false; @@ -241,7 +241,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << ", "; else PrintComma = true; - Out << *I; + Out << **I; } Out << ")"; @@ -260,7 +260,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "(c++ dtor) "; else Out << " "; - Out << D; + Out << *D; // Check the semantic DC. const DeclContext* SemaDC = D->getDeclContext(); const DeclContext* LexicalDC = D->getLexicalDeclContext(); @@ -276,7 +276,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "(c++ conversion) "; else Out << " "; - Out << D; + Out << *D; // Check the semantic DC. const DeclContext* SemaDC = D->getDeclContext(); const DeclContext* LexicalDC = D->getLexicalDeclContext(); @@ -323,53 +323,53 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, } case Decl::IndirectField: { IndirectFieldDecl* IFD = cast(*I); - Out << " " << IFD << '\n'; + Out << " " << *IFD << '\n'; break; } case Decl::Label: { LabelDecl *LD = cast(*I); - Out << "