diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-26 20:59:57 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-26 20:59:57 +0000 |
commit | ebe668fac7553b9932e1936a997e96dc08c9cae4 (patch) | |
tree | 5f033943078f53dfeeccc28bcfb60482e874edb8 /Driver/RewriteTest.cpp | |
parent | 7905dd147a4cdd874f0ab6f0dbbb82ceb2a569a0 (diff) |
Fixed a rewrite bug in class synthesis (which I first thought was a rewrite API bug).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r-- | Driver/RewriteTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index cc6d56959e..043b260b16 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -1318,8 +1318,6 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl, // If no ivars and no root or if its root, directly or indirectly, // have no ivars (thus not synthesized) then no need to synthesize this class. if (NumIvars <= 0 && (!RCDecl || !ObjcSynthesizedStructs.count(RCDecl))) { - //FIXME: This does not replace @interface class-name with the - //Result text. Could be a bug in ReplaceText API. endBuf += Lexer::MeasureTokenLength(LocEnd, *SM); Rewrite.ReplaceText(LocStart, endBuf-startBuf, Result.c_str(), Result.size()); @@ -1756,8 +1754,12 @@ void RewriteTest::RewriteObjcClassMetaData(ObjcImplementationDecl *IDecl, int NumIvars = IDecl->getImplDeclNumIvars() > 0 ? IDecl->getImplDeclNumIvars() : (CDecl ? CDecl->getNumInstanceVariables() : 0); - - SynthesizeObjcInternalStruct(CDecl, Result); + // Explictly declared @interface's are already synthesized. + if (CDecl->ImplicitInterfaceDecl()) { + // FIXME: Implementation of a class with no @interface (legacy) doese not + // produce correct synthesis as yet. + SynthesizeObjcInternalStruct(CDecl, Result); + } if (NumIvars > 0) { static bool objc_ivar = false; |