[cfe-commits] r43791 - /cfe/trunk/Driver/RewriteTest.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Nov 6 16:09:37 PST 2007
Author: fjahanian
Date: Tue Nov 6 18:09:37 2007
New Revision: 43791
URL: http://llvm.org/viewvc/llvm-project?rev=43791&view=rev
Log:
Rewrite for properties.
Modified:
cfe/trunk/Driver/RewriteTest.cpp
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=43791&r1=43790&r2=43791&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Tue Nov 6 18:09:37 2007
@@ -80,6 +80,7 @@
void RewriteCategoryDecl(ObjcCategoryDecl *Dcl);
void RewriteProtocolDecl(ObjcProtocolDecl *Dcl);
void RewriteMethods(int nMethods, ObjcMethodDecl **Methods);
+ void RewriteProperties(int nProperties, ObjcPropertyDecl **Properties);
void RewriteFunctionDecl(FunctionDecl *FD);
void RewriteObjcQualifiedInterfaceTypes(
const FunctionTypeProto *proto, FunctionDecl *FD);
@@ -311,6 +312,18 @@
}
}
+void RewriteTest::RewriteProperties(int nProperties, ObjcPropertyDecl **Properties)
+{
+ for (int i = 0; i < nProperties; i++) {
+ ObjcPropertyDecl *Property = Properties[i];
+ SourceLocation Loc = Property->getLocation();
+
+ Rewrite.ReplaceText(Loc, 0, "// ", 3);
+
+ // FIXME: handle properties that are declared across multiple lines.
+ }
+}
+
void RewriteTest::RewriteCategoryDecl(ObjcCategoryDecl *CatDecl) {
SourceLocation LocStart = CatDecl->getLocStart();
@@ -363,7 +376,8 @@
Rewrite.ReplaceText(LocStart, endBuf-startBuf,
ResultStr.c_str(), ResultStr.size());
-
+ RewriteProperties(ClassDecl->getNumPropertyDecl(),
+ ClassDecl->getPropertyDecl());
RewriteMethods(ClassDecl->getNumInstanceMethods(),
ClassDecl->getInstanceMethods());
RewriteMethods(ClassDecl->getNumClassMethods(),
More information about the cfe-commits
mailing list