aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-03-20 03:05:54 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-03-20 03:05:54 +0000
commitf48b93cb2054e83e43ca4391b8ec70be89fa2e30 (patch)
tree66cebd47ee2682a2d1f4a9fbef598012dfb8b915 /include
parent83c546afef39d6b7be69f3f399804ebf037c4022 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/clang/Driver/ToolChain.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h
index 3733d45eeb..68d0db176d 100644
--- a/include/clang/Driver/ToolChain.h
+++ b/include/clang/Driver/ToolChain.h
@@ -13,6 +13,7 @@
#include "clang/Driver/Action.h"
#include "clang/Driver/Types.h"
#include "clang/Driver/Util.h"
+#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/Path.h"
@@ -58,12 +59,20 @@ private:
/// programs.
path_list ProgramPaths;
- mutable llvm::DenseMap<unsigned, Tool*> Tools;
+ mutable OwningPtr<Tool> Clang;
+ mutable OwningPtr<Tool> Assemble;
+ mutable OwningPtr<Tool> Link;
+ Tool *getClang() const;
+ Tool *getAssemble() const;
+ Tool *getLink() const;
+ Tool *getClangAs() const;
protected:
ToolChain(const Driver &D, const llvm::Triple &T, const ArgList &Args);
- virtual Tool *constructTool(Action::ActionClass AC) const;
+ virtual Tool *buildAssembler() const;
+ virtual Tool *buildLinker() const;
+ virtual Tool *getTool(Action::ActionClass AC) const;
/// \name Utilities for implementing subclasses.
///@{