getParent()->getInstList().erase(this);
}
+/// insertBefore - Insert an unlinked instructions into a basic block
+/// immediately before the specified instruction.
+void Instruction::insertBefore(Instruction *InsertPos) {
+ InsertPos->getParent()->getInstList().insert(InsertPos, this);
+}
+
/// moveBefore - Unlink this instruction from its current basic block and
/// insert it into the basic block that MovePos lives in, right before
/// MovePos.
// Other instructions...
case ICmp: return "icmp";
case FCmp: return "fcmp";
+ case VICmp: return "vicmp";
+ case VFCmp: return "vfcmp";
case PHI: return "phi";
case Select: return "select";
case Call: return "call";
case InsertElement: return "insertelement";
case ShuffleVector: return "shufflevector";
case GetResult: return "getresult";
+ case ExtractValue: return "extractvalue";
+ case InsertValue: return "insertvalue";
default: return "<Invalid operator> ";
}
switch (getOpcode()) {
default: return false;
case Instruction::Free:
- case Instruction::Store:
case Instruction::VAArg:
+ case Instruction::Load:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->doesNotAccessMemory();
case Instruction::Invoke:
return !cast<InvokeInst>(this)->doesNotAccessMemory();
- case Instruction::Load:
- return true;
+ case Instruction::Store:
+ return cast<StoreInst>(this)->isVolatile();
}
}