summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-02 23:37:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-02 23:37:13 +0000
commitc3719c36e61f6ac28fc1e12587131bcae6581671 (patch)
tree774ba7501ce13f5da38e87518ef98535c0ded3ea /llvm/include
parent71fc19e9911e234761151867079764c942f3b7bf (diff)
downloadbcm5719-llvm-c3719c36e61f6ac28fc1e12587131bcae6581671.tar.gz
bcm5719-llvm-c3719c36e61f6ac28fc1e12587131bcae6581671.zip
Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module. llvm-svn: 77927
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Target/TargetRegistry.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetRegistry.h b/llvm/include/llvm/Target/TargetRegistry.h
index 47c90654c2d..9b164ba23e8 100644
--- a/llvm/include/llvm/Target/TargetRegistry.h
+++ b/llvm/include/llvm/Target/TargetRegistry.h
@@ -23,6 +23,9 @@
// FIXME: We shouldn't need this header, but we need it until there is a
// different interface to get the TargetAsmInfo.
#include "llvm/Target/TargetMachine.h"
+// FIXME: We shouldn't need this header, but we need it until there is a
+// different interface to the target machines.
+#include "llvm/Module.h"
#include <string>
#include <cassert>
@@ -323,6 +326,19 @@ namespace llvm {
private:
static TargetMachine *Allocator(const Target &T, const Module &M,
const std::string &FS) {
+ return new TargetMachineImpl(T, M.getTargetTriple(), FS);
+ }
+ };
+
+ template<class TargetMachineImpl>
+ struct RegisterTargetMachineDeprecated {
+ RegisterTargetMachineDeprecated(Target &T) {
+ TargetRegistry::RegisterTargetMachine(T, &Allocator);
+ }
+
+ private:
+ static TargetMachine *Allocator(const Target &T, const Module &M,
+ const std::string &FS) {
return new TargetMachineImpl(T, M, FS);
}
};
OpenPOWER on IntegriCloud