Remove the Tools DensMap from the toolchain.
Each toolchain has a set of tools, but they are all of known types. It can
have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang
compiler, etc.
Instead of keeping a map, just have member variable for each type of tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177479 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/WindowsToolChain.cpp b/lib/Driver/WindowsToolChain.cpp
index ae78272..cc52c00 100644
--- a/lib/Driver/WindowsToolChain.cpp
+++ b/lib/Driver/WindowsToolChain.cpp
@@ -36,19 +36,17 @@
: ToolChain(D, Triple, Args) {
}
-Tool *Windows::constructTool(Action::ActionClass AC) const {
- switch (AC) {
- case Action::AssembleJobClass:
- if (getTriple().getEnvironment() == llvm::Triple::MachO)
- return new tools::darwin::Assemble(*this);
+Tool *Windows::buildLinker() const {
+ return new tools::visualstudio::Link(*this);
+}
+
+Tool *Windows::buildAssembler() const {
+ if (getTriple().getEnvironment() == llvm::Triple::MachO)
+ return new tools::darwin::Assemble(*this);
+ else
// There no assembler we can use on windows other than the integrated
// assembler, so we ignore -no-integrated-as.
- return new tools::ClangAs(*this);
- case Action::LinkJobClass:
- return new tools::visualstudio::Link(*this);
- default:
- return ToolChain::constructTool(AC);
- }
+ return ToolChain::buildAssembler();
}
bool Windows::IsIntegratedAssemblerDefault() const {