]> granicus.if.org Git - clang/commitdiff
[arcmt] Ignore linking errors when doing ARC migration, rdar://10247606
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 7 Oct 2011 22:58:08 +0000 (22:58 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 7 Oct 2011 22:58:08 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/ARCMT/driver-migrate.m

index 1e8dcb7090c36e9b33db6af88122543137684f00..648da87c8e688f1fae1fe3d9fa1ba9323b0175c2 100644 (file)
@@ -3372,6 +3372,18 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
   // more information.
   ArgStringList CmdArgs;
 
+  /// Hack(tm) to ignore linking errors when we are doing ARC migration.
+  if (Args.hasArg(options::OPT_ccc_arcmt_check,
+                  options::OPT_ccc_arcmt_migrate)) {
+    for (ArgList::const_iterator I = Args.begin(), E = Args.end(); I != E; ++I)
+      (*I)->claim();
+    const char *Exec =
+      Args.MakeArgString(getToolChain().GetProgramPath("touch"));
+    CmdArgs.push_back(Output.getFilename());
+    C.addCommand(new Command(JA, *this, Exec, CmdArgs));
+    return;
+  }
+
   // I'm not sure why this particular decomposition exists in gcc, but
   // we follow suite for ease of comparison.
   AddLinkArgs(C, Args, CmdArgs);
index e283857cb574944b08f0fd8e174c480194eafeac..d1350f7233cfd1bcd25c94298178c63c0124a423 100644 (file)
@@ -1,3 +1,12 @@
 // RUN: %clang -### -ccc-arcmt-migrate /foo/bar -fsyntax-only %s 2>&1 | FileCheck %s
 
 // CHECK: "-arcmt-migrate" "-arcmt-migrate-directory" "{{[^"]*}}/foo/bar"
+
+// RUN: touch %t.o
+// RUN: %clang -ccc-arcmt-check -ccc-host-triple i386-apple-darwin9 -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=LINK %s < %t.log
+// RUN: %clang -ccc-arcmt-migrate /foo/bar -ccc-host-triple i386-apple-darwin9 -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=LINK %s < %t.log
+
+// LINK-NOT: ld"
+// LINK: touch"