diff options
Diffstat (limited to 'include/llvm/Target/TargetRegistry.h')
-rw-r--r-- | include/llvm/Target/TargetRegistry.h | 16 |
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); } }; |