]> granicus.if.org Git - clang/commitdiff
ObjectiveC driver change. re-apply patch reverted in
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 12 Nov 2013 17:08:46 +0000 (17:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 12 Nov 2013 17:08:46 +0000 (17:08 +0000)
r194450 with a modified test. // rdar://15363492

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194489 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/rewrite-legacy-objc.m

index 03459f0ba7aa9ec29d2fa019ed98a09f3812faa5..84f756f83e8538157ce5fe2c4b861de031d1852c 100644 (file)
@@ -3297,6 +3297,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     }
   }
 
+  // When ObjectiveC legacy runtime is in effect on MacOSX,
+  // turn on the option to do Array/Dictionary subscripting
+  // by default.
+  if (objcRuntime.getKind() == ObjCRuntime::FragileMacOSX &&
+      objcRuntime.isNeXTFamily())
+    CmdArgs.push_back("-fobjc-subscripting-legacy-runtime");
+  
   // -fencode-extended-block-signature=1 is default.
   if (getToolChain().IsEncodeExtendedBlockSignatureDefault()) {
     CmdArgs.push_back("-fencode-extended-block-signature");
index 927089cd6bff8d1b14ac323c22699d2b9b836a3e..bcfae1f244d3626b429119f4a6e94bccd969a249 100644 (file)
@@ -3,5 +3,8 @@
 // TEST0: clang{{.*}}" "-cc1"
 // TEST0: "-rewrite-objc"
 // FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
-// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fdiagnostics-show-option"
 // TEST0: rewrite-legacy-objc.m"
+// RUN: %clang -no-canonical-prefixes -target i386-apple-macosx10.9.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
+// RUN:   FileCheck -check-prefix=TEST1 %s
+// TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-mstackrealign" "-fblocks" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fencode-extended-block-signature" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fdiagnostics-show-option"