Skip to content

Commit

Permalink
Driver: rename Windows to MSVCToolChain
Browse files Browse the repository at this point in the history
This renames the Windows toolchain to MSVCToolChain.  This is a preparatory step
for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the
standard GCC toolchain lookup.  NFC.

llvm-svn: 220362
  • Loading branch information
compnerd committed Oct 22, 2014
1 parent b0fc4cf commit 819f391
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@ add_clang_library(clangDriver
DriverOptions.cpp
Job.cpp
Multilib.cpp
MSVCToolChain.cpp
Phases.cpp
SanitizerArgs.cpp
Tool.cpp
ToolChain.cpp
ToolChains.cpp
WindowsToolChain.cpp
Tools.cpp
Types.cpp

2 changes: 1 addition & 1 deletion clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
@@ -2041,7 +2041,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
break;
case llvm::Triple::MSVC:
case llvm::Triple::UnknownEnvironment:
TC = new toolchains::Windows(*this, Target, Args);
TC = new toolchains::MSVCToolChain(*this, Target, Args);
break;
}
break;
Original file line number Diff line number Diff line change
@@ -38,42 +38,42 @@ using namespace clang::driver::toolchains;
using namespace clang;
using namespace llvm::opt;

Windows::Windows(const Driver &D, const llvm::Triple& Triple,
const ArgList &Args)
MSVCToolChain::MSVCToolChain(const Driver &D, const llvm::Triple& Triple,
const ArgList &Args)
: ToolChain(D, Triple, Args) {
}

Tool *Windows::buildLinker() const {
Tool *MSVCToolChain::buildLinker() const {
return new tools::visualstudio::Link(*this);
}

Tool *Windows::buildAssembler() const {
Tool *MSVCToolChain::buildAssembler() const {
if (getTriple().isOSBinFormatMachO())
return new tools::darwin::Assemble(*this);
getDriver().Diag(clang::diag::err_no_external_assembler);
return nullptr;
}

bool Windows::IsIntegratedAssemblerDefault() const {
bool MSVCToolChain::IsIntegratedAssemblerDefault() const {
return true;
}

bool Windows::IsUnwindTablesDefault() const {
bool MSVCToolChain::IsUnwindTablesDefault() const {
// Emit unwind tables by default on Win64. All non-x86_32 Windows platforms
// such as ARM and PPC actually require unwind tables, but LLVM doesn't know
// how to generate them yet.
return getArch() == llvm::Triple::x86_64;
}

bool Windows::isPICDefault() const {
bool MSVCToolChain::isPICDefault() const {
return getArch() == llvm::Triple::x86_64;
}

bool Windows::isPIEDefault() const {
bool MSVCToolChain::isPIEDefault() const {
return false;
}

bool Windows::isPICDefaultForced() const {
bool MSVCToolChain::isPICDefaultForced() const {
return getArch() == llvm::Triple::x86_64;
}

@@ -270,8 +270,8 @@ static bool getVisualStudioDir(std::string &path) {
return false;
}

void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
void MSVCToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
if (DriverArgs.hasArg(options::OPT_nostdinc))
return;

@@ -329,7 +329,7 @@ void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
addSystemIncludes(DriverArgs, CC1Args, Paths);
}

void Windows::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
void MSVCToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
// FIXME: There should probably be logic here to find libc++ on Windows.
}
6 changes: 3 additions & 3 deletions clang/lib/Driver/ToolChains.h
Original file line number Diff line number Diff line change
@@ -727,10 +727,10 @@ class LLVM_LIBRARY_VISIBILITY TCEToolChain : public ToolChain {
bool isPICDefaultForced() const override;
};

class LLVM_LIBRARY_VISIBILITY Windows : public ToolChain {
class LLVM_LIBRARY_VISIBILITY MSVCToolChain : public ToolChain {
public:
Windows(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args);
MSVCToolChain(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args);

bool IsIntegratedAssemblerDefault() const override;
bool IsUnwindTablesDefault() const override;

0 comments on commit 819f391

Please sign in to comment.