mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Add sanity checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0868667f78
commit
d7d3872fb0
@ -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);
|
||||
|
@ -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