[cfe-commits] r108741 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/rewrite-objc.m
Daniel Dunbar
daniel at zuster.org
Mon Jul 19 12:44:22 PDT 2010
Author: ddunbar
Date: Mon Jul 19 14:44:22 2010
New Revision: 108741
URL: http://llvm.org/viewvc/llvm-project?rev=108741&view=rev
Log:
Driver: Make -fnext-runtime the default when rewriting Objective-C.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/rewrite-objc.m
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=108741&r1=108740&r2=108741&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jul 19 14:44:22 2010
@@ -767,6 +767,7 @@
CmdArgs.push_back(Args.MakeArgString(TripleStr));
// Select the appropriate action.
+ bool IsRewriter = false;
if (isa<AnalyzeJobAction>(JA)) {
assert(JA.getType() == types::TY_Plist && "Invalid output type.");
CmdArgs.push_back("-analyze");
@@ -813,6 +814,7 @@
CmdArgs.push_back("-emit-pch");
} else if (JA.getType() == types::TY_RewrittenObjC) {
CmdArgs.push_back("-rewrite-objc");
+ IsRewriter = true;
} else {
assert(JA.getType() == types::TY_PP_Asm &&
"Unexpected output type!");
@@ -1285,9 +1287,12 @@
options::OPT_fno_gnu_keywords))
A->render(Args, CmdArgs);
- // -fnext-runtime is default.
+ // -fnext-runtime defaults to on Darwin and when rewriting Objective-C, and is
+ // -the -cc1 default.
+ bool NeXTRuntimeIsDefault =
+ IsRewriter || getToolChain().getTriple().getOS() == llvm::Triple::Darwin;
if (!Args.hasFlag(options::OPT_fnext_runtime, options::OPT_fgnu_runtime,
- getToolChain().getTriple().getOS() == llvm::Triple::Darwin))
+ NeXTRuntimeIsDefault))
CmdArgs.push_back("-fgnu-runtime");
// -fobjc-nonfragile-abi=0 is default.
Modified: cfe/trunk/test/Driver/rewrite-objc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/rewrite-objc.m?rev=108741&r1=108740&r2=108741&view=diff
==============================================================================
--- cfe/trunk/test/Driver/rewrite-objc.m (original)
+++ cfe/trunk/test/Driver/rewrite-objc.m Mon Jul 19 14:44:22 2010
@@ -1,6 +1,10 @@
// RUN: %clang -ccc-host-triple unknown -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST0 %s
-// TEST0: clang{{.*}}" "-rewrite-objc"
+// TEST0: clang{{.*}}" "-cc1"
+// TEST0: "-rewrite-objc"
+// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
+// TEST0: "-fmessage-length" "0" "-fdiagnostics-show-option"
+// TEST0: rewrite-objc.m"
// RUN: not %clang -ccc-no-clang -ccc-host-triple unknown -rewrite-objc %s -o - -### 2>&1 | \
// RUN: FileCheck -check-prefix=TEST1 %s
More information about the cfe-commits
mailing list