mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
|
||||
@@ -54,7 +55,8 @@ MCSymbol *MachineBasicBlock::getSymbol() const {
|
||||
const MachineFunction *MF = getParent();
|
||||
MCContext &Ctx = MF->getContext();
|
||||
const TargetMachine &TM = MF->getTarget();
|
||||
const char *Prefix = TM.getDataLayout()->getPrivateGlobalPrefix();
|
||||
const char *Prefix =
|
||||
TM.getSubtargetImpl()->getDataLayout()->getPrivateGlobalPrefix();
|
||||
CachedMCSymbol = Ctx.GetOrCreateSymbol(Twine(Prefix) + "BB" +
|
||||
Twine(MF->getFunctionNumber()) +
|
||||
"_" + Twine(getNumber()));
|
||||
@@ -290,7 +292,8 @@ void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const {
|
||||
|
||||
OS << '\n';
|
||||
|
||||
const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
|
||||
const TargetRegisterInfo *TRI =
|
||||
MF->getTarget().getSubtargetImpl()->getRegisterInfo();
|
||||
if (!livein_empty()) {
|
||||
if (Indexes) OS << '\t';
|
||||
OS << " Live Ins:";
|
||||
@@ -359,7 +362,8 @@ MachineBasicBlock::addLiveIn(unsigned PhysReg, const TargetRegisterClass *RC) {
|
||||
bool LiveIn = isLiveIn(PhysReg);
|
||||
iterator I = SkipPHIsAndLabels(begin()), E = end();
|
||||
MachineRegisterInfo &MRI = getParent()->getRegInfo();
|
||||
const TargetInstrInfo &TII = *getParent()->getTarget().getInstrInfo();
|
||||
const TargetInstrInfo &TII =
|
||||
*getParent()->getTarget().getSubtargetImpl()->getInstrInfo();
|
||||
|
||||
// Look for an existing copy.
|
||||
if (LiveIn)
|
||||
@@ -390,7 +394,8 @@ void MachineBasicBlock::moveAfter(MachineBasicBlock *NewBefore) {
|
||||
}
|
||||
|
||||
void MachineBasicBlock::updateTerminator() {
|
||||
const TargetInstrInfo *TII = getParent()->getTarget().getInstrInfo();
|
||||
const TargetInstrInfo *TII =
|
||||
getParent()->getTarget().getSubtargetImpl()->getInstrInfo();
|
||||
// A block with no successors has no concerns with fall-through edges.
|
||||
if (this->succ_empty()) return;
|
||||
|
||||
@@ -645,7 +650,8 @@ bool MachineBasicBlock::canFallThrough() {
|
||||
// Analyze the branches, if any, at the end of the block.
|
||||
MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
|
||||
SmallVector<MachineOperand, 4> Cond;
|
||||
const TargetInstrInfo *TII = getParent()->getTarget().getInstrInfo();
|
||||
const TargetInstrInfo *TII =
|
||||
getParent()->getTarget().getSubtargetImpl()->getInstrInfo();
|
||||
if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) {
|
||||
// If we couldn't analyze the branch, examine the last instruction.
|
||||
// If the block doesn't end in a known control barrier, assume fallthrough
|
||||
@@ -690,7 +696,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
||||
|
||||
// We may need to update this's terminator, but we can't do that if
|
||||
// AnalyzeBranch fails. If this uses a jump table, we won't touch it.
|
||||
const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
|
||||
const TargetInstrInfo *TII =
|
||||
MF->getTarget().getSubtargetImpl()->getInstrInfo();
|
||||
MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
|
||||
SmallVector<MachineOperand, 4> Cond;
|
||||
if (TII->AnalyzeBranch(*this, TBB, FBB, Cond))
|
||||
@@ -795,7 +802,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
||||
NMBB->addSuccessor(Succ);
|
||||
if (!NMBB->isLayoutSuccessor(Succ)) {
|
||||
Cond.clear();
|
||||
MF->getTarget().getInstrInfo()->InsertBranch(*NMBB, Succ, nullptr, Cond, dl);
|
||||
MF->getTarget().getSubtargetImpl()->getInstrInfo()->InsertBranch(
|
||||
*NMBB, Succ, nullptr, Cond, dl);
|
||||
|
||||
if (Indexes) {
|
||||
for (instr_iterator I = NMBB->instr_begin(), E = NMBB->instr_end();
|
||||
@@ -823,7 +831,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
||||
NMBB->addLiveIn(*I);
|
||||
|
||||
// Update LiveVariables.
|
||||
const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
|
||||
const TargetRegisterInfo *TRI =
|
||||
MF->getTarget().getSubtargetImpl()->getRegisterInfo();
|
||||
if (LV) {
|
||||
// Restore kills of virtual registers that were killed by the terminators.
|
||||
while (!KilledRegs.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user