| OLD | NEW |
| 1 //===-- CodeGen/MachineInstBuilder.h - Simplify creation of MIs -*- C++ -*-===// | 1 //===-- CodeGen/MachineInstBuilder.h - Simplify creation of MIs -*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file exposes a function named BuildMI, which is useful for dramatically | 10 // This file exposes a function named BuildMI, which is useful for dramatically |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 const MCInstrDesc &MCID) { | 318 const MCInstrDesc &MCID) { |
| 319 if (I->isInsideBundle()) { | 319 if (I->isInsideBundle()) { |
| 320 MachineBasicBlock::instr_iterator MII = I; | 320 MachineBasicBlock::instr_iterator MII = I; |
| 321 return BuildMI(BB, MII, DL, MCID); | 321 return BuildMI(BB, MII, DL, MCID); |
| 322 } | 322 } |
| 323 | 323 |
| 324 MachineBasicBlock::iterator MII = I; | 324 MachineBasicBlock::iterator MII = I; |
| 325 return BuildMI(BB, MII, DL, MCID); | 325 return BuildMI(BB, MII, DL, MCID); |
| 326 } | 326 } |
| 327 | 327 |
| 328 // @LOCALMOD-BEGIN |
| 329 /// BuildMI - This version of the builder inserts the newly-built |
| 330 /// instruction before the given position in the given MachineBasicBlock, |
| 331 /// does NOT take a destination register, and does not add implicit operands. |
| 332 /// |
| 333 inline MachineInstrBuilder BuildMI_NoImp(MachineBasicBlock &BB, |
| 334 MachineBasicBlock::iterator I, |
| 335 DebugLoc DL, |
| 336 const MCInstrDesc &MCID) { |
| 337 MachineInstr *MI = BB.getParent()->CreateMachineInstr(MCID, DL, true); |
| 338 BB.insert(I, MI); |
| 339 return MachineInstrBuilder(*BB.getParent(), MI); |
| 340 } |
| 341 // @LOCALMOD-END |
| 342 |
| 328 /// BuildMI - This version of the builder inserts the newly-built | 343 /// BuildMI - This version of the builder inserts the newly-built |
| 329 /// instruction at the end of the given MachineBasicBlock, and does NOT take a | 344 /// instruction at the end of the given MachineBasicBlock, and does NOT take a |
| 330 /// destination register. | 345 /// destination register. |
| 331 /// | 346 /// |
| 332 inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, | 347 inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB, |
| 333 DebugLoc DL, | 348 DebugLoc DL, |
| 334 const MCInstrDesc &MCID) { | 349 const MCInstrDesc &MCID) { |
| 335 return BuildMI(*BB, BB->end(), DL, MCID); | 350 return BuildMI(*BB, BB->end(), DL, MCID); |
| 336 } | 351 } |
| 337 | 352 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 /// Insert MI into MBB by appending it to the instructions in the bundle. | 510 /// Insert MI into MBB by appending it to the instructions in the bundle. |
| 496 /// MI will become the last instruction in the bundle. | 511 /// MI will become the last instruction in the bundle. |
| 497 MIBundleBuilder &append(MachineInstr *MI) { | 512 MIBundleBuilder &append(MachineInstr *MI) { |
| 498 return insert(end(), MI); | 513 return insert(end(), MI); |
| 499 } | 514 } |
| 500 }; | 515 }; |
| 501 | 516 |
| 502 } // End llvm namespace | 517 } // End llvm namespace |
| 503 | 518 |
| 504 #endif | 519 #endif |
| OLD | NEW |