summaryrefslogtreecommitdiffstats
path: root/clang/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-12-07 22:15:58 +0000
committerSteve Naroff <snaroff@apple.com>2007-12-07 22:15:58 +0000
commit1f6ed92dbb95aff606b34ace6cb99aebc430b592 (patch)
tree6079b710fe8ed78c9f459d9fd91e3be8c4045773 /clang/Driver/RewriteTest.cpp
parentfb706bc52bd61c4c426ff3d7a9cb2b16560b5c5a (diff)
downloadbcm5719-llvm-1f6ed92dbb95aff606b34ace6cb99aebc430b592.tar.gz
bcm5719-llvm-1f6ed92dbb95aff606b34ace6cb99aebc430b592.zip
Omit the field name when including the super class structure template.
This allows us to access a superclasses ivars without deriving the absolute path. The comments below say a bit more... llvm-svn: 44688
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r--clang/Driver/RewriteTest.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp
index 2a189ad85b3..3ec5a10b2c4 100644
--- a/clang/Driver/RewriteTest.cpp
+++ b/clang/Driver/RewriteTest.cpp
@@ -1648,8 +1648,11 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
if (RCDecl && ObjcSynthesizedStructs.count(RCDecl)) {
Result = "\n struct ";
Result += RCDecl->getName();
- Result += " _";
- Result += RCDecl->getName();
+ // Note: We don't name the field decl. This simplifies the "codegen" for
+ // accessing a superclasses instance variables (and is similar to what gcc
+ // does internally). The unnamed struct field feature is enabled with
+ // -fms-extensions. If the struct definition were "inlined", we wouldn't
+ // need to use this switch. That said, I don't want to inline the def.
Result += ";\n";
// insert the super class structure definition.
@@ -1692,8 +1695,11 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
endBuf += Lexer::MeasureTokenLength(LocEnd, *SM);
Result += " {\n struct ";
Result += RCDecl->getName();
- Result += " _";
- Result += RCDecl->getName();
+ // Note: We don't name the field decl. This simplifies the "codegen" for
+ // accessing a superclasses instance variables (and is similar to what gcc
+ // does internally). The unnamed struct field feature is enabled with
+ // -fms-extensions. If the struct definition were "inlined", we wouldn't
+ // need to use this switch. That said, I don't want to inline the def.
Result += ";\n};\n";
Rewrite.ReplaceText(LocStart, endBuf-startBuf,
Result.c_str(), Result.size());
OpenPOWER on IntegriCloud