1 //===- CallSite.h - Abstract Call & Invoke instrs ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the CallSite class, which is a handy wrapper for code that
11 // wants to treat Call and Invoke instructions in a generic way. When in non-
12 // mutation context (e.g. an analysis) ImmutableCallSite should be used.
13 // Finally, when some degree of customization is necessary between these two
14 // extremes, CallSiteBase<> can be supplied with fine-tuned parameters.
16 // NOTE: These classes are supposed to have "value semantics". So they should be
17 // passed by value, not by reference; they should not be "new"ed or "delete"d.
18 // They are efficiently copyable, assignable and constructable, with cost
19 // equivalent to copying a pointer (notice that they have only a single data
20 // member). The internal representation carries a flag which indicates which of
21 // the two variants is enclosed. This allows for cheaper checks when various
22 // accessors of CallSite are employed.
24 //===----------------------------------------------------------------------===//
26 #ifndef LLVM_IR_CALLSITE_H
27 #define LLVM_IR_CALLSITE_H
29 #include "llvm/ADT/Optional.h"
30 #include "llvm/ADT/PointerIntPair.h"
31 #include "llvm/ADT/iterator_range.h"
32 #include "llvm/IR/Attributes.h"
33 #include "llvm/IR/CallingConv.h"
34 #include "llvm/IR/Function.h"
35 #include "llvm/IR/InstrTypes.h"
36 #include "llvm/IR/Instruction.h"
37 #include "llvm/IR/Instructions.h"
38 #include "llvm/IR/Intrinsics.h"
39 #include "llvm/IR/Use.h"
40 #include "llvm/IR/User.h"
41 #include "llvm/IR/Value.h"
42 #include "llvm/Support/Casting.h"
49 template <typename FunTy = const Function,
50 typename BBTy = const BasicBlock,
51 typename ValTy = const Value,
52 typename UserTy = const User,
53 typename UseTy = const Use,
54 typename InstrTy = const Instruction,
55 typename CallTy = const CallInst,
56 typename InvokeTy = const InvokeInst,
57 typename IterTy = User::const_op_iterator>
60 PointerIntPair<InstrTy*, 1, bool> I;
62 CallSiteBase() : I(nullptr, false) {}
63 CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
64 CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
65 explicit CallSiteBase(ValTy *II) { *this = get(II); }
68 /// This static method is like a constructor. It will create an appropriate
69 /// call site for a Call or Invoke instruction, but it can also create a null
70 /// initialized CallSiteBase object for something which is NOT a call site.
71 static CallSiteBase get(ValTy *V) {
72 if (InstrTy *II = dyn_cast<InstrTy>(V)) {
73 if (II->getOpcode() == Instruction::Call)
74 return CallSiteBase(static_cast<CallTy*>(II));
75 else if (II->getOpcode() == Instruction::Invoke)
76 return CallSiteBase(static_cast<InvokeTy*>(II));
78 return CallSiteBase();
82 /// Return true if a CallInst is enclosed. Note that !isCall() does not mean
83 /// an InvokeInst is enclosed. It may also signify a NULL instruction pointer.
84 bool isCall() const { return I.getInt(); }
86 /// Return true if a InvokeInst is enclosed.
87 bool isInvoke() const { return getInstruction() && !I.getInt(); }
89 InstrTy *getInstruction() const { return I.getPointer(); }
90 InstrTy *operator->() const { return I.getPointer(); }
91 explicit operator bool() const { return I.getPointer(); }
93 /// Get the basic block containing the call site.
94 BBTy* getParent() const { return getInstruction()->getParent(); }
96 /// Return the pointer to function that is being called.
97 ValTy *getCalledValue() const {
98 assert(getInstruction() && "Not a call or invoke instruction!");
102 /// Return the function being called if this is a direct call, otherwise
103 /// return null (if it's an indirect call).
104 FunTy *getCalledFunction() const {
105 return dyn_cast<FunTy>(getCalledValue());
108 /// Return true if the callsite is an indirect call.
109 bool isIndirectCall() const {
110 Value *V = getCalledValue();
113 if (isa<FunTy>(V) || isa<Constant>(V))
115 if (CallInst *CI = dyn_cast<CallInst>(getInstruction())) {
116 if (CI->isInlineAsm())
122 /// Set the callee to the specified value.
123 void setCalledFunction(Value *V) {
124 assert(getInstruction() && "Not a call or invoke instruction!");
128 /// Return the intrinsic ID of the intrinsic called by this CallSite,
129 /// or Intrinsic::not_intrinsic if the called function is not an
130 /// intrinsic, or if this CallSite is an indirect call.
131 Intrinsic::ID getIntrinsicID() const {
132 if (auto *F = getCalledFunction())
133 return F->getIntrinsicID();
134 // Don't use Intrinsic::not_intrinsic, as it will require pulling
135 // Intrinsics.h into every header that uses CallSite.
136 return static_cast<Intrinsic::ID>(0);
139 /// Determine whether the passed iterator points to the callee operand's Use.
140 bool isCallee(Value::const_user_iterator UI) const {
141 return isCallee(&UI.getUse());
144 /// Determine whether this Use is the callee operand's Use.
145 bool isCallee(const Use *U) const { return getCallee() == U; }
147 /// Determine whether the passed iterator points to an argument operand.
148 bool isArgOperand(Value::const_user_iterator UI) const {
149 return isArgOperand(&UI.getUse());
152 /// Determine whether the passed use points to an argument operand.
153 bool isArgOperand(const Use *U) const {
154 assert(getInstruction() == U->getUser());
155 return arg_begin() <= U && U < arg_end();
158 /// Determine whether the passed iterator points to a bundle operand.
159 bool isBundleOperand(Value::const_user_iterator UI) const {
160 return isBundleOperand(&UI.getUse());
163 /// Determine whether the passed use points to a bundle operand.
164 bool isBundleOperand(const Use *U) const {
165 assert(getInstruction() == U->getUser());
166 if (!hasOperandBundles())
168 unsigned OperandNo = U - (*this)->op_begin();
169 return getBundleOperandsStartIndex() <= OperandNo &&
170 OperandNo < getBundleOperandsEndIndex();
173 /// Determine whether the passed iterator points to a data operand.
174 bool isDataOperand(Value::const_user_iterator UI) const {
175 return isDataOperand(&UI.getUse());
178 /// Determine whether the passed use points to a data operand.
179 bool isDataOperand(const Use *U) const {
180 return data_operands_begin() <= U && U < data_operands_end();
183 ValTy *getArgument(unsigned ArgNo) const {
184 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
185 return *(arg_begin() + ArgNo);
188 void setArgument(unsigned ArgNo, Value* newVal) {
189 assert(getInstruction() && "Not a call or invoke instruction!");
190 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
191 getInstruction()->setOperand(ArgNo, newVal);
194 /// Given a value use iterator, returns the argument that corresponds to it.
195 /// Iterator must actually correspond to an argument.
196 unsigned getArgumentNo(Value::const_user_iterator I) const {
197 return getArgumentNo(&I.getUse());
200 /// Given a use for an argument, get the argument number that corresponds to
202 unsigned getArgumentNo(const Use *U) const {
203 assert(getInstruction() && "Not a call or invoke instruction!");
204 assert(isArgOperand(U) && "Argument # out of range!");
205 return U - arg_begin();
208 /// The type of iterator to use when looping over actual arguments at this
210 using arg_iterator = IterTy;
212 iterator_range<IterTy> args() const {
213 return make_range(arg_begin(), arg_end());
215 bool arg_empty() const { return arg_end() == arg_begin(); }
216 unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
218 /// Given a value use iterator, return the data operand corresponding to it.
219 /// Iterator must actually correspond to a data operand.
220 unsigned getDataOperandNo(Value::const_user_iterator UI) const {
221 return getDataOperandNo(&UI.getUse());
224 /// Given a use for a data operand, get the data operand number that
225 /// corresponds to it.
226 unsigned getDataOperandNo(const Use *U) const {
227 assert(getInstruction() && "Not a call or invoke instruction!");
228 assert(isDataOperand(U) && "Data operand # out of range!");
229 return U - data_operands_begin();
232 /// Type of iterator to use when looping over data operands at this call site
234 using data_operand_iterator = IterTy;
236 /// data_operands_begin/data_operands_end - Return iterators iterating over
237 /// the call / invoke argument list and bundle operands. For invokes, this is
238 /// the set of instruction operands except the invoke target and the two
239 /// successor blocks; and for calls this is the set of instruction operands
240 /// except the call target.
242 IterTy data_operands_begin() const {
243 assert(getInstruction() && "Not a call or invoke instruction!");
244 return (*this)->op_begin();
246 IterTy data_operands_end() const {
247 assert(getInstruction() && "Not a call or invoke instruction!");
248 return (*this)->op_end() - (isCall() ? 1 : 3);
250 iterator_range<IterTy> data_ops() const {
251 return make_range(data_operands_begin(), data_operands_end());
253 bool data_operands_empty() const {
254 return data_operands_end() == data_operands_begin();
256 unsigned data_operands_size() const {
257 return std::distance(data_operands_begin(), data_operands_end());
260 /// Return the type of the instruction that generated this call site.
261 Type *getType() const { return (*this)->getType(); }
263 /// Return the caller function for this call site.
264 FunTy *getCaller() const { return (*this)->getParent()->getParent(); }
266 /// Tests if this call site must be tail call optimized. Only a CallInst can
267 /// be tail call optimized.
268 bool isMustTailCall() const {
269 return isCall() && cast<CallInst>(getInstruction())->isMustTailCall();
272 /// Tests if this call site is marked as a tail call.
273 bool isTailCall() const {
274 return isCall() && cast<CallInst>(getInstruction())->isTailCall();
277 #define CALLSITE_DELEGATE_GETTER(METHOD) \
278 InstrTy *II = getInstruction(); \
280 ? cast<CallInst>(II)->METHOD \
281 : cast<InvokeInst>(II)->METHOD
283 #define CALLSITE_DELEGATE_SETTER(METHOD) \
284 InstrTy *II = getInstruction(); \
286 cast<CallInst>(II)->METHOD; \
288 cast<InvokeInst>(II)->METHOD
290 unsigned getNumArgOperands() const {
291 CALLSITE_DELEGATE_GETTER(getNumArgOperands());
294 ValTy *getArgOperand(unsigned i) const {
295 CALLSITE_DELEGATE_GETTER(getArgOperand(i));
298 ValTy *getReturnedArgOperand() const {
299 CALLSITE_DELEGATE_GETTER(getReturnedArgOperand());
302 bool isInlineAsm() const {
304 return cast<CallInst>(getInstruction())->isInlineAsm();
308 /// Get the calling convention of the call.
309 CallingConv::ID getCallingConv() const {
310 CALLSITE_DELEGATE_GETTER(getCallingConv());
312 /// Set the calling convention of the call.
313 void setCallingConv(CallingConv::ID CC) {
314 CALLSITE_DELEGATE_SETTER(setCallingConv(CC));
317 FunctionType *getFunctionType() const {
318 CALLSITE_DELEGATE_GETTER(getFunctionType());
321 void mutateFunctionType(FunctionType *Ty) const {
322 CALLSITE_DELEGATE_SETTER(mutateFunctionType(Ty));
325 /// Get the parameter attributes of the call.
326 AttributeList getAttributes() const {
327 CALLSITE_DELEGATE_GETTER(getAttributes());
329 /// Set the parameter attributes of the call.
330 void setAttributes(AttributeList PAL) {
331 CALLSITE_DELEGATE_SETTER(setAttributes(PAL));
334 void addAttribute(unsigned i, Attribute::AttrKind Kind) {
335 CALLSITE_DELEGATE_SETTER(addAttribute(i, Kind));
338 void addAttribute(unsigned i, Attribute Attr) {
339 CALLSITE_DELEGATE_SETTER(addAttribute(i, Attr));
342 void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
343 CALLSITE_DELEGATE_SETTER(addParamAttr(ArgNo, Kind));
346 void removeAttribute(unsigned i, Attribute::AttrKind Kind) {
347 CALLSITE_DELEGATE_SETTER(removeAttribute(i, Kind));
350 void removeAttribute(unsigned i, StringRef Kind) {
351 CALLSITE_DELEGATE_SETTER(removeAttribute(i, Kind));
354 void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
355 CALLSITE_DELEGATE_SETTER(removeParamAttr(ArgNo, Kind));
358 /// Return true if this function has the given attribute.
359 bool hasFnAttr(Attribute::AttrKind Kind) const {
360 CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
363 /// Return true if this function has the given attribute.
364 bool hasFnAttr(StringRef Kind) const {
365 CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
368 /// Return true if this return value has the given attribute.
369 bool hasRetAttr(Attribute::AttrKind Kind) const {
370 CALLSITE_DELEGATE_GETTER(hasRetAttr(Kind));
373 /// Return true if the call or the callee has the given attribute.
374 bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
375 CALLSITE_DELEGATE_GETTER(paramHasAttr(ArgNo, Kind));
378 Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
379 CALLSITE_DELEGATE_GETTER(getAttribute(i, Kind));
382 Attribute getAttribute(unsigned i, StringRef Kind) const {
383 CALLSITE_DELEGATE_GETTER(getAttribute(i, Kind));
386 /// Return true if the data operand at index \p i directly or indirectly has
387 /// the attribute \p A.
389 /// Normal call or invoke arguments have per operand attributes, as specified
390 /// in the attribute set attached to this instruction, while operand bundle
391 /// operands may have some attributes implied by the type of its containing
393 bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const {
394 CALLSITE_DELEGATE_GETTER(dataOperandHasImpliedAttr(i, Kind));
397 /// Extract the alignment of the return value.
398 unsigned getRetAlignment() const {
399 CALLSITE_DELEGATE_GETTER(getRetAlignment());
402 /// Extract the alignment for a call or parameter (0=unknown).
403 unsigned getParamAlignment(unsigned ArgNo) const {
404 CALLSITE_DELEGATE_GETTER(getParamAlignment(ArgNo));
407 /// Extract the number of dereferenceable bytes for a call or parameter
409 uint64_t getDereferenceableBytes(unsigned i) const {
410 CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
413 /// Extract the number of dereferenceable_or_null bytes for a call or
414 /// parameter (0=unknown).
415 uint64_t getDereferenceableOrNullBytes(unsigned i) const {
416 CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
419 /// Determine if the return value is marked with NoAlias attribute.
420 bool returnDoesNotAlias() const {
421 CALLSITE_DELEGATE_GETTER(returnDoesNotAlias());
424 /// Return true if the call should not be treated as a call to a builtin.
425 bool isNoBuiltin() const {
426 CALLSITE_DELEGATE_GETTER(isNoBuiltin());
429 /// Return true if the call should not be inlined.
430 bool isNoInline() const {
431 CALLSITE_DELEGATE_GETTER(isNoInline());
433 void setIsNoInline(bool Value = true) {
434 CALLSITE_DELEGATE_SETTER(setIsNoInline(Value));
437 /// Determine if the call does not access memory.
438 bool doesNotAccessMemory() const {
439 CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
441 void setDoesNotAccessMemory() {
442 CALLSITE_DELEGATE_SETTER(setDoesNotAccessMemory());
445 /// Determine if the call does not access or only reads memory.
446 bool onlyReadsMemory() const {
447 CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
449 void setOnlyReadsMemory() {
450 CALLSITE_DELEGATE_SETTER(setOnlyReadsMemory());
453 /// Determine if the call does not access or only writes memory.
454 bool doesNotReadMemory() const {
455 CALLSITE_DELEGATE_GETTER(doesNotReadMemory());
457 void setDoesNotReadMemory() {
458 CALLSITE_DELEGATE_SETTER(setDoesNotReadMemory());
461 /// Determine if the call can access memmory only using pointers based
462 /// on its arguments.
463 bool onlyAccessesArgMemory() const {
464 CALLSITE_DELEGATE_GETTER(onlyAccessesArgMemory());
466 void setOnlyAccessesArgMemory() {
467 CALLSITE_DELEGATE_SETTER(setOnlyAccessesArgMemory());
470 /// Determine if the call cannot return.
471 bool doesNotReturn() const {
472 CALLSITE_DELEGATE_GETTER(doesNotReturn());
474 void setDoesNotReturn() {
475 CALLSITE_DELEGATE_SETTER(setDoesNotReturn());
478 /// Determine if the call cannot unwind.
479 bool doesNotThrow() const {
480 CALLSITE_DELEGATE_GETTER(doesNotThrow());
482 void setDoesNotThrow() {
483 CALLSITE_DELEGATE_SETTER(setDoesNotThrow());
486 /// Determine if the call can be duplicated.
487 bool cannotDuplicate() const {
488 CALLSITE_DELEGATE_GETTER(cannotDuplicate());
490 void setCannotDuplicate() {
491 CALLSITE_DELEGATE_GETTER(setCannotDuplicate());
494 /// Determine if the call is convergent.
495 bool isConvergent() const {
496 CALLSITE_DELEGATE_GETTER(isConvergent());
498 void setConvergent() {
499 CALLSITE_DELEGATE_SETTER(setConvergent());
501 void setNotConvergent() {
502 CALLSITE_DELEGATE_SETTER(setNotConvergent());
505 unsigned getNumOperandBundles() const {
506 CALLSITE_DELEGATE_GETTER(getNumOperandBundles());
509 bool hasOperandBundles() const {
510 CALLSITE_DELEGATE_GETTER(hasOperandBundles());
513 unsigned getBundleOperandsStartIndex() const {
514 CALLSITE_DELEGATE_GETTER(getBundleOperandsStartIndex());
517 unsigned getBundleOperandsEndIndex() const {
518 CALLSITE_DELEGATE_GETTER(getBundleOperandsEndIndex());
521 unsigned getNumTotalBundleOperands() const {
522 CALLSITE_DELEGATE_GETTER(getNumTotalBundleOperands());
525 OperandBundleUse getOperandBundleAt(unsigned Index) const {
526 CALLSITE_DELEGATE_GETTER(getOperandBundleAt(Index));
529 Optional<OperandBundleUse> getOperandBundle(StringRef Name) const {
530 CALLSITE_DELEGATE_GETTER(getOperandBundle(Name));
533 Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
534 CALLSITE_DELEGATE_GETTER(getOperandBundle(ID));
537 unsigned countOperandBundlesOfType(uint32_t ID) const {
538 CALLSITE_DELEGATE_GETTER(countOperandBundlesOfType(ID));
541 bool isBundleOperand(unsigned Idx) const {
542 CALLSITE_DELEGATE_GETTER(isBundleOperand(Idx));
545 IterTy arg_begin() const {
546 CALLSITE_DELEGATE_GETTER(arg_begin());
549 IterTy arg_end() const {
550 CALLSITE_DELEGATE_GETTER(arg_end());
553 #undef CALLSITE_DELEGATE_GETTER
554 #undef CALLSITE_DELEGATE_SETTER
556 void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const {
557 const Instruction *II = getInstruction();
558 // Since this is actually a getter that "looks like" a setter, don't use the
559 // above macros to avoid confusion.
561 cast<CallInst>(II)->getOperandBundlesAsDefs(Defs);
563 cast<InvokeInst>(II)->getOperandBundlesAsDefs(Defs);
566 /// Determine whether this data operand is not captured.
567 bool doesNotCapture(unsigned OpNo) const {
568 return dataOperandHasImpliedAttr(OpNo + 1, Attribute::NoCapture);
571 /// Determine whether this argument is passed by value.
572 bool isByValArgument(unsigned ArgNo) const {
573 return paramHasAttr(ArgNo, Attribute::ByVal);
576 /// Determine whether this argument is passed in an alloca.
577 bool isInAllocaArgument(unsigned ArgNo) const {
578 return paramHasAttr(ArgNo, Attribute::InAlloca);
581 /// Determine whether this argument is passed by value or in an alloca.
582 bool isByValOrInAllocaArgument(unsigned ArgNo) const {
583 return paramHasAttr(ArgNo, Attribute::ByVal) ||
584 paramHasAttr(ArgNo, Attribute::InAlloca);
587 /// Determine if there are is an inalloca argument. Only the last argument can
588 /// have the inalloca attribute.
589 bool hasInAllocaArgument() const {
590 return !arg_empty() && paramHasAttr(arg_size() - 1, Attribute::InAlloca);
593 bool doesNotAccessMemory(unsigned OpNo) const {
594 return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
597 bool onlyReadsMemory(unsigned OpNo) const {
598 return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadOnly) ||
599 dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
602 bool doesNotReadMemory(unsigned OpNo) const {
603 return dataOperandHasImpliedAttr(OpNo + 1, Attribute::WriteOnly) ||
604 dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
607 /// Return true if the return value is known to be not null.
608 /// This may be because it has the nonnull attribute, or because at least
609 /// one byte is dereferenceable and the pointer is in addrspace(0).
610 bool isReturnNonNull() const {
611 if (hasRetAttr(Attribute::NonNull))
613 else if (getDereferenceableBytes(AttributeList::ReturnIndex) > 0 &&
614 getType()->getPointerAddressSpace() == 0)
620 /// Returns true if this CallSite passes the given Value* as an argument to
621 /// the called function.
622 bool hasArgument(const Value *Arg) const {
623 for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E;
625 if (AI->get() == Arg)
631 IterTy getCallee() const {
632 if (isCall()) // Skip Callee
633 return cast<CallInst>(getInstruction())->op_end() - 1;
634 else // Skip BB, BB, Callee
635 return cast<InvokeInst>(getInstruction())->op_end() - 3;
639 class CallSite : public CallSiteBase<Function, BasicBlock, Value, User, Use,
640 Instruction, CallInst, InvokeInst,
643 CallSite() = default;
644 CallSite(CallSiteBase B) : CallSiteBase(B) {}
645 CallSite(CallInst *CI) : CallSiteBase(CI) {}
646 CallSite(InvokeInst *II) : CallSiteBase(II) {}
647 explicit CallSite(Instruction *II) : CallSiteBase(II) {}
648 explicit CallSite(Value *V) : CallSiteBase(V) {}
650 bool operator==(const CallSite &CS) const { return I == CS.I; }
651 bool operator!=(const CallSite &CS) const { return I != CS.I; }
652 bool operator<(const CallSite &CS) const {
653 return getInstruction() < CS.getInstruction();
657 friend struct DenseMapInfo<CallSite>;
659 User::op_iterator getCallee() const;
662 template <> struct DenseMapInfo<CallSite> {
663 using BaseInfo = DenseMapInfo<decltype(CallSite::I)>;
665 static CallSite getEmptyKey() {
667 CS.I = BaseInfo::getEmptyKey();
671 static CallSite getTombstoneKey() {
673 CS.I = BaseInfo::getTombstoneKey();
677 static unsigned getHashValue(const CallSite &CS) {
678 return BaseInfo::getHashValue(CS.I);
681 static bool isEqual(const CallSite &LHS, const CallSite &RHS) {
686 /// Establish a view to a call site for examination.
687 class ImmutableCallSite : public CallSiteBase<> {
689 ImmutableCallSite() = default;
690 ImmutableCallSite(const CallInst *CI) : CallSiteBase(CI) {}
691 ImmutableCallSite(const InvokeInst *II) : CallSiteBase(II) {}
692 explicit ImmutableCallSite(const Instruction *II) : CallSiteBase(II) {}
693 explicit ImmutableCallSite(const Value *V) : CallSiteBase(V) {}
694 ImmutableCallSite(CallSite CS) : CallSiteBase(CS.getInstruction()) {}
697 } // end namespace llvm
699 #endif // LLVM_IR_CALLSITE_H