diff options
Diffstat (limited to 'lib/Driver/WindowsToolChain.cpp')
-rw-r--r-- | lib/Driver/WindowsToolChain.cpp | 55 |
1 files changed, 16 insertions, 39 deletions
diff --git a/lib/Driver/WindowsToolChain.cpp b/lib/Driver/WindowsToolChain.cpp index e7ab4ced87..622c49296d 100644 --- a/lib/Driver/WindowsToolChain.cpp +++ b/lib/Driver/WindowsToolChain.cpp @@ -14,6 +14,7 @@ #include "clang/Driver/ArgList.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" +#include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/Options.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Path.h" @@ -31,48 +32,20 @@ using namespace clang::driver; using namespace clang::driver::toolchains; using namespace clang; -Windows::Windows(const Driver &D, const llvm::Triple& Triple) - : ToolChain(D, Triple) { +Windows::Windows(const Driver &D, const llvm::Triple& Triple, + const ArgList &Args) + : ToolChain(D, Triple, Args) { } -Tool &Windows::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(); - - bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as, - options::OPT_no_integrated_as, - IsIntegratedAssemblerDefault()); - - Tool *&T = Tools[Key]; - if (!T) { - switch (Key) { - case Action::InputClass: - case Action::BindArchClass: - case Action::LipoJobClass: - case Action::DsymutilJobClass: - case Action::VerifyJobClass: - case Action::PreprocessJobClass: - case Action::PrecompileJobClass: - case Action::AnalyzeJobClass: - case Action::MigrateJobClass: - case Action::CompileJobClass: - T = new tools::Clang(*this); break; - case Action::AssembleJobClass: - if (!UseIntegratedAs && getTriple().getEnvironment() == llvm::Triple::MachO) - T = new tools::darwin::Assemble(*this); - else - T = new tools::ClangAs(*this); - break; - case Action::LinkJobClass: - T = new tools::visualstudio::Link(*this); break; - } - } +Tool *Windows::buildLinker() const { + return new tools::visualstudio::Link(*this); +} - return *T; +Tool *Windows::buildAssembler() const { + if (getTriple().getEnvironment() == llvm::Triple::MachO) + return new tools::darwin::Assemble(*this); + getDriver().Diag(clang::diag::err_no_external_windows_assembler); + return NULL; } bool Windows::IsIntegratedAssemblerDefault() const { @@ -87,6 +60,10 @@ bool Windows::isPICDefault() const { return getArch() == llvm::Triple::x86_64; } +bool Windows::isPIEDefault() const { + return false; +} + bool Windows::isPICDefaultForced() const { return getArch() == llvm::Triple::x86_64; } |