return true;
}
- bool hadARCErrors = capturedDiags.hasErrors();
-
// Don't filter diagnostics anymore.
Diags->setClient(DiagClient, /*ShouldOwnClient=*/false);
DiagClient->EndSourceFile();
errRec.FinishCapture();
- if (hadARCErrors) {
- // 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;
- // Disable auto-synthesize to avoid "@synthesize of 'weak' property is only
- // allowed in ARC" errors.
- origCI.getLangOpts()->ObjCDefaultSynthProperties = false;
- }
-
return capturedDiags.hasErrors() || testAct.hasReportedErrors();
}
origCI.getLangOpts()->ObjCAutoRefCount = true;
return migration.getRemapper().overwriteOriginal(*Diags);
} else {
- if (migration.HadARCErrors) {
- // 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;
- // Disable auto-synthesize to avoid "@synthesize of 'weak' property is only
- // allowed in ARC" errors.
- origCI.getLangOpts()->ObjCDefaultSynthProperties = false;
- }
return migration.getRemapper().flushToDisk(outputDir, *Diags);
}
}
Args.AddLastArg(CmdArgs, options::OPT_working_directory);
bool ARCMTEnabled = false;
- if (!Args.hasArg(options::OPT_fno_objc_arc)) {
+ if (!Args.hasArg(options::OPT_fno_objc_arc, options::OPT_fobjc_arc)) {
if (const Arg *A = Args.getLastArg(options::OPT_ccc_arcmt_check,
options::OPT_ccc_arcmt_modify,
options::OPT_ccc_arcmt_migrate)) {
void test1(id p) {
[p release];
}
+
+@interface Test2
+@property (strong) id prop;
+@end
+
+@implementation Test2
+-(id)init {
+ _prop = 0;
+}
+@end
void test1(id p) {
}
+
+@interface Test2
+@property (strong) id prop;
+@end
+
+@implementation Test2
+-(id)init {
+ _prop = 0;
+}
+@end
// RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c %S/Common.h -emit-pch -o %t.pch
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c -include-pch %t.pch
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -include-pch %t.pch
+// RUN: %clang_cc1 -x objective-c %S/Common.h -emit-pch -o %t.pch -fobjc-default-synthesize-properties
+// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c -include-pch %t.pch -fobjc-default-synthesize-properties
+// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -include-pch %t.pch -fobjc-default-synthesize-properties
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result
// RUN: rm -rf %t
// DISABLE: mingw32
// RUN: rm -rf %t
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c
+// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test1.m.in -x objective-c -fobjc-default-synthesize-properties
+// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t %S/Inputs/test2.m.in -x objective-c -fobjc-default-synthesize-properties
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %S/Inputs/test1.m.in.result %S/Inputs/test2.m.in.result %S/Inputs/test.h.result
// RUN: rm -rf %t
// DISABLE: mingw32
+++ /dev/null
-// RUN: %clang_cc1 -arcmt-check -fsyntax-only -fobjc-arc -x objective-c %s
-
-@protocol NSObject
-- (oneway void)release;
-@end
-
-void test1(id p) {
- [p release];
-}
+++ /dev/null
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t -fsyntax-only -fobjc-arc %s
-// RUN: c-arcmt-test -mt-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: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -x objective-c %s.result
-// RUN: %clang_cc1 -arcmt-migrate -mt-migrate-directory %t -fsyntax-only -fobjc-arc %s
-// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
-// RUN: rm -rf %t
-
-@protocol NSObject
-- (oneway void)release;
-@end
-
-void test1(id p) {
-}