aboutsummaryrefslogtreecommitdiff
path: root/Driver/ASTConsumers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Driver/ASTConsumers.cpp')
-rw-r--r--Driver/ASTConsumers.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index 9653526afb..eaee94e51d 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -53,6 +53,7 @@ namespace {
void PrintObjCCategoryDecl(ObjCCategoryDecl *PID);
void PrintObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *AID);
void PrintObjCPropertyDecl(ObjCPropertyDecl *PD);
+ void PrintObjCPropertyImplDecl(ObjCPropertyImplDecl *PID);
};
} // end anonymous namespace
@@ -228,6 +229,10 @@ void DeclPrinter::PrintObjCImplementationDecl(ObjCImplementationDecl *OID) {
}
}
+ for (ObjCImplementationDecl::propimpl_iterator I = OID->propimpl_begin(),
+ E = OID->propimpl_end(); I != E; ++I)
+ PrintObjCPropertyImplDecl(*I);
+
Out << "@end\n";
}
@@ -287,7 +292,10 @@ void DeclPrinter::PrintObjCCategoryImplDecl(ObjCCategoryImplDecl *PID) {
Out << "@implementation "
<< PID->getClassInterface()->getName()
<< '(' << PID->getName() << ");\n";
-
+ for (ObjCCategoryImplDecl::propimpl_iterator I = PID->propimpl_begin(),
+ E = PID->propimpl_end(); I != E; ++I)
+ PrintObjCPropertyImplDecl(*I);
+ Out << "@end\n";
// FIXME: implement the rest...
}
@@ -367,7 +375,21 @@ void DeclPrinter::PrintObjCPropertyDecl(ObjCPropertyDecl *PDecl) {
Out << ";\n";
}
-
+
+/// PrintObjCPropertyImplDecl - Print an objective-c property implementation
+/// declaration syntax.
+///
+void DeclPrinter::PrintObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) {
+ if (PID->getPropertyImplementation() ==
+ ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE)
+ Out << "\n@synthesize ";
+ else
+ Out << "\n@dynamic ";
+ Out << PID->getPropertyDecl()->getName();
+ if (PID->getPropertyIvarDecl())
+ Out << "=" << PID->getPropertyIvarDecl()->getName();
+ Out << ";\n";
+}
//===----------------------------------------------------------------------===//
/// ASTPrinter - Pretty-printer of ASTs