ARM: update subtarget information for Windows on ARM

Update the subtarget information for Windows on ARM.  This enables using the MC
layer to target Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2014-04-02 20:32:05 +00:00
parent bc413d65a2
commit 396e5e328c
13 changed files with 157 additions and 16 deletions

View File

@@ -218,10 +218,31 @@ static MCAsmInfo *createARMMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT) {
Triple TheTriple(TT);
MCAsmInfo *MAI;
if (TheTriple.isOSBinFormatMachO())
switch (TheTriple.getOS()) {
case llvm::Triple::Darwin:
case llvm::Triple::IOS:
case llvm::Triple::MacOSX:
MAI = new ARMMCAsmInfoDarwin(TT);
else
MAI = new ARMELFMCAsmInfo(TT);
break;
case llvm::Triple::Win32:
switch (TheTriple.getEnvironment()) {
case llvm::Triple::Itanium:
MAI = new ARMCOFFMCAsmInfoGNU();
break;
case llvm::Triple::MSVC:
MAI = new ARMCOFFMCAsmInfoMicrosoft();
break;
default:
llvm_unreachable("invalid environment");
}
break;
default:
if (TheTriple.isOSBinFormatMachO())
MAI = new ARMMCAsmInfoDarwin(TT);
else
MAI = new ARMELFMCAsmInfo(TT);
break;
}
unsigned Reg = MRI.getDwarfRegNum(ARM::SP, true);
MAI->addInitialFrameState(MCCFIInstruction::createDefCfa(0, Reg, 0));