[cfe-commits] r137566 - in /cfe/trunk: lib/Driver/ToolChains.cpp lib/Driver/Tools.cpp test/Driver/apple-kext-i386.cpp
Bob Wilson
bob.wilson at apple.com
Sat Aug 13 16:48:55 PDT 2011
Author: bwilson
Date: Sat Aug 13 18:48:55 2011
New Revision: 137566
URL: http://llvm.org/viewvc/llvm-project?rev=137566&view=rev
Log:
Reject -mkernel for i386/Darwin C++ code; fall back to llvm-gcc instead.
Since -mkernel implies -fapple-kext, this just extends the current behavior
for -fapple-kext to apply for -mkernel as well. Radar 9933387.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/apple-kext-i386.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=137566&r1=137565&r2=137566&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Aug 13 18:48:55 2011
@@ -211,7 +211,8 @@
types::isCXX(Inputs[0]->getType()) &&
getTriple().getOS() == llvm::Triple::Darwin &&
getTriple().getArch() == llvm::Triple::x86 &&
- C.getArgs().getLastArg(options::OPT_fapple_kext))
+ (C.getArgs().getLastArg(options::OPT_fapple_kext) ||
+ C.getArgs().getLastArg(options::OPT_mkernel)))
Key = JA.getKind();
else
Key = Action::AnalyzeJobClass;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=137566&r1=137565&r2=137566&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Aug 13 18:48:55 2011
@@ -1370,7 +1370,8 @@
if (types::isCXX(InputType) &&
getToolChain().getTriple().getOS() == llvm::Triple::Darwin &&
getToolChain().getTriple().getArch() == llvm::Triple::x86) {
- if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)))
+ if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)) ||
+ (Unsupported = Args.getLastArg(options::OPT_mkernel)))
D.Diag(diag::err_drv_clang_unsupported_opt_cxx_darwin_i386)
<< Unsupported->getOption().getName();
}
Modified: cfe/trunk/test/Driver/apple-kext-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/apple-kext-i386.cpp?rev=137566&r1=137565&r2=137566&view=diff
==============================================================================
--- cfe/trunk/test/Driver/apple-kext-i386.cpp (original)
+++ cfe/trunk/test/Driver/apple-kext-i386.cpp Sat Aug 13 18:48:55 2011
@@ -7,3 +7,10 @@
// CHECK: cc1plus"
// CHECK: "-fapple-kext"
+
+// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN: -mkernel -### -fsyntax-only %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-MKERNEL < %t %s
+
+// CHECK-MKERNEL: cc1plus"
+// CHECK-MKERNEL: "-mkernel"
More information about the cfe-commits
mailing list