aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
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
commitf5c2b85a55d67bb0b4711932ecb3a4bfb7a1974f (patch)
tree041034918223f633336eac712c8807536d06f4f4 /include/llvm
parent7c76cd517ec699424cbc7c218fa71bad08331e61 (diff)
downloadexternal_llvm-f5c2b85a55d67bb0b4711932ecb3a4bfb7a1974f.zip
external_llvm-f5c2b85a55d67bb0b4711932ecb3a4bfb7a1974f.tar.gz
external_llvm-f5c2b85a55d67bb0b4711932ecb3a4bfb7a1974f.tar.bz2
Move most targets TargetMachine constructor to only taking a target triple.
- The C, C++, MSIL, and Mips backends still need the module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Target/TargetRegistry.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h
index 47c9065..9b164ba 100644
--- a/include/llvm/Target/TargetRegistry.h
+++ b/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);
}
};