summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-12 23:52:52 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-12 23:52:52 +0000
commit27db0b37540268ae48c56cb7409bf6bbf713f6b2 (patch)
tree2476bd011a1fbf44ba4a1ee768b8d6a7d4f10792
parent73273275a40f88f8e8579fc4c324da055fea897c (diff)
downloadbcm5719-llvm-27db0b37540268ae48c56cb7409bf6bbf713f6b2.tar.gz
bcm5719-llvm-27db0b37540268ae48c56cb7409bf6bbf713f6b2.zip
objective-c modern translator: beautify rewrite of
struct __rw_objc_super; no functionality change. llvm-svn: 154632
-rw-r--r--clang/lib/Rewrite/RewriteModernObjC.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp
index ba62ad3c414..57109dee9a0 100644
--- a/clang/lib/Rewrite/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/RewriteModernObjC.cpp
@@ -5615,8 +5615,13 @@ void RewriteModernObjC::Initialize(ASTContext &context) {
if (IsHeader)
Preamble = "#pragma once\n";
Preamble += "struct objc_selector; struct objc_class;\n";
- Preamble += "struct __rw_objc_super { struct objc_object *object; ";
- Preamble += "struct objc_object *superClass; ";
+ Preamble += "struct __rw_objc_super { \n\tstruct objc_object *object; ";
+ Preamble += "\n\tstruct objc_object *superClass; ";
+ // Add a constructor for creating temporary objects.
+ Preamble += "\n\t__rw_objc_super(struct objc_object *o, struct objc_object *s) ";
+ Preamble += ": object(o), superClass(s) {} ";
+ Preamble += "\n};\n";
+
if (LangOpts.MicrosoftExt) {
// Define all sections using syntax that makes sense.
// These are currently generated.
@@ -5640,12 +5645,7 @@ void RewriteModernObjC::Initialize(ASTContext &context) {
Preamble += "#pragma section(\".objc_classrefs$B\", long, read, write)\n";
Preamble += "#pragma section(\".objc_superrefs$B\", long, read, write)\n";
- // Add a constructor for creating temporary objects.
- Preamble += "__rw_objc_super(struct objc_object *o, struct objc_object *s) "
- ": ";
- Preamble += "object(o), superClass(s) {} ";
}
- Preamble += "};\n";
Preamble += "#ifndef _REWRITER_typedef_Protocol\n";
Preamble += "typedef struct objc_object Protocol;\n";
Preamble += "#define _REWRITER_typedef_Protocol\n";
OpenPOWER on IntegriCloud