diff options
author | Steve Naroff <snaroff@apple.com> | 2007-10-30 03:43:13 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-10-30 03:43:13 +0000 |
commit | 2feac5e559ca5c9693a3a19905ab106b9c52e193 (patch) | |
tree | 01f9a83e4ef3a0a8921f4bd58bb0fdf0a5f6aa00 /Driver/RewriteTest.cpp | |
parent | f908a87299d278164540f90b5b6e6cab7b14fb41 (diff) |
Remove a couple FIXME's for rewriting ObjC interfaces (which are now being rewritten properly).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r-- | Driver/RewriteTest.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index 8063574750..be09eede31 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -19,6 +19,7 @@ #include "clang/Basic/IdentifierTable.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/SmallPtrSet.h" +#include "clang/Lex/Lexer.h" using namespace clang; using llvm::utostr; @@ -271,18 +272,12 @@ void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) { const char *startBuf = SM->getCharacterData(LocStart); const char *endBuf = SM->getCharacterData(LocEnd); - // FIXME: need to consider empty class decls (no vars, methods)... - // @interface NSConstantString : NSSimpleCString - // @end - - if (*endBuf != '>' && *endBuf != '}') - // we have an identifier - scan ahead until the end of token. - endBuf = strchr(endBuf, ' '); // FIXME: implement correctly. + endBuf += Lexer::MeasureTokenLength(LocEnd, *SM); std::string ResultStr; SynthesizeObjcInternalStruct(ClassDecl, ResultStr); - Rewrite.ReplaceText(LocStart, endBuf-startBuf+1, + Rewrite.ReplaceText(LocStart, endBuf-startBuf, ResultStr.c_str(), ResultStr.size()); int nInstanceMethods = ClassDecl->getNumInstanceMethods(); @@ -307,6 +302,8 @@ void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) { // FIXME: handle methods that are declared across multiple lines. } + // Lastly, comment out the @end. + Rewrite.ReplaceText(ClassDecl->getAtEndLoc(), 0, "// ", 3); } //===----------------------------------------------------------------------===// |