r190880 - [arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Sep 17 12:14:30 PDT 2013
Author: akirtzidis
Date: Tue Sep 17 14:14:29 2013
New Revision: 190880
URL: http://llvm.org/viewvc/llvm-project?rev=190880&view=rev
Log:
[arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
rdar://14461559
Removed:
cfe/trunk/test/ARCMT/with-arc-mode-check.m
cfe/trunk/test/ARCMT/with-arc-mode-migrate.m
cfe/trunk/test/ARCMT/with-arc-mode-migrate.m.result
Modified:
cfe/trunk/lib/ARCMigrate/ARCMT.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/ARCMT/Inputs/test1.m.in
cfe/trunk/test/ARCMT/Inputs/test1.m.in.result
cfe/trunk/test/ARCMT/migrate-with-pch.m
cfe/trunk/test/ARCMT/migrate.m
Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Tue Sep 17 14:14:29 2013
@@ -270,8 +270,6 @@ bool arcmt::checkForManualIssues(Compile
return true;
}
- bool hadARCErrors = capturedDiags.hasErrors();
-
// Don't filter diagnostics anymore.
Diags->setClient(DiagClient, /*ShouldOwnClient=*/false);
@@ -323,15 +321,6 @@ bool arcmt::checkForManualIssues(Compile
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();
}
@@ -381,14 +370,6 @@ static bool applyTransforms(CompilerInvo
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);
}
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Sep 17 14:14:29 2013
@@ -2563,7 +2563,7 @@ void Clang::ConstructJob(Compilation &C,
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)) {
Modified: cfe/trunk/test/ARCMT/Inputs/test1.m.in
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/Inputs/test1.m.in?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/Inputs/test1.m.in (original)
+++ cfe/trunk/test/ARCMT/Inputs/test1.m.in Tue Sep 17 14:14:29 2013
@@ -4,3 +4,13 @@
void test1(id p) {
[p release];
}
+
+ at interface Test2
+ at property (strong) id prop;
+ at end
+
+ at implementation Test2
+-(id)init {
+ _prop = 0;
+}
+ at end
Modified: cfe/trunk/test/ARCMT/Inputs/test1.m.in.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/Inputs/test1.m.in.result?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/Inputs/test1.m.in.result (original)
+++ cfe/trunk/test/ARCMT/Inputs/test1.m.in.result Tue Sep 17 14:14:29 2013
@@ -3,3 +3,13 @@
void test1(id p) {
}
+
+ at interface Test2
+ at property (strong) id prop;
+ at end
+
+ at implementation Test2
+-(id)init {
+ _prop = 0;
+}
+ at end
Modified: cfe/trunk/test/ARCMT/migrate-with-pch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/migrate-with-pch.m?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/migrate-with-pch.m (original)
+++ cfe/trunk/test/ARCMT/migrate-with-pch.m Tue Sep 17 14:14:29 2013
@@ -1,7 +1,7 @@
// 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
Modified: cfe/trunk/test/ARCMT/migrate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/migrate.m?rev=190880&r1=190879&r2=190880&view=diff
==============================================================================
--- cfe/trunk/test/ARCMT/migrate.m (original)
+++ cfe/trunk/test/ARCMT/migrate.m Tue Sep 17 14:14:29 2013
@@ -1,6 +1,6 @@
// 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
Removed: cfe/trunk/test/ARCMT/with-arc-mode-check.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/with-arc-mode-check.m?rev=190879&view=auto
==============================================================================
--- cfe/trunk/test/ARCMT/with-arc-mode-check.m (original)
+++ cfe/trunk/test/ARCMT/with-arc-mode-check.m (removed)
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -arcmt-check -fsyntax-only -fobjc-arc -x objective-c %s
-
- at protocol NSObject
-- (oneway void)release;
- at end
-
-void test1(id p) {
- [p release];
-}
Removed: cfe/trunk/test/ARCMT/with-arc-mode-migrate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/with-arc-mode-migrate.m?rev=190879&view=auto
==============================================================================
--- cfe/trunk/test/ARCMT/with-arc-mode-migrate.m (original)
+++ cfe/trunk/test/ARCMT/with-arc-mode-migrate.m (removed)
@@ -1,13 +0,0 @@
-// 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
-
- at protocol NSObject
-- (oneway void)release;
- at end
-
-void test1(id p) {
- [p release];
-}
Removed: cfe/trunk/test/ARCMT/with-arc-mode-migrate.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/with-arc-mode-migrate.m.result?rev=190879&view=auto
==============================================================================
--- cfe/trunk/test/ARCMT/with-arc-mode-migrate.m.result (original)
+++ cfe/trunk/test/ARCMT/with-arc-mode-migrate.m.result (removed)
@@ -1,12 +0,0 @@
-// 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
-
- at protocol NSObject
-- (oneway void)release;
- at end
-
-void test1(id p) {
-}
More information about the cfe-commits
mailing list