[llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h
Chris Lattner
lattner at cs.uiuc.edu
Thu Oct 23 14:34:01 PDT 2003
Changes in directory llvm/include/llvm/Support:
CallSite.h updated: 1.7 -> 1.8
---
Log message:
Add assertions
---
Diffs of the changes: (+6 -1)
Index: llvm/include/llvm/Support/CallSite.h
diff -u llvm/include/llvm/Support/CallSite.h:1.7 llvm/include/llvm/Support/CallSite.h:1.8
--- llvm/include/llvm/Support/CallSite.h:1.7 Mon Oct 20 15:19:26 2003
+++ llvm/include/llvm/Support/CallSite.h Thu Oct 23 14:33:49 2003
@@ -50,7 +50,10 @@
/// 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 @@
/// 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 @@
/// 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
More information about the llvm-commits
mailing list