diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-11-16 22:25:03 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-11-16 22:25:03 +0000 |
commit | bd6ce9a2471756c29ae7a8e6c9d2377bdfd8c778 (patch) | |
tree | f777b7a6ee9bd8c48a5f08cde8a98463504f7b13 /llvm/lib/CodeGen | |
parent | 996961a4615e2ffaadc43a72e2c357f3352d2ae4 (diff) | |
download | bcm5719-llvm-bd6ce9a2471756c29ae7a8e6c9d2377bdfd8c778.tar.gz bcm5719-llvm-bd6ce9a2471756c29ae7a8e6c9d2377bdfd8c778.zip |
[CodeGen] Pass references, not pointers, to MMI helpers. NFC.
While there, rename them to follow the coding style.
llvm-svn: 287169
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 18 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 053583a1565..3d686d15fda 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -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(); diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 8efa07a3aa7..131ef44e2ef 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -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); } } } diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 452bb059494..cf5803b3587 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -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)) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index b588d9b193f..4bb3cd2055e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -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()) { |