aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetMachine.h
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-07-12 01:41:54 +0000
committerNate Begeman <natebegeman@mac.com>2005-07-12 01:41:54 +0000
commitfb5792f416089d8d8d0c6ee62c1f41a55d2cf75d (patch)
treee2b2a65b1d1e7f426d6f3035bca964ce25c0d79d /include/llvm/Target/TargetMachine.h
parent73213f6c07afc1479f8d7bf53ea99adf7fd60b78 (diff)
downloadexternal_llvm-fb5792f416089d8d8d0c6ee62c1f41a55d2cf75d.zip
external_llvm-fb5792f416089d8d8d0c6ee62c1f41a55d2cf75d.tar.gz
external_llvm-fb5792f416089d8d8d0c6ee62c1f41a55d2cf75d.tar.bz2
Implement Subtarget support
Implement the X86 Subtarget. This consolidates the checks for target triple, and setting options based on target triple into one place. This allows us to convert the asm printer and isel over from being littered with "forDarwin", "forCygwin", etc. into just having the appropriate flags for each subtarget feature controlling the code for that feature. This patch also implements indirect external and weak references in the X86 pattern isel, for darwin. Next up is to convert over the asm printers to use this new interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetMachine.h')
-rw-r--r--include/llvm/Target/TargetMachine.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index 6e3fe35..efeb61d 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -19,6 +19,7 @@
namespace llvm {
+class TargetSubtarget;
class TargetInstrInfo;
class TargetInstrDescriptor;
class TargetJITInfo;
@@ -97,6 +98,13 @@ public:
virtual const TargetFrameInfo *getFrameInfo() const { return 0; }
const TargetData &getTargetData() const { return DataLayout; }
+ virtual const TargetSubtarget *getSubtargetImpl() const { return 0; }
+ template<typename STC> STC *getSubtarget() const {
+ assert(getSubtargetImpl() && dynamic_cast<STC*>(getSubtargetImpl()) &&
+ "Not the right kind of subtarget!");
+ return (STC*)getSubtargetImpl();
+ }
+
/// getRegisterInfo - If register information is available, return it. If
/// not, return null. This is kept separate from RegInfo until RegInfo has
/// details of graph coloring register allocation removed from it.