/// isIdenticalTo - Return true if the specified instruction is exactly
/// identical to the current one. This means that all operands match and any
/// extra information (e.g. load is volatile) agree.
-bool Instruction::isIdenticalTo(Instruction *I) const {
+bool Instruction::isIdenticalTo(const Instruction *I) const {
if (getOpcode() != I->getOpcode() ||
getNumOperands() != I->getNumOperands() ||
getType() != I->getType())
CI->getAttributes().getRawPointer() ==
cast<CallInst>(I)->getAttributes().getRawPointer();
if (const InvokeInst *CI = dyn_cast<InvokeInst>(this))
- return CI->getCallingConv() == cast<CallInst>(I)->getCallingConv() &&
+ return CI->getCallingConv() == cast<InvokeInst>(I)->getCallingConv() &&
CI->getAttributes().getRawPointer() ==
- cast<CallInst>(I)->getAttributes().getRawPointer();
+ cast<InvokeInst>(I)->getAttributes().getRawPointer();
if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(this)) {
if (IVI->getNumIndices() != cast<InsertValueInst>(I)->getNumIndices())
return false;
}
// isSameOperationAs
-bool Instruction::isSameOperationAs(Instruction *I) const {
+bool Instruction::isSameOperationAs(const Instruction *I) const {
if (getOpcode() != I->getOpcode() || getType() != I->getType() ||
getNumOperands() != I->getNumOperands())
return false;
CI->getAttributes().getRawPointer() ==
cast<CallInst>(I)->getAttributes().getRawPointer();
if (const InvokeInst *CI = dyn_cast<InvokeInst>(this))
- return CI->getCallingConv() == cast<CallInst>(I)->getCallingConv() &&
+ return CI->getCallingConv() == cast<InvokeInst>(I)->getCallingConv() &&
CI->getAttributes().getRawPointer() ==
- cast<CallInst>(I)->getAttributes().getRawPointer();
+ cast<InvokeInst>(I)->getAttributes().getRawPointer();
if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(this)) {
if (IVI->getNumIndices() != cast<InsertValueInst>(I)->getNumIndices())
return false;