diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-14 00:42:16 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-14 00:42:16 +0000 |
commit | d175ddfdbefff8646982dfd4afc5bdf6edbc9e67 (patch) | |
tree | 2d3d9d1c8556a46e2592824e92162ad7d5b39020 /Driver/RewriteTest.cpp | |
parent | 2b14d46231fd75ad1e58043e9fab029c54c817cb (diff) |
Rewrite of forward protocol declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r-- | Driver/RewriteTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index 9e17a6ef8c..cd1e994bbf 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -91,6 +91,7 @@ namespace { void RewriteObjcMethodDecl(ObjcMethodDecl *MDecl, std::string &ResultStr); void RewriteCategoryDecl(ObjcCategoryDecl *Dcl); void RewriteProtocolDecl(ObjcProtocolDecl *Dcl); + void RewriteForwardProtocolDecl(ObjcForwardProtocolDecl *Dcl); void RewriteMethodDeclarations(int nMethods, ObjcMethodDecl **Methods); void RewriteProperties(int nProperties, ObjcPropertyDecl **Properties); void RewriteFunctionDecl(FunctionDecl *FD); @@ -173,6 +174,9 @@ void RewriteTest::HandleTopLevelDecl(Decl *D) { RewriteCategoryDecl(CD); } else if (ObjcProtocolDecl *PD = dyn_cast<ObjcProtocolDecl>(D)) { RewriteProtocolDecl(PD); + } else if (ObjcForwardProtocolDecl *FP = + dyn_cast<ObjcForwardProtocolDecl>(D)){ + RewriteForwardProtocolDecl(FP); } // If we have a decl in the main file, see if we should rewrite it. if (SM->getDecomposedFileLoc(Loc).first == MainFileID) @@ -380,6 +384,12 @@ void RewriteTest::RewriteProtocolDecl(ObjcProtocolDecl *PDecl) { Rewrite.ReplaceText(PDecl->getAtEndLoc(), 0, "// ", 3); } +void RewriteTest::RewriteForwardProtocolDecl(ObjcForwardProtocolDecl *PDecl) { + SourceLocation LocStart = PDecl->getLocation(); + // FIXME: handle forward protocol that are declared across multiple lines. + Rewrite.ReplaceText(LocStart, 0, "// ", 3); +} + void RewriteTest::RewriteObjcMethodDecl(ObjcMethodDecl *OMD, std::string &ResultStr) { static bool includeObjc = false; |