mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +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,
|
MachineOpCode Opcode,
|
||||||
unsigned NumOperands,
|
unsigned NumOperands,
|
||||||
unsigned DestReg) {
|
unsigned DestReg) {
|
||||||
|
assert(I >= MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true);
|
MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true);
|
||||||
I = ++MBB->insert(I, MI);
|
I = ++MBB->insert(I, MI);
|
||||||
return MachineInstrBuilder(MI).addReg(DestReg, MOTy::Def);
|
return MachineInstrBuilder(MI).addReg(DestReg, MOTy::Def);
|
||||||
@ -46,6 +47,7 @@ inline static MachineInstrBuilder BMI(MachineBasicBlock *MBB,
|
|||||||
MachineBasicBlock::iterator &I,
|
MachineBasicBlock::iterator &I,
|
||||||
MachineOpCode Opcode,
|
MachineOpCode Opcode,
|
||||||
unsigned NumOperands) {
|
unsigned NumOperands) {
|
||||||
|
assert(I > MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true);
|
MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true);
|
||||||
I = ++MBB->insert(I, MI);
|
I = ++MBB->insert(I, MI);
|
||||||
return MachineInstrBuilder(MI);
|
return MachineInstrBuilder(MI);
|
||||||
|
@ -35,6 +35,7 @@ inline static MachineInstrBuilder BMI(MachineBasicBlock *MBB,
|
|||||||
MachineOpCode Opcode,
|
MachineOpCode Opcode,
|
||||||
unsigned NumOperands,
|
unsigned NumOperands,
|
||||||
unsigned DestReg) {
|
unsigned DestReg) {
|
||||||
|
assert(I >= MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true);
|
MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1, true, true);
|
||||||
I = ++MBB->insert(I, MI);
|
I = ++MBB->insert(I, MI);
|
||||||
return MachineInstrBuilder(MI).addReg(DestReg, MOTy::Def);
|
return MachineInstrBuilder(MI).addReg(DestReg, MOTy::Def);
|
||||||
@ -46,6 +47,7 @@ inline static MachineInstrBuilder BMI(MachineBasicBlock *MBB,
|
|||||||
MachineBasicBlock::iterator &I,
|
MachineBasicBlock::iterator &I,
|
||||||
MachineOpCode Opcode,
|
MachineOpCode Opcode,
|
||||||
unsigned NumOperands) {
|
unsigned NumOperands) {
|
||||||
|
assert(I > MBB->begin() && I <= MBB->end() && "Bad iterator!");
|
||||||
MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true);
|
MachineInstr *MI = new MachineInstr(Opcode, NumOperands, true, true);
|
||||||
I = ++MBB->insert(I, MI);
|
I = ++MBB->insert(I, MI);
|
||||||
return MachineInstrBuilder(MI);
|
return MachineInstrBuilder(MI);
|
||||||
|
Loading…
Reference in New Issue
Block a user