mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-23 11:49:50 +00:00
[CodeGen] Pass references, not pointers, to MMI helpers. NFC.
While there, rename them to follow the coding style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287169 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
75fc88218c
commit
03cebfbba9
@ -429,12 +429,12 @@ public:
|
||||
/// function, and set the MachineModuleInfo's usesVAFloatArgument flag if so.
|
||||
/// This flag is used to emit an undefined reference to _fltused on Windows,
|
||||
/// which will link in MSVCRT's floating-point support.
|
||||
void ComputeUsesVAFloatArgument(const CallInst &I, MachineModuleInfo *MMI);
|
||||
void computeUsesVAFloatArgument(const CallInst &I, MachineModuleInfo &MMI);
|
||||
|
||||
/// Extract the exception handling information from the landingpad instruction
|
||||
/// and add them to the specified machine module info.
|
||||
void AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
MachineBasicBlock *MBB);
|
||||
void addLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
MachineBasicBlock &MBB);
|
||||
|
||||
|
||||
} // End llvm namespace
|
||||
|
@ -597,7 +597,7 @@ bool IRTranslator::translateLandingPad(const User &U) {
|
||||
MachineBasicBlock &MBB = MIRBuilder.getMBB();
|
||||
MachineFunction &MF = MIRBuilder.getMF();
|
||||
MachineModuleInfo &MMI = MF.getMMI();
|
||||
AddLandingPadInfo(LP, MMI, &MBB);
|
||||
addLandingPadInfo(LP, MMI, MBB);
|
||||
|
||||
MBB.setIsEHPad();
|
||||
|
||||
|
@ -490,16 +490,16 @@ FunctionPass *createFreeMachineFunctionPass() {
|
||||
|
||||
//===- MMI building helpers -----------------------------------------------===//
|
||||
|
||||
void llvm::ComputeUsesVAFloatArgument(const CallInst &I,
|
||||
MachineModuleInfo *MMI) {
|
||||
void llvm::computeUsesVAFloatArgument(const CallInst &I,
|
||||
MachineModuleInfo &MMI) {
|
||||
FunctionType *FT =
|
||||
cast<FunctionType>(I.getCalledValue()->getType()->getContainedType(0));
|
||||
if (FT->isVarArg() && !MMI->usesVAFloatArgument()) {
|
||||
if (FT->isVarArg() && !MMI.usesVAFloatArgument()) {
|
||||
for (unsigned i = 0, e = I.getNumArgOperands(); i != e; ++i) {
|
||||
Type *T = I.getArgOperand(i)->getType();
|
||||
for (auto i : post_order(T)) {
|
||||
if (i->isFloatingPointTy()) {
|
||||
MMI->setUsesVAFloatArgument(true);
|
||||
MMI.setUsesVAFloatArgument(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -507,14 +507,14 @@ void llvm::ComputeUsesVAFloatArgument(const CallInst &I,
|
||||
}
|
||||
}
|
||||
|
||||
void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
MachineBasicBlock *MBB) {
|
||||
void llvm::addLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
MachineBasicBlock &MBB) {
|
||||
if (const auto *PF = dyn_cast<Function>(
|
||||
I.getParent()->getParent()->getPersonalityFn()->stripPointerCasts()))
|
||||
MMI.addPersonality(PF);
|
||||
|
||||
if (I.isCleanup())
|
||||
MMI.addCleanup(MBB);
|
||||
MMI.addCleanup(&MBB);
|
||||
|
||||
// FIXME: New EH - Add the clauses in reverse order. This isn't 100% correct,
|
||||
// but we need to do it this way because of how the DWARF EH emitter
|
||||
@ -522,7 +522,7 @@ void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
for (unsigned i = I.getNumClauses(); i != 0; --i) {
|
||||
Value *Val = I.getClause(i - 1);
|
||||
if (I.isCatch(i - 1)) {
|
||||
MMI.addCatchTypeInfo(MBB,
|
||||
MMI.addCatchTypeInfo(&MBB,
|
||||
dyn_cast<GlobalValue>(Val->stripPointerCasts()));
|
||||
} else {
|
||||
// Add filters in a list.
|
||||
@ -532,7 +532,7 @@ void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
|
||||
II != IE; ++II)
|
||||
FilterList.push_back(cast<GlobalValue>((*II)->stripPointerCasts()));
|
||||
|
||||
MMI.addFilterTypeInfo(MBB, FilterList);
|
||||
MMI.addFilterTypeInfo(&MBB, FilterList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1066,7 +1066,7 @@ bool FastISel::selectCall(const User *I) {
|
||||
}
|
||||
|
||||
MachineModuleInfo &MMI = FuncInfo.MF->getMMI();
|
||||
ComputeUsesVAFloatArgument(*Call, &MMI);
|
||||
computeUsesVAFloatArgument(*Call, MMI);
|
||||
|
||||
// Handle intrinsic function calls.
|
||||
if (const auto *II = dyn_cast<IntrinsicInst>(Call))
|
||||
|
@ -2294,7 +2294,7 @@ void SelectionDAGBuilder::visitLandingPad(const LandingPadInst &LP) {
|
||||
|
||||
MachineBasicBlock *MBB = FuncInfo.MBB;
|
||||
MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
|
||||
AddLandingPadInfo(LP, MMI, MBB);
|
||||
addLandingPadInfo(LP, MMI, *MBB);
|
||||
|
||||
// If there aren't registers to copy the values into (e.g., during SjLj
|
||||
// exceptions), then don't bother to create these DAG nodes.
|
||||
@ -6289,7 +6289,7 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
|
||||
}
|
||||
|
||||
MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
|
||||
ComputeUsesVAFloatArgument(I, &MMI);
|
||||
computeUsesVAFloatArgument(I, MMI);
|
||||
|
||||
const char *RenameFn = nullptr;
|
||||
if (Function *F = I.getCalledFunction()) {
|
||||
|
Loading…
Reference in New Issue
Block a user