mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Tidy up a few more uses of MF.getFunction()->getName().
Based on CR feedback from r162301 and Craig Topper's refactoring in r162347 here are a few other places that could use the same API (& in one instance drop a Function.h dependency). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -41,8 +41,7 @@ void CalculateSpillWeights::getAnalysisUsage(AnalysisUsage &au) const {
|
|||||||
bool CalculateSpillWeights::runOnMachineFunction(MachineFunction &MF) {
|
bool CalculateSpillWeights::runOnMachineFunction(MachineFunction &MF) {
|
||||||
|
|
||||||
DEBUG(dbgs() << "********** Compute Spill Weights **********\n"
|
DEBUG(dbgs() << "********** Compute Spill Weights **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF.getName() << '\n');
|
||||||
<< MF.getName() << '\n');
|
|
||||||
|
|
||||||
LiveIntervals &LIS = getAnalysis<LiveIntervals>();
|
LiveIntervals &LIS = getAnalysis<LiveIntervals>();
|
||||||
MachineRegisterInfo &MRI = MF.getRegInfo();
|
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#define DEBUG_TYPE "early-ifcvt"
|
#define DEBUG_TYPE "early-ifcvt"
|
||||||
#include "MachineTraceMetrics.h"
|
#include "MachineTraceMetrics.h"
|
||||||
#include "llvm/Function.h"
|
|
||||||
#include "llvm/ADT/BitVector.h"
|
#include "llvm/ADT/BitVector.h"
|
||||||
#include "llvm/ADT/PostOrderIterator.h"
|
#include "llvm/ADT/PostOrderIterator.h"
|
||||||
#include "llvm/ADT/SetVector.h"
|
#include "llvm/ADT/SetVector.h"
|
||||||
@@ -775,8 +774,7 @@ bool EarlyIfConverter::tryConvertIf(MachineBasicBlock *MBB) {
|
|||||||
|
|
||||||
bool EarlyIfConverter::runOnMachineFunction(MachineFunction &MF) {
|
bool EarlyIfConverter::runOnMachineFunction(MachineFunction &MF) {
|
||||||
DEBUG(dbgs() << "********** EARLY IF-CONVERSION **********\n"
|
DEBUG(dbgs() << "********** EARLY IF-CONVERSION **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF.getName() << '\n');
|
||||||
<< ((Value*)MF.getFunction())->getName() << '\n');
|
|
||||||
TII = MF.getTarget().getInstrInfo();
|
TII = MF.getTarget().getInstrInfo();
|
||||||
TRI = MF.getTarget().getRegisterInfo();
|
TRI = MF.getTarget().getRegisterInfo();
|
||||||
SchedModel = MF.getTarget().getInstrItineraryData()->SchedModel;
|
SchedModel = MF.getTarget().getInstrItineraryData()->SchedModel;
|
||||||
|
@@ -189,8 +189,7 @@ bool ExpandPostRA::LowerCopy(MachineInstr *MI) {
|
|||||||
bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
|
bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
|
||||||
DEBUG(dbgs() << "Machine Function\n"
|
DEBUG(dbgs() << "Machine Function\n"
|
||||||
<< "********** EXPANDING POST-RA PSEUDO INSTRS **********\n"
|
<< "********** EXPANDING POST-RA PSEUDO INSTRS **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF.getName() << '\n');
|
||||||
<< MF.getName() << '\n');
|
|
||||||
TRI = MF.getTarget().getRegisterInfo();
|
TRI = MF.getTarget().getRegisterInfo();
|
||||||
TII = MF.getTarget().getInstrInfo();
|
TII = MF.getTarget().getInstrInfo();
|
||||||
|
|
||||||
|
@@ -687,8 +687,7 @@ bool LDVImpl::runOnMachineFunction(MachineFunction &mf) {
|
|||||||
clear();
|
clear();
|
||||||
LS.initialize(mf);
|
LS.initialize(mf);
|
||||||
DEBUG(dbgs() << "********** COMPUTING LIVE DEBUG VARIABLES: "
|
DEBUG(dbgs() << "********** COMPUTING LIVE DEBUG VARIABLES: "
|
||||||
<< ((Value*)mf.getFunction())->getName()
|
<< mf.getName() << " **********\n");
|
||||||
<< " **********\n");
|
|
||||||
|
|
||||||
bool Changed = collectDebugValues(mf);
|
bool Changed = collectDebugValues(mf);
|
||||||
computeIntervals();
|
computeIntervals();
|
||||||
|
@@ -382,8 +382,7 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock *MBB,
|
|||||||
/// which a variable is live
|
/// which a variable is live
|
||||||
void LiveIntervals::computeIntervals() {
|
void LiveIntervals::computeIntervals() {
|
||||||
DEBUG(dbgs() << "********** COMPUTING LIVE INTERVALS **********\n"
|
DEBUG(dbgs() << "********** COMPUTING LIVE INTERVALS **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF->getName() << '\n');
|
||||||
<< ((Value*)MF->getFunction())->getName() << '\n');
|
|
||||||
|
|
||||||
RegMaskBlocks.resize(MF->getNumBlockIDs());
|
RegMaskBlocks.resize(MF->getNumBlockIDs());
|
||||||
|
|
||||||
|
@@ -294,7 +294,7 @@ StringRef MachineFunction::getName() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
|
void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
|
||||||
OS << "# Machine code for function " << Fn->getName() << ": ";
|
OS << "# Machine code for function " << getName() << ": ";
|
||||||
if (RegInfo) {
|
if (RegInfo) {
|
||||||
OS << (RegInfo->isSSA() ? "SSA" : "Post SSA");
|
OS << (RegInfo->isSSA() ? "SSA" : "Post SSA");
|
||||||
if (!RegInfo->tracksLiveness())
|
if (!RegInfo->tracksLiveness())
|
||||||
@@ -339,7 +339,7 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
|
|||||||
BB->print(OS, Indexes);
|
BB->print(OS, Indexes);
|
||||||
}
|
}
|
||||||
|
|
||||||
OS << "\n# End machine code for function " << Fn->getName() << ".\n\n";
|
OS << "\n# End machine code for function " << getName() << ".\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@@ -382,7 +382,7 @@ namespace llvm {
|
|||||||
void MachineFunction::viewCFG() const
|
void MachineFunction::viewCFG() const
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
ViewGraph(this, "mf" + getFunction()->getName());
|
ViewGraph(this, "mf" + getName());
|
||||||
#else
|
#else
|
||||||
errs() << "MachineFunction::viewCFG is only available in debug builds on "
|
errs() << "MachineFunction::viewCFG is only available in debug builds on "
|
||||||
<< "systems with Graphviz or gv!\n";
|
<< "systems with Graphviz or gv!\n";
|
||||||
@@ -392,7 +392,7 @@ void MachineFunction::viewCFG() const
|
|||||||
void MachineFunction::viewCFGOnly() const
|
void MachineFunction::viewCFGOnly() const
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
ViewGraph(this, "mf" + getFunction()->getName(), true);
|
ViewGraph(this, "mf" + getName(), true);
|
||||||
#else
|
#else
|
||||||
errs() << "MachineFunction::viewCFGOnly is only available in debug builds on "
|
errs() << "MachineFunction::viewCFGOnly is only available in debug builds on "
|
||||||
<< "systems with Graphviz or gv!\n";
|
<< "systems with Graphviz or gv!\n";
|
||||||
|
@@ -137,8 +137,7 @@ void ProcessImplicitDefs::processImplicitDef(MachineInstr *MI) {
|
|||||||
bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &MF) {
|
bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &MF) {
|
||||||
|
|
||||||
DEBUG(dbgs() << "********** PROCESS IMPLICIT DEFS **********\n"
|
DEBUG(dbgs() << "********** PROCESS IMPLICIT DEFS **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF.getName() << '\n');
|
||||||
<< ((Value*)MF.getFunction())->getName() << '\n');
|
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
#include "VirtRegMap.h"
|
#include "VirtRegMap.h"
|
||||||
#include "LiveRegMatrix.h"
|
#include "LiveRegMatrix.h"
|
||||||
#include "llvm/Analysis/AliasAnalysis.h"
|
#include "llvm/Analysis/AliasAnalysis.h"
|
||||||
#include "llvm/Function.h"
|
|
||||||
#include "llvm/PassAnalysisSupport.h"
|
#include "llvm/PassAnalysisSupport.h"
|
||||||
#include "llvm/CodeGen/CalcSpillWeights.h"
|
#include "llvm/CodeGen/CalcSpillWeights.h"
|
||||||
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
|
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
|
||||||
@@ -273,7 +272,7 @@ unsigned RABasic::selectOrSplit(LiveInterval &VirtReg,
|
|||||||
bool RABasic::runOnMachineFunction(MachineFunction &mf) {
|
bool RABasic::runOnMachineFunction(MachineFunction &mf) {
|
||||||
DEBUG(dbgs() << "********** BASIC REGISTER ALLOCATION **********\n"
|
DEBUG(dbgs() << "********** BASIC REGISTER ALLOCATION **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: "
|
||||||
<< ((Value*)mf.getFunction())->getName() << '\n');
|
<< mf.getName() << '\n');
|
||||||
|
|
||||||
MF = &mf;
|
MF = &mf;
|
||||||
RegAllocBase::init(getAnalysis<VirtRegMap>(),
|
RegAllocBase::init(getAnalysis<VirtRegMap>(),
|
||||||
|
@@ -1110,8 +1110,7 @@ void RAFast::AllocateBasicBlock() {
|
|||||||
///
|
///
|
||||||
bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
|
bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
|
||||||
DEBUG(dbgs() << "********** FAST REGISTER ALLOCATION **********\n"
|
DEBUG(dbgs() << "********** FAST REGISTER ALLOCATION **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << Fn.getName() << '\n');
|
||||||
<< ((Value*)Fn.getFunction())->getName() << '\n');
|
|
||||||
MF = &Fn;
|
MF = &Fn;
|
||||||
MRI = &MF->getRegInfo();
|
MRI = &MF->getRegInfo();
|
||||||
TM = &Fn.getTarget();
|
TM = &Fn.getTarget();
|
||||||
|
@@ -1745,8 +1745,7 @@ unsigned RAGreedy::selectOrSplit(LiveInterval &VirtReg,
|
|||||||
|
|
||||||
bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
|
bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
|
||||||
DEBUG(dbgs() << "********** GREEDY REGISTER ALLOCATION **********\n"
|
DEBUG(dbgs() << "********** GREEDY REGISTER ALLOCATION **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << mf.getName() << '\n');
|
||||||
<< mf.getName() << '\n');
|
|
||||||
|
|
||||||
MF = &mf;
|
MF = &mf;
|
||||||
if (VerifyEnabled)
|
if (VerifyEnabled)
|
||||||
|
@@ -1564,8 +1564,7 @@ bool RegisterCoalescer::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
Loops = &getAnalysis<MachineLoopInfo>();
|
Loops = &getAnalysis<MachineLoopInfo>();
|
||||||
|
|
||||||
DEBUG(dbgs() << "********** SIMPLE REGISTER COALESCING **********\n"
|
DEBUG(dbgs() << "********** SIMPLE REGISTER COALESCING **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF->getName() << '\n');
|
||||||
<< MF->getName() << '\n');
|
|
||||||
|
|
||||||
if (VerifyCoalescing)
|
if (VerifyCoalescing)
|
||||||
MF->verify(this, "Before register coalescing");
|
MF->verify(this, "Before register coalescing");
|
||||||
|
@@ -390,8 +390,7 @@ bool StackSlotColoring::RemoveDeadStores(MachineBasicBlock* MBB) {
|
|||||||
bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
|
bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
|
||||||
DEBUG({
|
DEBUG({
|
||||||
dbgs() << "********** Stack Slot Coloring **********\n"
|
dbgs() << "********** Stack Slot Coloring **********\n"
|
||||||
<< "********** Function: "
|
<< "********** Function: " << MF.getName() << '\n';
|
||||||
<< MF.getName() << '\n';
|
|
||||||
});
|
});
|
||||||
|
|
||||||
MFI = MF.getFrameInfo();
|
MFI = MF.getFrameInfo();
|
||||||
|
Reference in New Issue
Block a user