/// 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
//===- 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;
}
}
}
}
-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
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.
II != IE; ++II)
FilterList.push_back(cast<GlobalValue>((*II)->stripPointerCasts()));
- MMI.addFilterTypeInfo(MBB, FilterList);
+ MMI.addFilterTypeInfo(&MBB, FilterList);
}
}
}
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.
}
MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
- ComputeUsesVAFloatArgument(I, &MMI);
+ computeUsesVAFloatArgument(I, MMI);
const char *RenameFn = nullptr;
if (Function *F = I.getCalledFunction()) {