Index: include/llvm/IR/CallSite.h =================================================================== --- include/llvm/IR/CallSite.h +++ include/llvm/IR/CallSite.h @@ -243,11 +243,11 @@ IterTy data_operands_begin() const { assert(getInstruction() && "Not a call or invoke instruction!"); - return (*this)->op_begin(); + return cast(getInstruction())->data_operands_begin(); } IterTy data_operands_end() const { assert(getInstruction() && "Not a call or invoke instruction!"); - return (*this)->op_end() - (isCall() ? 1 : 3); + return cast(getInstruction())->data_operands_end(); } iterator_range data_ops() const { return make_range(data_operands_begin(), data_operands_end()); @@ -579,13 +579,9 @@ #undef CALLSITE_DELEGATE_SETTER void getOperandBundlesAsDefs(SmallVectorImpl &Defs) const { - const Instruction *II = getInstruction(); // Since this is actually a getter that "looks like" a setter, don't use the // above macros to avoid confusion. - if (isCall()) - cast(II)->getOperandBundlesAsDefs(Defs); - else - cast(II)->getOperandBundlesAsDefs(Defs); + cast(getInstruction())->getOperandBundlesAsDefs(Defs); } /// Determine whether this data operand is not captured. Index: include/llvm/IR/InstrTypes.h =================================================================== --- include/llvm/IR/InstrTypes.h +++ include/llvm/IR/InstrTypes.h @@ -1232,6 +1232,9 @@ (ID << 2)); } + /// Check if this call is an inline asm statement. + bool isInlineAsm() const { return isa(getCalledOperand()); } + /// \name Attribute API /// /// These methods access and modify attributes on this call (including Index: include/llvm/IR/Instructions.h =================================================================== --- include/llvm/IR/Instructions.h +++ include/llvm/IR/Instructions.h @@ -1703,9 +1703,6 @@ addAttribute(AttributeList::FunctionIndex, Attribute::ReturnsTwice); } - /// Check if this call is an inline asm statement. - bool isInlineAsm() const { return isa(getCalledOperand()); } - // Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Call;