diff options
Diffstat (limited to 'lib/Target/MSP430')
-rw-r--r-- | lib/Target/MSP430/CMakeLists.txt | 26 | ||||
-rw-r--r-- | lib/Target/MSP430/InstPrinter/CMakeLists.txt | 8 | ||||
-rw-r--r-- | lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h | 4 | ||||
-rw-r--r-- | lib/Target/MSP430/MCTargetDesc/CMakeLists.txt | 8 | ||||
-rw-r--r-- | lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp | 56 | ||||
-rw-r--r-- | lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h | 4 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430AsmPrinter.cpp | 14 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430ISelLowering.cpp | 1 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430InstrInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430Subtarget.cpp | 2 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.cpp | 7 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430TargetMachine.h | 3 | ||||
-rw-r--r-- | lib/Target/MSP430/TargetInfo/CMakeLists.txt | 8 | ||||
-rw-r--r-- | lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp | 2 |
15 files changed, 94 insertions, 55 deletions
diff --git a/lib/Target/MSP430/CMakeLists.txt b/lib/Target/MSP430/CMakeLists.txt index 33f3d44..0952b76 100644 --- a/lib/Target/MSP430/CMakeLists.txt +++ b/lib/Target/MSP430/CMakeLists.txt @@ -1,11 +1,12 @@ set(LLVM_TARGET_DEFINITIONS MSP430.td) -tablegen(MSP430GenRegisterInfo.inc -gen-register-info) -tablegen(MSP430GenInstrInfo.inc -gen-instr-info) -tablegen(MSP430GenAsmWriter.inc -gen-asm-writer) -tablegen(MSP430GenDAGISel.inc -gen-dag-isel) -tablegen(MSP430GenCallingConv.inc -gen-callingconv) -tablegen(MSP430GenSubtargetInfo.inc -gen-subtarget) +llvm_tablegen(MSP430GenRegisterInfo.inc -gen-register-info) +llvm_tablegen(MSP430GenInstrInfo.inc -gen-instr-info) +llvm_tablegen(MSP430GenAsmWriter.inc -gen-asm-writer) +llvm_tablegen(MSP430GenDAGISel.inc -gen-dag-isel) +llvm_tablegen(MSP430GenCallingConv.inc -gen-callingconv) +llvm_tablegen(MSP430GenSubtargetInfo.inc -gen-subtarget) +add_public_tablegen_target(MSP430CommonTableGen) add_llvm_target(MSP430CodeGen MSP430BranchSelector.cpp @@ -21,6 +22,19 @@ add_llvm_target(MSP430CodeGen MSP430MCInstLower.cpp ) +add_llvm_library_dependencies(LLVMMSP430CodeGen + LLVMAsmPrinter + LLVMCodeGen + LLVMCore + LLVMMC + LLVMMSP430AsmPrinter + LLVMMSP430Desc + LLVMMSP430Info + LLVMSelectionDAG + LLVMSupport + LLVMTarget + ) + add_subdirectory(InstPrinter) add_subdirectory(TargetInfo) add_subdirectory(MCTargetDesc) diff --git a/lib/Target/MSP430/InstPrinter/CMakeLists.txt b/lib/Target/MSP430/InstPrinter/CMakeLists.txt index f5458d5..ce39d95 100644 --- a/lib/Target/MSP430/InstPrinter/CMakeLists.txt +++ b/lib/Target/MSP430/InstPrinter/CMakeLists.txt @@ -3,4 +3,10 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/ add_llvm_library(LLVMMSP430AsmPrinter MSP430InstPrinter.cpp ) -add_dependencies(LLVMMSP430AsmPrinter MSP430CodeGenTable_gen) + +add_llvm_library_dependencies(LLVMMSP430AsmPrinter + LLVMMC + LLVMSupport + ) + +add_dependencies(LLVMMSP430AsmPrinter MSP430CommonTableGen) diff --git a/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp b/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp index e10d4fe..5d6c6ad 100644 --- a/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp +++ b/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp @@ -25,8 +25,10 @@ using namespace llvm; // Include the auto-generated portion of the assembly writer. #include "MSP430GenAsmWriter.inc" -void MSP430InstPrinter::printInst(const MCInst *MI, raw_ostream &O) { +void MSP430InstPrinter::printInst(const MCInst *MI, raw_ostream &O, + StringRef Annot) { printInstruction(MI, O); + printAnnotation(O, Annot); } void MSP430InstPrinter::printPCRelImmOperand(const MCInst *MI, unsigned OpNo, diff --git a/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h b/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h index 50d98b7..a1984a8 100644 --- a/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h +++ b/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h @@ -22,9 +22,9 @@ namespace llvm { class MSP430InstPrinter : public MCInstPrinter { public: MSP430InstPrinter(const MCAsmInfo &MAI) - : MCInstPrinter(MAI) {} + : MCInstPrinter(MAI) {} - virtual void printInst(const MCInst *MI, raw_ostream &O); + virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); // Autogenerated by tblgen. void printInstruction(const MCInst *MI, raw_ostream &O); diff --git a/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt b/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt index 0f3ebd3..04bd03e 100644 --- a/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt @@ -2,3 +2,11 @@ add_llvm_library(LLVMMSP430Desc MSP430MCTargetDesc.cpp MSP430MCAsmInfo.cpp ) + +add_llvm_library_dependencies(LLVMMSP430Desc + LLVMMC + LLVMMSP430AsmPrinter + LLVMMSP430Info + ) + +add_dependencies(LLVMMSP430Desc MSP430CommonTableGen) diff --git a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp index 6aa6220..fda70b8 100644 --- a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp +++ b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp @@ -13,10 +13,12 @@ #include "MSP430MCTargetDesc.h" #include "MSP430MCAsmInfo.h" +#include "InstPrinter/MSP430InstPrinter.h" +#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" #define GET_INSTRINFO_MC_DESC #include "MSP430GenInstrInfo.inc" @@ -35,22 +37,12 @@ static MCInstrInfo *createMSP430MCInstrInfo() { return X; } -extern "C" void LLVMInitializeMSP430MCInstrInfo() { - TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo); -} - - static MCRegisterInfo *createMSP430MCRegisterInfo(StringRef TT) { MCRegisterInfo *X = new MCRegisterInfo(); InitMSP430MCRegisterInfo(X, MSP430::PCW); return X; } -extern "C" void LLVMInitializeMSP430MCRegisterInfo() { - TargetRegistry::RegisterMCRegInfo(TheMSP430Target, - createMSP430MCRegisterInfo); -} - static MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS) { MCSubtargetInfo *X = new MCSubtargetInfo(); @@ -58,22 +50,42 @@ static MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU, return X; } -extern "C" void LLVMInitializeMSP430MCSubtargetInfo() { - TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target, - createMSP430MCSubtargetInfo); +static MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM, + CodeModel::Model CM) { + MCCodeGenInfo *X = new MCCodeGenInfo(); + X->InitMCCodeGenInfo(RM, CM); + return X; } -extern "C" void LLVMInitializeMSP430MCAsmInfo() { - RegisterMCAsmInfo<MSP430MCAsmInfo> X(TheMSP430Target); +static MCInstPrinter *createMSP430MCInstPrinter(const Target &T, + unsigned SyntaxVariant, + const MCAsmInfo &MAI, + const MCSubtargetInfo &STI) { + if (SyntaxVariant == 0) + return new MSP430InstPrinter(MAI); + return 0; } -MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM) { - MCCodeGenInfo *X = new MCCodeGenInfo(); - X->InitMCCodeGenInfo(RM); - return X; -} +extern "C" void LLVMInitializeMSP430TargetMC() { + // Register the MC asm info. + RegisterMCAsmInfo<MSP430MCAsmInfo> X(TheMSP430Target); -extern "C" void LLVMInitializeMSP430MCCodeGenInfo() { + // Register the MC codegen info. TargetRegistry::RegisterMCCodeGenInfo(TheMSP430Target, createMSP430MCCodeGenInfo); + + // Register the MC instruction info. + TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo); + + // Register the MC register info. + TargetRegistry::RegisterMCRegInfo(TheMSP430Target, + createMSP430MCRegisterInfo); + + // Register the MC subtarget info. + TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target, + createMSP430MCSubtargetInfo); + + // Register the MCInstPrinter. + TargetRegistry::RegisterMCInstPrinter(TheMSP430Target, + createMSP430MCInstPrinter); } diff --git a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h index 0d8a6bd..35f2590 100644 --- a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h +++ b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef ALPHAMCTARGETDESC_H -#define ALPHAMCTARGETDESC_H +#ifndef MSP430MCTARGETDESC_H +#define MSP430MCTARGETDESC_H namespace llvm { class MCSubtargetInfo; diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp index 2042056..8836549 100644 --- a/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -32,9 +32,7 @@ #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Target/Mangler.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetLoweringObjectFile.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -163,17 +161,7 @@ void MSP430AsmPrinter::EmitInstruction(const MachineInstr *MI) { OutStreamer.EmitInstruction(TmpInst); } -static MCInstPrinter *createMSP430MCInstPrinter(const Target &T, - unsigned SyntaxVariant, - const MCAsmInfo &MAI) { - if (SyntaxVariant == 0) - return new MSP430InstPrinter(MAI); - return 0; -} - // Force static initialization. extern "C" void LLVMInitializeMSP430AsmPrinter() { RegisterAsmPrinter<MSP430AsmPrinter> X(TheMSP430Target); - TargetRegistry::RegisterMCInstPrinter(TheMSP430Target, - createMSP430MCInstPrinter); } diff --git a/lib/Target/MSP430/MSP430ISelLowering.cpp b/lib/Target/MSP430/MSP430ISelLowering.cpp index 8405789..dc37431 100644 --- a/lib/Target/MSP430/MSP430ISelLowering.cpp +++ b/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -79,6 +79,7 @@ MSP430TargetLowering::MSP430TargetLowering(MSP430TargetMachine &tm) : setStackPointerRegisterToSaveRestore(MSP430::SPW); setBooleanContents(ZeroOrOneBooleanContent); + setBooleanVectorContents(ZeroOrOneBooleanContent); // FIXME: Is this correct? setSchedulingPreference(Sched::Latency); // We have post-incremented loads / stores. diff --git a/lib/Target/MSP430/MSP430InstrInfo.cpp b/lib/Target/MSP430/MSP430InstrInfo.cpp index 846d093..ffd4318 100644 --- a/lib/Target/MSP430/MSP430InstrInfo.cpp +++ b/lib/Target/MSP430/MSP430InstrInfo.cpp @@ -20,8 +20,8 @@ #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" +#include "llvm/Support/TargetRegistry.h" #define GET_INSTRINFO_CTOR #include "MSP430GenInstrInfo.inc" diff --git a/lib/Target/MSP430/MSP430Subtarget.cpp b/lib/Target/MSP430/MSP430Subtarget.cpp index b58c50a..3ee14d9 100644 --- a/lib/Target/MSP430/MSP430Subtarget.cpp +++ b/lib/Target/MSP430/MSP430Subtarget.cpp @@ -13,7 +13,7 @@ #include "MSP430Subtarget.h" #include "MSP430.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" #define GET_SUBTARGETINFO_TARGET_DESC #define GET_SUBTARGETINFO_CTOR diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 85ca533..4dd8933 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -16,7 +16,7 @@ #include "llvm/PassManager.h" #include "llvm/CodeGen/Passes.h" #include "llvm/MC/MCAsmInfo.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" using namespace llvm; extern "C" void LLVMInitializeMSP430Target() { @@ -27,8 +27,9 @@ extern "C" void LLVMInitializeMSP430Target() { MSP430TargetMachine::MSP430TargetMachine(const Target &T, StringRef TT, StringRef CPU, - StringRef FS, Reloc::Model RM) - : LLVMTargetMachine(T, TT, CPU, FS, RM), + StringRef FS, + Reloc::Model RM, CodeModel::Model CM) + : LLVMTargetMachine(T, TT, CPU, FS, RM, CM), Subtarget(TT, CPU, FS), // FIXME: Check TargetData string. DataLayout("e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"), diff --git a/lib/Target/MSP430/MSP430TargetMachine.h b/lib/Target/MSP430/MSP430TargetMachine.h index 384176c..eb483dc 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.h +++ b/lib/Target/MSP430/MSP430TargetMachine.h @@ -39,7 +39,8 @@ class MSP430TargetMachine : public LLVMTargetMachine { public: MSP430TargetMachine(const Target &T, StringRef TT, - StringRef CPU, StringRef FS, Reloc::Model RM); + StringRef CPU, StringRef FS, + Reloc::Model RM, CodeModel::Model CM); virtual const TargetFrameLowering *getFrameLowering() const { return &FrameLowering; diff --git a/lib/Target/MSP430/TargetInfo/CMakeLists.txt b/lib/Target/MSP430/TargetInfo/CMakeLists.txt index 2d1aa9d..1526946 100644 --- a/lib/Target/MSP430/TargetInfo/CMakeLists.txt +++ b/lib/Target/MSP430/TargetInfo/CMakeLists.txt @@ -4,4 +4,10 @@ add_llvm_library(LLVMMSP430Info MSP430TargetInfo.cpp ) -add_dependencies(LLVMMSP430Info MSP430CodeGenTable_gen) +add_llvm_library_dependencies(LLVMMSP430Info + LLVMMC + LLVMSupport + LLVMTarget + ) + +add_dependencies(LLVMMSP430Info MSP430CommonTableGen) diff --git a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp index f9ca5c4..8b3e01e 100644 --- a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp +++ b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp @@ -9,7 +9,7 @@ #include "MSP430.h" #include "llvm/Module.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" using namespace llvm; Target llvm::TheMSP430Target; |