mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 20:30:50 +00:00
Add sanity checks
llvm-svn: 5020
This commit is contained in:
parent
de680081ab
commit
7d5d4f7ab4
@ -35,6 +35,7 @@ inline static MachineInstrBuilder BMI(MachineBasicBlock *MBB,
|
||||
MachineOpCode Opcode,
|
||||
unsigned NumOperands,
|
||||
unsigned DestReg) {
|
||||
assert(I >= MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true);
|
||||
I = ++MBB->insert(I, MI);
|
||||
return MachineInstrBuilder(MI).addReg(DestReg, MOTy::Def);
|
||||
@ -46,6 +47,7 @@ inline static MachineInstrBuilder BMI(MachineBasicBlock *MBB,
|
||||
MachineBasicBlock::iterator &I,
|
||||
MachineOpCode Opcode,
|
||||
unsigned NumOperands) {
|
||||
assert(I > MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true);
|
||||
I = ++MBB->insert(I, MI);
|
||||
return MachineInstrBuilder(MI);
|
||||
|
Loading…
Reference in New Issue
Block a user