DiagClient->EndSourceFile();
+ // If we are migrating code that gets the '-fobjc-arc' flag, make sure
+ // to remove it so that we don't get errors from normal compilation.
+ origCI.getLangOpts().ObjCAutoRefCount = false;
+
return capturedDiags.hasErrors();
}
if (outputDir.empty()) {
origCI.getLangOpts().ObjCAutoRefCount = true;
return migration.getRemapper().overwriteOriginal(*Diags);
- } else
+ } else {
+ // If we are migrating code that gets the '-fobjc-arc' flag, make sure
+ // to remove it so that we don't get errors from normal compilation.
+ origCI.getLangOpts().ObjCAutoRefCount = false;
return migration.getRemapper().flushToDisk(outputDir, *Diags);
+ }
}
bool arcmt::applyTransformations(CompilerInvocation &origCI,
--- /dev/null
+// RUN: %clang_cc1 -arcmt-check -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s
+
+@protocol NSObject
+- (oneway void)release;
+@end
+
+void test1(id p) {
+ [p release];
+}
--- /dev/null
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc %s
+// RUN: c-arcmt-test -arcmt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: rm -rf %t
+
+@protocol NSObject
+- (oneway void)release;
+@end
+
+void test1(id p) {
+ [p release];
+}
--- /dev/null
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: %clang_cc1 -arcmt-migrate -arcmt-migrate-directory %t -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc %s
+// RUN: c-arcmt-test -arcmt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: rm -rf %t
+
+@protocol NSObject
+- (oneway void)release;
+@end
+
+void test1(id p) {
+}
--- /dev/null
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: cp %s %t
+// RUN: %clang_cc1 -arcmt-modify -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %t
+// RUN: diff %t %s.result
+// RUN: rm %t
+
+@protocol NSObject
+- (oneway void)release;
+@end
+
+void test1(id p) {
+ [p release];
+}
--- /dev/null
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: cp %s %t
+// RUN: %clang_cc1 -arcmt-modify -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %t
+// RUN: diff %t %s.result
+// RUN: rm %t
+
+@protocol NSObject
+- (oneway void)release;
+@end
+
+void test1(id p) {
+}