diff options
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 99 |
1 files changed, 17 insertions, 82 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index e5fbc52dc0b..8a9381ec9c7 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -183,12 +183,6 @@ void Generic_ELF::anchor() {} Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { Action::ActionClass Key = JA.getKind(); - - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) { - // 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, IsIntegratedAssemblerDefault()); @@ -200,13 +194,11 @@ Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA, case Action::BindArchClass: llvm_unreachable("Invalid tool kind."); case Action::PreprocessJobClass: - T = new tools::darwin::Preprocess(*this); break; case Action::AnalyzeJobClass: case Action::MigrateJobClass: - T = new tools::Clang(*this); break; case Action::PrecompileJobClass: case Action::CompileJobClass: - T = new tools::darwin::Compile(*this); break; + T = new tools::Clang(*this); break; case Action::AssembleJobClass: { if (UseIntegratedAs) T = new tools::ClangAs(*this); @@ -1425,11 +1417,7 @@ Generic_GCC::~Generic_GCC() { Tool &Generic_GCC::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { @@ -1438,14 +1426,11 @@ Tool &Generic_GCC::SelectTool(const Compilation &C, case Action::BindArchClass: llvm_unreachable("Invalid tool kind."); case Action::PreprocessJobClass: - T = new tools::gcc::Preprocess(*this); break; case Action::PrecompileJobClass: - T = new tools::gcc::Precompile(*this); break; case Action::AnalyzeJobClass: case Action::MigrateJobClass: - T = new tools::Clang(*this); break; case Action::CompileJobClass: - T = new tools::gcc::Compile(*this); break; + T = new tools::Clang(*this); break; case Action::AssembleJobClass: T = new tools::gcc::Assemble(*this); break; case Action::LinkJobClass: @@ -1495,27 +1480,18 @@ Hexagon_TC::~Hexagon_TC() { Tool &Hexagon_TC::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - // if (JA.getKind () == Action::CompileJobClass) - // Key = JA.getKind (); - // else - - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - // if ((JA.getKind () == Action::CompileJobClass) - // && (JA.getType () != types::TY_LTO_BC)) { - // Key = JA.getKind (); - // } - + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { switch (Key) { case Action::InputClass: case Action::BindArchClass: assert(0 && "Invalid tool kind."); + case Action::PreprocessJobClass: + case Action::PrecompileJobClass: case Action::AnalyzeJobClass: + case Action::MigrateJobClass: + case Action::CompileJobClass: T = new tools::Clang(*this); break; case Action::AssembleJobClass: T = new tools::hexagon::Assemble(*this); break; @@ -1599,12 +1575,7 @@ OpenBSD::OpenBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Arg Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - + Action::ActionClass Key = JA.getKind(); bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIntegratedAssemblerDefault()); @@ -1639,12 +1610,7 @@ Bitrig::Bitrig(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) Tool &Bitrig::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - + Action::ActionClass Key = JA.getKind(); bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIntegratedAssemblerDefault()); @@ -1731,12 +1697,7 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Arg Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - + Action::ActionClass Key = JA.getKind(); bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIntegratedAssemblerDefault()); @@ -1780,12 +1741,7 @@ NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) Tool &NetBSD::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - + Action::ActionClass Key = JA.getKind(); bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIntegratedAssemblerDefault()); @@ -1820,11 +1776,7 @@ Minix::Minix(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) Tool &Minix::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { @@ -1861,11 +1813,7 @@ AuroraUX::AuroraUX(const Driver &D, const llvm::Triple& Triple, Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { @@ -1898,11 +1846,7 @@ Solaris::Solaris(const Driver &D, const llvm::Triple& Triple, Tool &Solaris::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { @@ -2275,12 +2219,7 @@ bool Linux::HasNativeLLVMSupport() const { Tool &Linux::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); - + Action::ActionClass Key = JA.getKind(); bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIntegratedAssemblerDefault()); @@ -2498,11 +2437,7 @@ DragonFly::DragonFly(const Driver &D, const llvm::Triple& Triple, const ArgList Tool &DragonFly::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { - Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else - Key = JA.getKind(); + Action::ActionClass Key = JA.getKind(); Tool *&T = Tools[Key]; if (!T) { |

