mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
Have MachineRegisterInfo take and store the MachineFunction it
was created for rather than the TargetMachine since we only needed the TM for the subtarget and we can get that from the MF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
392f7d970c
commit
99cd10fe11
@ -17,8 +17,8 @@
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
#include "llvm/ADT/IndexedMap.h"
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineInstrBundle.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
#include <vector>
|
||||
@ -40,7 +40,7 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
const TargetMachine &TM;
|
||||
const MachineFunction *MF;
|
||||
Delegate *TheDelegate;
|
||||
|
||||
/// IsSSA - True when the machine function is in SSA form and virtual
|
||||
@ -123,11 +123,11 @@ private:
|
||||
MachineRegisterInfo(const MachineRegisterInfo&) LLVM_DELETED_FUNCTION;
|
||||
void operator=(const MachineRegisterInfo&) LLVM_DELETED_FUNCTION;
|
||||
public:
|
||||
explicit MachineRegisterInfo(const TargetMachine &TM);
|
||||
explicit MachineRegisterInfo(const MachineFunction *MF);
|
||||
~MachineRegisterInfo();
|
||||
|
||||
const TargetRegisterInfo *getTargetRegisterInfo() const {
|
||||
return TM.getSubtargetImpl()->getRegisterInfo();
|
||||
return MF->getSubtarget().getRegisterInfo();
|
||||
}
|
||||
|
||||
void resetDelegate(Delegate *delegate) {
|
||||
|
@ -58,7 +58,7 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
|
||||
: Fn(F), Target(TM), STI(TM.getSubtargetImpl()), Ctx(mmi.getContext()),
|
||||
MMI(mmi), GMI(gmi) {
|
||||
if (TM.getSubtargetImpl()->getRegisterInfo())
|
||||
RegInfo = new (Allocator) MachineRegisterInfo(TM);
|
||||
RegInfo = new (Allocator) MachineRegisterInfo(this);
|
||||
else
|
||||
RegInfo = nullptr;
|
||||
|
||||
|
@ -23,8 +23,8 @@ using namespace llvm;
|
||||
// Pin the vtable to this file.
|
||||
void MachineRegisterInfo::Delegate::anchor() {}
|
||||
|
||||
MachineRegisterInfo::MachineRegisterInfo(const TargetMachine &TM)
|
||||
: TM(TM), TheDelegate(nullptr), IsSSA(true), TracksLiveness(true) {
|
||||
MachineRegisterInfo::MachineRegisterInfo(const MachineFunction *MF)
|
||||
: MF(MF), TheDelegate(nullptr), IsSSA(true), TracksLiveness(true) {
|
||||
VRegInfo.reserve(256);
|
||||
RegAllocHints.reserve(256);
|
||||
UsedRegUnits.resize(getTargetRegisterInfo()->getNumRegUnits());
|
||||
|
Loading…
x
Reference in New Issue
Block a user