aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/MSP430
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-11 03:57:24 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-11 03:57:24 +0000
commit59ee62d2418df8db499eca1ae17f5900dc2dcbba (patch)
tree087be0d28a100c6e3fe071c6511469636439d20f /lib/Target/MSP430
parentb5a12dd12fa3cd1026e9058a53089c29fb97f2fd (diff)
downloadexternal_llvm-59ee62d2418df8db499eca1ae17f5900dc2dcbba.zip
external_llvm-59ee62d2418df8db499eca1ae17f5900dc2dcbba.tar.gz
external_llvm-59ee62d2418df8db499eca1ae17f5900dc2dcbba.tar.bz2
- Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
and MCSubtargetInfo. - Added methods to update subtarget features (used when targets automatically detect subtarget features or switch modes). - Teach X86Subtarget to update MCSubtargetInfo features bits since the MCSubtargetInfo layer can be shared with other modules. - These fixes .code 16 / .code 32 support since mode switch is updated in MCSubtargetInfo so MC code emitter can do the right thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSP430')
-rw-r--r--lib/Target/MSP430/MSP430InstrInfo.cpp11
-rw-r--r--lib/Target/MSP430/MSP430Subtarget.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/Target/MSP430/MSP430InstrInfo.cpp b/lib/Target/MSP430/MSP430InstrInfo.cpp
index 3738a98..e9dfd52 100644
--- a/lib/Target/MSP430/MSP430InstrInfo.cpp
+++ b/lib/Target/MSP430/MSP430InstrInfo.cpp
@@ -20,6 +20,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/ErrorHandling.h"
#define GET_INSTRINFO_CTOR
@@ -334,3 +335,13 @@ unsigned MSP430InstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
return 6;
}
+
+MCInstrInfo *createMSP430MCInstrInfo() {
+ MCInstrInfo *X = new MCInstrInfo();
+ InitMSP430MCInstrInfo(X);
+ return X;
+}
+
+extern "C" void LLVMInitializeMSP430MCInstrInfo() {
+ TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo);
+}
diff --git a/lib/Target/MSP430/MSP430Subtarget.cpp b/lib/Target/MSP430/MSP430Subtarget.cpp
index 6c5156f..6509d5c 100644
--- a/lib/Target/MSP430/MSP430Subtarget.cpp
+++ b/lib/Target/MSP430/MSP430Subtarget.cpp
@@ -36,7 +36,7 @@ MSP430Subtarget::MSP430Subtarget(const std::string &TT,
MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU,
StringRef FS) {
MCSubtargetInfo *X = new MCSubtargetInfo();
- InitMSP430MCSubtargetInfo(X, CPU, FS);
+ InitMSP430MCSubtargetInfo(X, TT, CPU, FS);
return X;
}