diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index bcc4e3865a..fc990238cb 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -617,7 +617,8 @@ void DeclPrinter::VisitFieldDecl(FieldDecl *D) { if (!Policy.SuppressSpecifiers && D->isModulePrivate()) Out << "__module_private__ "; - Out << D->getType().stream(Policy, D->getName()); + Out << D->getType().getUnqualifiedObjCPointerType(). + stream(Policy, D->getName()); if (D->isBitField()) { Out << " : "; @@ -661,7 +662,7 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { Out << "__module_private__ "; } - QualType T = D->getType(); + QualType T = D->getType().getUnqualifiedObjCPointerType(); if (ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) T = Parm->getOriginalType(); T.print(Out, Policy, D->getName()); @@ -910,7 +911,8 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) { else Out << "+ "; if (!OMD->getResultType().isNull()) - Out << '(' << OMD->getResultType().getAsString(Policy) << ")"; + Out << '(' << OMD->getResultType().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ")"; std::string name = OMD->getSelector().getAsString(); std::string::size_type pos, lastPos = 0; @@ -919,7 +921,8 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) { // FIXME: selector is missing here! pos = name.find_first_of(':', lastPos); Out << " " << name.substr(lastPos, pos - lastPos); - Out << ":(" << (*PI)->getType().getAsString(Policy) << ')' << **PI; + Out << ":(" << (*PI)->getType().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ')' << **PI; lastPos = pos + 1; } @@ -952,7 +955,8 @@ void DeclPrinter::VisitObjCImplementationDecl(ObjCImplementationDecl *OID) { Indentation += Policy.Indentation; for (ObjCImplementationDecl::ivar_iterator I = OID->ivar_begin(), E = OID->ivar_end(); I != E; ++I) { - Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n"; + Indent() << I->getType().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ' ' << **I << ";\n"; } Indentation -= Policy.Indentation; Out << "}\n"; @@ -990,7 +994,8 @@ 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().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ' ' << **I << ";\n"; } Indentation -= Policy.Indentation; Out << "}\n"; @@ -1041,7 +1046,8 @@ void DeclPrinter::VisitObjCCategoryDecl(ObjCCategoryDecl *PID) { Indentation += Policy.Indentation; for (ObjCCategoryDecl::ivar_iterator I = PID->ivar_begin(), E = PID->ivar_end(); I != E; ++I) { - Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n"; + Indent() << I->getType().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ' ' << **I << ";\n"; } Indentation -= Policy.Indentation; Out << "}\n"; @@ -1127,7 +1133,8 @@ 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().getUnqualifiedObjCPointerType(). + getAsString(Policy) << ' ' << *PDecl; if (Policy.PolishForDeclaration) Out << ';'; } |