- struct TargetMachineRegistry {
- struct Entry;
-
- /// TargetMachineRegistry::getList - This static method returns the list of
- /// target machines that are registered with the system.
- static const Entry *getList() { return List; }
-
- /// getClosestStaticTargetForModule - Given an LLVM module, pick the best
- /// target that is compatible with the module. If no close target can be
- /// found, this returns null and sets the Error string to a reason.
- static const Entry *getClosestStaticTargetForModule(const Module &M,
- std::string &Error);
-
- /// getClosestTargetForJIT - Given an LLVM module, pick the best target that
- /// is compatible with the current host and the specified module. If no
- /// close target can be found, this returns null and sets the Error string
- /// to a reason.
- static const Entry *getClosestTargetForJIT(std::string &Error);
-
-
- /// Entry - One instance of this struct is created for each target that is
- /// registered.
- struct Entry {
- const char *Name;
- const char *ShortDesc;
- TargetMachine *(*CtorFn)(const Module &, const std::string &);
- unsigned (*ModuleMatchQualityFn)(const Module &M);
- unsigned (*JITMatchQualityFn)();
-
- const Entry *getNext() const { return Next; }
-
- protected:
- Entry(const char *N, const char *SD,
- TargetMachine *(*CF)(const Module &, const std::string &),
- unsigned (*MMF)(const Module &M), unsigned (*JMF)());
- private:
- const Entry *Next; // Next entry in the linked list.
- };
-
- private:
- static const Entry *List;
- };
-