diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
commit | ffc0e73046f737d75e0a62b3a83ef19bcef111e3 (patch) | |
tree | 1f82f6a0b1c1a743dd4c10377858004988a47262 /lib/Target/SystemZ/SystemZSubtarget.cpp | |
parent | 4f4a6fcd165293c347a42b543e5e55aa42a09bb2 (diff) |
Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change
subtarget state (e.g. .code 16) and it must be reflected in other
modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance
must be shared.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZSubtarget.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZSubtarget.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZSubtarget.cpp b/lib/Target/SystemZ/SystemZSubtarget.cpp index f20010b2b2..f6707f9a20 100644 --- a/lib/Target/SystemZ/SystemZSubtarget.cpp +++ b/lib/Target/SystemZ/SystemZSubtarget.cpp @@ -15,6 +15,7 @@ #include "SystemZ.h" #include "llvm/GlobalValue.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetRegistry.h" #define GET_SUBTARGETINFO_ENUM #define GET_SUBTARGETINFO_MC_DESC @@ -53,3 +54,15 @@ bool SystemZSubtarget::GVRequiresExtraLoad(const GlobalValue* GV, return false; } + +MCSubtargetInfo *createSystemZMCSubtargetInfo(StringRef TT, StringRef CPU, + StringRef FS) { + MCSubtargetInfo *X = new MCSubtargetInfo(); + InitSystemZMCSubtargetInfo(X, CPU, FS); + return X; +} + +extern "C" void LLVMInitializeSystemZMCSubtargetInfo() { + TargetRegistry::RegisterMCSubtargetInfo(TheSystemZTarget, + createSystemZMCSubtargetInfo); +} |