From: Chris Lattner Date: Thu, 23 Oct 2003 19:33:49 +0000 (+0000) Subject: Add assertions X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c4098ee2bec04deb9f24d1fc2d8382266cacff4;p=oota-llvm.git Add assertions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9443 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index afd42246cd1..21d30f3ecbd 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -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