Skip to content

Commit

Permalink
[MachineIRBuilder] Rename the setter for MBB for consistency with the…
Browse files Browse the repository at this point in the history
… getter.

llvm-svn: 263261
Quentin Colombet committed Mar 11, 2016
1 parent 53237a9 commit 91ebd71
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ class MachineIRBuilder {
/// Set the insertion point to the beginning (\p Beginning = true) or end
/// (\p Beginning = false) of \p MBB.
/// \pre \p MBB must be contained by getMF().
void setBasicBlock(MachineBasicBlock &MBB, bool Beginning = false);
void setMBB(MachineBasicBlock &MBB, bool Beginning = false);

/// Set the insertion point to before (\p Before = true) or after
/// (\p Before = false) \p MI.
6 changes: 4 additions & 2 deletions llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {
MRI = &MF.getRegInfo();
// Setup the arguments.
MachineBasicBlock &MBB = getOrCreateBB(F.front());
MIRBuilder.setBasicBlock(MBB);
MIRBuilder.setMBB(MBB);
SmallVector<unsigned, 8> VRegArgs;
for (const Argument &Arg: F.args())
VRegArgs.push_back(getOrCreateVReg(&Arg));
@@ -123,7 +123,9 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {

for (const BasicBlock &BB: F) {
MachineBasicBlock &MBB = getOrCreateBB(BB);
MIRBuilder.setBasicBlock(MBB);
// Set the insertion point of all the following translations to
// the end of this basic block.
MIRBuilder.setMBB(MBB);
for (const Instruction &Inst: BB) {
bool Succeeded = translate(Inst);
if (!Succeeded) {
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ void MachineIRBuilder::setFunction(MachineFunction &MF) {
this->MI = nullptr;
}

void MachineIRBuilder::setBasicBlock(MachineBasicBlock &MBB, bool Beginning) {
void MachineIRBuilder::setMBB(MachineBasicBlock &MBB, bool Beginning) {
this->MBB = &MBB;
Before = Beginning;
assert(&getMF() == MBB.getParent() &&
@@ -37,7 +37,7 @@ void MachineIRBuilder::setBasicBlock(MachineBasicBlock &MBB, bool Beginning) {

void MachineIRBuilder::setInstr(MachineInstr &MI, bool Before) {
assert(MI.getParent() && "Instruction is not part of a basic block");
setBasicBlock(*MI.getParent());
setMBB(*MI.getParent());
this->MI = &MI;
this->Before = Before;
}

0 comments on commit 91ebd71

Please sign in to comment.