Add assertions

llvm-svn: 9443
This commit is contained in:
Chris Lattner 2003-10-23 19:33:49 +00:00
parent 7eb71b4bd8
commit 97b5b1fd58
1 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,10 @@ public:
/// getCalledValue - Return the pointer to function that is being called...
///
Value *getCalledValue() const { return I->getOperand(0); }
Value *getCalledValue() const {
assert(I && "Not a call or invoke instruction!");
return I->getOperand(0);
}
/// getCalledFunction - Return the function being called if this is a direct
/// call, otherwise return null (if it's an indirect call).
@ -62,6 +65,7 @@ public:
/// setCalledFunction - Set the callee to the specified value...
///
void setCalledFunction(Value *V) {
assert(I && "Not a call or invoke instruction!");
I->setOperand(0, V);
}
@ -73,6 +77,7 @@ public:
/// list for a call site.
///
arg_iterator arg_begin() const {
assert(I && "Not a call or invoke instruction!");
if (I->getOpcode() == Instruction::Call)
return I->op_begin()+1; // Skip Function
else