/// Note: this is undefined behavior if the instruction does not have a
/// parent, or the parent basic block does not have a parent function.
const Module *getModule() const;
/// Note: this is undefined behavior if the instruction does not have a
/// parent, or the parent basic block does not have a parent function.
const Module *getModule() const;
/// removeFromParent - This method unlinks 'this' from the containing basic
/// block, but does not delete it.
/// removeFromParent - This method unlinks 'this' from the containing basic
/// block, but does not delete it.
/// \returns an iterator pointing to the element after the erased one
iplist<Instruction>::iterator eraseFromParent();
/// \returns an iterator pointing to the element after the erased one
iplist<Instruction>::iterator eraseFromParent();
- /// insertBefore - Insert an unlinked instructions into a basic block
- /// immediately before the specified instruction.
+ /// Insert an unlinked instruction into a basic block immediately before
+ /// the specified instruction.
- /// insertAfter - Insert an unlinked instructions into a basic block
- /// immediately after the specified instruction.
+ /// Insert an unlinked instruction into a basic block immediately after the
+ /// specified instruction.
void insertAfter(Instruction *InsertPos);
/// moveBefore - Unlink this instruction from its current basic block and
void insertAfter(Instruction *InsertPos);
/// moveBefore - Unlink this instruction from its current basic block and
///
/// Note that this does not consider malloc and alloca to have side
/// effects because the newly allocated memory is completely invisible to
///
/// Note that this does not consider malloc and alloca to have side
/// effects because the newly allocated memory is completely invisible to
/// matters, isSafeToSpeculativelyExecute may be more appropriate.
bool mayHaveSideEffects() const {
return mayWriteToMemory() || mayThrow() || !mayReturn();
/// matters, isSafeToSpeculativelyExecute may be more appropriate.
bool mayHaveSideEffects() const {
return mayWriteToMemory() || mayThrow() || !mayReturn();
Instruction *InsertBefore = nullptr);
Instruction(Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd);
Instruction *InsertBefore = nullptr);
Instruction(Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd);