X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FInstruction.cpp;h=57c143cca2c318863ec7cf23d858d0d6427436b5;hb=bd75a9292e761dcab32855e322d9985d7d787d1e;hp=92c6e9f3dede0f475270dc8a0dbe418b9732b8c3;hpb=ada5f24b5fd5fd1c9be505ffca21035b54b8d538;p=oota-llvm.git diff --git a/lib/IR/Instruction.cpp b/lib/IR/Instruction.cpp index 92c6e9f3ded..57c143cca2c 100644 --- a/lib/IR/Instruction.cpp +++ b/lib/IR/Instruction.cpp @@ -32,10 +32,6 @@ Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps, } } -const DataLayout *Instruction::getDataLayout() const { - return getParent()->getDataLayout(); -} - Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(nullptr) { @@ -58,12 +54,16 @@ void Instruction::setParent(BasicBlock *P) { Parent = P; } +const Module *Instruction::getModule() const { + return getParent()->getModule(); +} + void Instruction::removeFromParent() { getParent()->getInstList().remove(this); } -void Instruction::eraseFromParent() { - getParent()->getInstList().erase(this); +iplist::iterator Instruction::eraseFromParent() { + return getParent()->getInstList().erase(this); } /// insertBefore - Insert an unlinked instructions into a basic block