diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Instructions.h | 13 | ||||
-rw-r--r-- | include/llvm/Support/CallSite.h | 16 |
2 files changed, 12 insertions, 17 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index af93a29..e279b34 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -964,10 +964,9 @@ public: # undef protected public: - enum { ArgOffset = 0 }; ///< temporary, do not use for new code! unsigned getNumArgOperands() const { return getNumOperands() - 1; } - Value *getArgOperand(unsigned i) const { return getOperand(i + ArgOffset); } - void setArgOperand(unsigned i, Value *v) { setOperand(i + ArgOffset, v); } + Value *getArgOperand(unsigned i) const { return getOperand(i); } + void setArgOperand(unsigned i, Value *v) { setOperand(i, v); } /// getCallingConv/setCallingConv - Get or set the calling convention of this /// function call. @@ -1056,17 +1055,17 @@ public: /// indirect function invocation. /// Function *getCalledFunction() const { - return dyn_cast<Function>(Op<ArgOffset -1>()); + return dyn_cast<Function>(Op<-1>()); } /// getCalledValue - Get a pointer to the function that is invoked by this /// instruction. - const Value *getCalledValue() const { return Op<ArgOffset -1>(); } - Value *getCalledValue() { return Op<ArgOffset -1>(); } + const Value *getCalledValue() const { return Op<-1>(); } + Value *getCalledValue() { return Op<-1>(); } /// setCalledFunction - Set the function called. void setCalledFunction(Value* Fn) { - Op<ArgOffset -1>() = Fn; + Op<-1>() = Fn; } // Methods for support type inquiry through isa, cast, and dyn_cast: diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 38ee08b..cce000d 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -254,18 +254,16 @@ public: private: /// Returns the operand number of the first argument + /// FIXME: remove this func! unsigned getArgumentOffset() const { - if (isCall()) - return CallInst::ArgOffset; // Skip Function (ATM) - else - return 0; // Args are at the front + return 0; // Args are at the front } unsigned getArgumentEndOffset() const { if (isCall()) - return CallInst::ArgOffset ? 0 : 1; // Unchanged (ATM) + return 1; // Skip Callee else - return 3; // Skip BB, BB, Function + return 3; // Skip BB, BB, Callee } IterTy getCallee() const { @@ -273,11 +271,9 @@ private: // of the op_*() functions here. See CallSite::getCallee. // if (isCall()) - return CallInst::ArgOffset - ? getInstruction()->op_begin() // Unchanged - : getInstruction()->op_end() - 1; // Skip Function + return getInstruction()->op_end() - 1; // Skip Callee else - return getInstruction()->op_end() - 3; // Skip BB, BB, Function + return getInstruction()->op_end() - 3; // Skip BB, BB, Callee } }; |