summaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetRegistry.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-26 02:12:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-26 02:12:58 +0000
commita5881e3060aee9f82aef3747a97650e5eafe893a (patch)
tree91b295074626e17cb0342c1de0959a5a6c2349b0 /include/llvm/Target/TargetRegistry.h
parent13b9251eb1343eb4c93944f5d6838404c27a7273 (diff)
downloadllvm-a5881e3060aee9f82aef3747a97650e5eafe893a.tar.gz
llvm-a5881e3060aee9f82aef3747a97650e5eafe893a.tar.bz2
llvm-a5881e3060aee9f82aef3747a97650e5eafe893a.tar.xz
Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the target triple, with a few additional flags. - Remove getClosestStaticTargetForModule, the moral equivalent is now: lookupTarget(Mod->getTargetTriple, true, false, ...); - This no longer does the fuzzy matching with target data (based on endianness and pointer width) that getClosestStaticTargetForModule was doing, but this was deemed unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetRegistry.h')
-rw-r--r--include/llvm/Target/TargetRegistry.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h
index 64d6e12fea..420fba5a09 100644
--- a/include/llvm/Target/TargetRegistry.h
+++ b/include/llvm/Target/TargetRegistry.h
@@ -183,24 +183,27 @@ namespace llvm {
static iterator end() { return iterator(); }
- /// getClosestStaticTargetForTriple - Given a target triple, pick the most
- /// capable target for that triple.
- static const Target *getClosestStaticTargetForTriple(const std::string &TT,
- std::string &Error);
-
- /// 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 Target *getClosestStaticTargetForModule(const Module &M,
- std::string &Error);
+ /// lookupTarget - Lookup a target based on a target triple.
+ ///
+ /// \param Triple - The triple to use for finding a target.
+ /// \param FallbackToHost - If true and no target is found for the given
+ /// \arg Triple, then the host's triple will be used.
+ /// \param RequireJIT - Require the target to support JIT compilation.
+ /// \param Error - On failure, an error string describing why no target was
+ /// found.
+ static const Target *lookupTarget(const std::string &Triple,
+ bool FallbackToHost,
+ bool RequireJIT,
+ std::string &Error);
/// getClosestTargetForJIT - Pick the best target that is compatible with
/// the current host. If no close target can be found, this returns null
/// and sets the Error string to a reason.
- //
- // FIXME: Do we still need this interface, clients can always look for the
- // match for the host triple.
- static const Target *getClosestTargetForJIT(std::string &Error);
+ ///
+ /// Mainted for compatibility through 2.6.
+ static const Target *getClosestTargetForJIT(std::string &Error) {
+ return lookupTarget("", true, true, Error);
+ }
/// @}
/// @name Target Registration