Starting to refactor Target to separate out code that's needed to fully describe

target machine from those that are only needed by codegen. The goal is to
sink the essential target description into MC layer so we can start building
MC based tools without needing to link in the entire codegen.

First step is to refactor TargetRegisterInfo. This patch added a base class
MCRegisterInfo which TargetRegisterInfo is derived from. Changed TableGen to
separate register description from the rest of the stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2011-06-24 01:44:41 +00:00
parent 66dddd1da3
commit a347f85dbe
52 changed files with 502 additions and 271 deletions

View File

@@ -1,8 +1,9 @@
set(LLVM_TARGET_DEFINITIONS MSP430.td)
tablegen(MSP430GenRegisterInfo.h.inc -gen-register-desc-header)
tablegen(MSP430GenRegisterNames.inc -gen-register-enums)
tablegen(MSP430GenRegisterInfo.inc -gen-register-desc)
tablegen(MSP430GenRegisterDesc.inc -gen-register-desc)
tablegen(MSP430GenRegisterInfo.h.inc -gen-register-info-header)
tablegen(MSP430GenRegisterInfo.inc -gen-register-info)
tablegen(MSP430GenInstrNames.inc -gen-instr-enums)
tablegen(MSP430GenInstrInfo.inc -gen-instr-desc)
tablegen(MSP430GenAsmWriter.inc -gen-asm-writer)

View File

@@ -25,13 +25,16 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/Support/ErrorHandling.h"
#include "MSP430GenRegisterDesc.inc"
#include "MSP430GenRegisterInfo.inc"
using namespace llvm;
// FIXME: Provide proper call frame setup / destroy opcodes.
MSP430RegisterInfo::MSP430RegisterInfo(MSP430TargetMachine &tm,
const TargetInstrInfo &tii)
: MSP430GenRegisterInfo(MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
: MSP430GenRegisterInfo(MSP430RegDesc, MSP430RegInfoDesc,
MSP430::ADJCALLSTACKDOWN, MSP430::ADJCALLSTACKUP),
TM(tm), TII(tii) {
StackAlign = TM.getFrameLowering()->getStackAlignment();
}
@@ -250,5 +253,3 @@ int MSP430RegisterInfo::getLLVMRegNum(unsigned RegNum, bool isEH) const {
llvm_unreachable("Not implemented yet!");
return 0;
}
#include "MSP430GenRegisterInfo.inc"

View File

@@ -13,7 +13,8 @@ TARGET = MSP430
# Make sure that tblgen is run, first thing.
BUILT_SOURCES = MSP430GenRegisterInfo.h.inc MSP430GenRegisterNames.inc \
MSP430GenRegisterInfo.inc MSP430GenInstrNames.inc \
MSP430GenRegisterInfo.inc MSP430GenRegisterDesc.inc \
MSP430GenInstrNames.inc \
MSP430GenInstrInfo.inc MSP430GenAsmWriter.inc \
MSP430GenDAGISel.inc MSP430GenCallingConv.inc \
MSP430GenSubtarget.inc