mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Remove most of the TargetMachine::getSubtarget/getSubtargetImpl
calls that don't take a Function argument from Mips. Notable exceptions: the AsmPrinter and MipsTargetObjectFile. The latter needs to be fixed, and the former will be fixed when the general AsmPrinter changes happen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -7,10 +7,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MipsMachineFunction.h"
|
||||
#include "MCTargetDesc/MipsBaseInfo.h"
|
||||
#include "MipsMachineFunction.h"
|
||||
#include "MipsInstrInfo.h"
|
||||
#include "MipsSubtarget.h"
|
||||
#include "MipsTargetMachine.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
@ -78,12 +79,14 @@ unsigned MipsFunctionInfo::getGlobalBaseReg() {
|
||||
if (GlobalBaseReg)
|
||||
return GlobalBaseReg;
|
||||
|
||||
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
|
||||
|
||||
const TargetRegisterClass *RC =
|
||||
ST.inMips16Mode() ? &Mips::CPU16RegsRegClass
|
||||
: ST.isABI_N64() ? &Mips::GPR64RegClass
|
||||
: &Mips::GPR32RegClass;
|
||||
static_cast<const MipsSubtarget &>(MF.getSubtarget()).inMips16Mode()
|
||||
? &Mips::CPU16RegsRegClass
|
||||
: static_cast<const MipsTargetMachine &>(MF.getTarget())
|
||||
.getABI()
|
||||
.IsN64()
|
||||
? &Mips::GPR64RegClass
|
||||
: &Mips::GPR32RegClass;
|
||||
return GlobalBaseReg = MF.getRegInfo().createVirtualRegister(RC);
|
||||
}
|
||||
|
||||
@ -101,9 +104,10 @@ unsigned MipsFunctionInfo::getMips16SPAliasReg() {
|
||||
|
||||
void MipsFunctionInfo::createEhDataRegsFI() {
|
||||
for (int I = 0; I < 4; ++I) {
|
||||
const MipsSubtarget &ST = MF.getTarget().getSubtarget<MipsSubtarget>();
|
||||
const TargetRegisterClass *RC = ST.isABI_N64() ?
|
||||
&Mips::GPR64RegClass : &Mips::GPR32RegClass;
|
||||
const TargetRegisterClass *RC =
|
||||
static_cast<const MipsTargetMachine &>(MF.getTarget()).getABI().IsN64()
|
||||
? &Mips::GPR64RegClass
|
||||
: &Mips::GPR32RegClass;
|
||||
|
||||
EhDataRegFI[I] = MF.getFrameInfo()->CreateStackObject(RC->getSize(),
|
||||
RC->getAlignment(), false);
|
||||
|
Reference in New Issue
Block a user