mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Include the Target& in the TargetMachineRegisterEntry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75772 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3fb7eee9c2
commit
4d1be777f8
@ -23,9 +23,11 @@
|
||||
|
||||
namespace llvm {
|
||||
class Module;
|
||||
class Target;
|
||||
class TargetMachine;
|
||||
|
||||
struct TargetMachineRegistryEntry {
|
||||
const Target &TheTarget;
|
||||
const char *Name;
|
||||
const char *ShortDesc;
|
||||
TargetMachine *(*CtorFn)(const Module &, const std::string &);
|
||||
@ -33,12 +35,12 @@ namespace llvm {
|
||||
unsigned (*JITMatchQualityFn)();
|
||||
|
||||
public:
|
||||
TargetMachineRegistryEntry(const char *N, const char *SD,
|
||||
TargetMachineRegistryEntry(const Target &T, const char *N, const char *SD,
|
||||
TargetMachine *(*CF)(const Module &, const std::string &),
|
||||
unsigned (*MMF)(const Module &M),
|
||||
unsigned (*JMF)())
|
||||
: Name(N), ShortDesc(SD), CtorFn(CF), ModuleMatchQualityFn(MMF),
|
||||
JITMatchQualityFn(JMF) {}
|
||||
: TheTarget(T), Name(N), ShortDesc(SD), CtorFn(CF),
|
||||
ModuleMatchQualityFn(MMF), JITMatchQualityFn(JMF) {}
|
||||
};
|
||||
|
||||
template<>
|
||||
@ -78,7 +80,7 @@ namespace llvm {
|
||||
template<class TargetMachineImpl>
|
||||
struct RegisterTarget {
|
||||
RegisterTarget(Target &T, const char *Name, const char *ShortDesc)
|
||||
: Entry(Name, ShortDesc, &Allocator,
|
||||
: Entry(T, Name, ShortDesc, &Allocator,
|
||||
&TargetMachineImpl::getModuleMatchQuality,
|
||||
&TargetMachineImpl::getJITMatchQuality),
|
||||
Node(Entry) {
|
||||
|
@ -28,7 +28,7 @@ TargetMachineRegistry::getClosestStaticTargetForModule(const Module &M,
|
||||
if (!T)
|
||||
return 0;
|
||||
// FIXME: Temporary hack, please remove.
|
||||
return new TargetMachineRegistry::entry(T->Name, T->ShortDesc,
|
||||
return new TargetMachineRegistry::entry(*T, T->Name, T->ShortDesc,
|
||||
T->TargetMachineCtorFn,
|
||||
T->ModuleMatchQualityFn,
|
||||
T->JITMatchQualityFn);
|
||||
@ -43,7 +43,7 @@ TargetMachineRegistry::getClosestTargetForJIT(std::string &Error) {
|
||||
if (!T)
|
||||
return 0;
|
||||
// FIXME: Temporary hack, please remove.
|
||||
return new TargetMachineRegistry::entry(T->Name, T->ShortDesc,
|
||||
return new TargetMachineRegistry::entry(*T, T->Name, T->ShortDesc,
|
||||
T->TargetMachineCtorFn,
|
||||
T->ModuleMatchQualityFn,
|
||||
T->JITMatchQualityFn);
|
||||
|
Loading…
Reference in New Issue
Block a user