summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-11-08 01:03:29 +0000
committerBob Wilson <bob.wilson@apple.com>2012-11-08 01:03:29 +0000
commitd0de8ceb577fdad9ef6873914b665061b6852a2c (patch)
treeeacc21a0f164af34c4f2c61a99eb32af9f5ac612
parenta1edff0046f3549ad15ba1afdb35d091aa2ff811 (diff)
downloadbcm5719-llvm-d0de8ceb577fdad9ef6873914b665061b6852a2c.tar.gz
bcm5719-llvm-d0de8ceb577fdad9ef6873914b665061b6852a2c.zip
Remove code to fall back to llvm-gcc for i386 kexts.
More cleanups to follow in separate commits.... llvm-svn: 167566
-rw-r--r--clang/include/clang/Driver/Driver.h6
-rw-r--r--clang/lib/Driver/Driver.cpp2
-rw-r--r--clang/lib/Driver/ToolChains.cpp17
-rw-r--r--clang/lib/Frontend/CreateInvocationFromCommandLine.cpp5
-rw-r--r--clang/test/Driver/apple-kext-i386.cpp59
5 files changed, 3 insertions, 86 deletions
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h
index fa83c374c2e..b752ce6a349 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -146,9 +146,6 @@ private:
/// jobs.
unsigned CheckInputsExist : 1;
- /// \brief Force use of clang frontend.
- unsigned ForcedClangUse : 1;
-
public:
/// Use lazy precompiled headers for PCH support.
unsigned CCCUsePCH : 1;
@@ -218,9 +215,6 @@ public:
InstalledDir = Value;
}
- bool shouldForceClangUse() const { return ForcedClangUse; }
- void setForcedClangUse(bool V = true) { ForcedClangUse = V; }
-
/// @}
/// @name Primary Functionality
/// @{
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 4fc6db980c0..9881bbaca39 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -58,7 +58,7 @@ Driver::Driver(StringRef ClangExecutable,
CCCIsCPP(false),CCCEcho(false), CCCPrintBindings(false),
CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false),
CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true),
- ForcedClangUse(false), CCCUsePCH(true), SuppressMissingInputWarning(false) {
+ CCCUsePCH(true), SuppressMissingInputWarning(false) {
Name = llvm::sys::path::stem(ClangExecutable);
Dir = llvm::sys::path::parent_path(ClangExecutable);
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 149b8a1f34c..e5fbc52dc0b 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -183,24 +183,11 @@ void Generic_ELF::anchor() {}
Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA,
const ActionList &Inputs) const {
Action::ActionClass Key = JA.getKind();
- bool useClang = false;
if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) {
- useClang = true;
- // Fallback to llvm-gcc for i386 kext compiles, we don't support that ABI.
- if (!getDriver().shouldForceClangUse() &&
- Inputs.size() == 1 &&
- types::isCXX(Inputs[0]->getType()) &&
- getTriple().isOSDarwin() &&
- getTriple().getArch() == llvm::Triple::x86 &&
- (C.getArgs().getLastArg(options::OPT_fapple_kext) ||
- C.getArgs().getLastArg(options::OPT_mkernel)))
- useClang = false;
- }
-
- // FIXME: This seems like a hacky way to choose clang frontend.
- if (useClang)
+ // FIXME: This seems like a hacky way to choose clang frontend.
Key = Action::AnalyzeJobClass;
+ }
bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
options::OPT_no_integrated_as,
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 0611291f827..d82cb6d0515 100644
--- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -49,11 +49,6 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
// FIXME: We shouldn't have to pass in the path info.
driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(),
"a.out", false, *Diags);
- // Force driver to use clang.
- // FIXME: This seems like a hack. Maybe the "Clang" tool subclass should be
- // available for using it to get the arguments, thus avoiding the overkill
- // of using the driver.
- TheDriver.setForcedClangUse();
// Don't check that inputs exist, they may have been remapped.
TheDriver.setCheckInputsExist(false);
diff --git a/clang/test/Driver/apple-kext-i386.cpp b/clang/test/Driver/apple-kext-i386.cpp
deleted file mode 100644
index db7a0809908..00000000000
--- a/clang/test/Driver/apple-kext-i386.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// Check that we transparently fallback to llvm-gcc for i386 kexts, we don't
-// support the ABI they use (yet).
-
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
-// RUN: FileCheck --check-prefix=CHECK < %t %s
-
-// CHECK: cc1plus"
-// CHECK: "-fapple-kext"
-
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -mkernel -### -fsyntax-only %s 2> %t
-// RUN: FileCheck --check-prefix=CHECK-MKERNEL < %t %s
-
-// CHECK-MKERNEL: cc1plus"
-// CHECK-MKERNEL: "-mkernel"
-
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -Wno-self-assign -Wc++11-extensions -Wno-microsoft -Wmicrosoft -Wvla \
-// RUN: -faltivec -mthumb -mcpu=G4 -mlongcall -mno-longcall -msoft-float \
-// RUN: -Wno-int-conversion -Wconstant-conversion -Wenum-conversion \
-// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
-// RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED < %t %s
-
-// CHECK-UNSUPPORTED: cc1plus"
-// CHECK-UNSUPPORTED-NOT: "-Wno-self-assign"
-// CHECK-UNSUPPORTED-NOT: "-Wc++11-extensions"
-// CHECK-UNSUPPORTED-NOT: "-Wno-microsoft"
-// CHECK-UNSUPPORTED-NOT: "-Wmicrosoft"
-// CHECK-UNSUPPORTED-NOT: "-Wvla"
-// CHECK-UNSUPPORTED-NOT: "-faltivec"
-// CHECK-UNSUPPORTED-NOT: "-mthumb"
-// CHECK-UNSUPPORTED-NOT: "-mlongcall"
-// CHECK-UNSUPPORTED: "-mno-longcall"
-// CHECK-UNSUPPORTED: "-msoft-float"
-// CHECK-UNSUPPORTED-NOT: "-Wno-int-conversion"
-// CHECK-UNSUPPORTED-NOT: "-Wconstant-conversion"
-// CHECK-UNSUPPORTED-NOT: "-Wenum-conversion"
-
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -Wconstant-logical-operand -save-temps \
-// RUN: -fapple-kext -### -fsyntax-only %s 2> %t
-// RUN: FileCheck --check-prefix=CHECK-UNSUPPORTED2 < %t %s
-
-// CHECK-UNSUPPORTED2: cc1plus"
-// CHECK-UNSUPPORTED2-NOT: "-Wconstant-logical-operand"
-
-// Check that -serialize-diagnostics does not cause an "argument unused" error.
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -Wall -fapple-kext -### -serialize-diagnostics %t.dia -c %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CHECK-UNUSED %s
-
-// Check that --serialize-diagnostics does not cause an "argument unused" error.
-// RUN: %clang -target i386-apple-darwin10 \
-// RUN: -Wall -fapple-kext -### --serialize-diagnostics %t.dia -c %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CHECK-UNUSED %s
-
-// CHECK-UNUSED-NOT: argument unused
-// CHECK-UNUSED: cc1plus
OpenPOWER on IntegriCloud