Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/IR/CallSite.h
Line
Count
Source (jump to first uncovered line)
1
//===- CallSite.h - Abstract Call & Invoke instrs ---------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
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.
15
//
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.
23
//
24
//===----------------------------------------------------------------------===//
25
26
#ifndef LLVM_IR_CALLSITE_H
27
#define LLVM_IR_CALLSITE_H
28
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/Use.h"
39
#include "llvm/IR/User.h"
40
#include "llvm/IR/Value.h"
41
#include "llvm/Support/Casting.h"
42
#include <cassert>
43
#include <cstdint>
44
#include <iterator>
45
46
namespace llvm {
47
48
namespace Intrinsic {
49
enum ID : unsigned;
50
}
51
52
template <typename FunTy = const Function,
53
          typename BBTy = const BasicBlock,
54
          typename ValTy = const Value,
55
          typename UserTy = const User,
56
          typename UseTy = const Use,
57
          typename InstrTy = const Instruction,
58
          typename CallTy = const CallInst,
59
          typename InvokeTy = const InvokeInst,
60
          typename IterTy = User::const_op_iterator>
61
class CallSiteBase {
62
protected:
63
  PointerIntPair<InstrTy*, 1, bool> I;
64
65
1.70G
  CallSiteBase() : I(nullptr, false) {}
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::CallSiteBase()
Line
Count
Source
65
1.17G
  CallSiteBase() : I(nullptr, false) {}
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::CallSiteBase()
Line
Count
Source
65
534M
  CallSiteBase() : I(nullptr, false) {}
66
595M
  CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::CallSiteBase(llvm::CallInst*)
Line
Count
Source
66
184M
  CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::CallSiteBase(llvm::CallInst const*)
Line
Count
Source
66
411M
  CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
67
6.86M
  CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::CallSiteBase(llvm::InvokeInst*)
Line
Count
Source
67
2.68M
  CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::CallSiteBase(llvm::InvokeInst const*)
Line
Count
Source
67
4.17M
  CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
68
2.16G
  explicit CallSiteBase(ValTy *II) { *this = get(II); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::CallSiteBase(llvm::Value*)
Line
Count
Source
68
632M
  explicit CallSiteBase(ValTy *II) { *this = get(II); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::CallSiteBase(llvm::Value const*)
Line
Count
Source
68
1.52G
  explicit CallSiteBase(ValTy *II) { *this = get(II); }
69
70
private:
71
  /// This static method is like a constructor. It will create an appropriate
72
  /// call site for a Call or Invoke instruction, but it can also create a null
73
  /// initialized CallSiteBase object for something which is NOT a call site.
74
2.16G
  static CallSiteBase get(ValTy *V) {
75
2.16G
    if (InstrTy *
II2.16G
= dyn_cast<InstrTy>(V)) {
76
1.68G
      if (II->getOpcode() == Instruction::Call)
77
453M
        return CallSiteBase(static_cast<CallTy*>(II));
78
1.23G
      else 
if (1.23G
II->getOpcode() == Instruction::Invoke1.23G
)
79
5.86M
        return CallSiteBase(static_cast<InvokeTy*>(II));
80
1.68G
    }
81
1.70G
    return CallSiteBase();
82
2.16G
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::get(llvm::Value*)
Line
Count
Source
74
632M
  static CallSiteBase get(ValTy *V) {
75
632M
    if (InstrTy *
II632M
= dyn_cast<InstrTy>(V)) {
76
456M
      if (II->getOpcode() == Instruction::Call)
77
98.7M
        return CallSiteBase(static_cast<CallTy*>(II));
78
357M
      else 
if (357M
II->getOpcode() == Instruction::Invoke357M
)
79
1.81M
        return CallSiteBase(static_cast<InvokeTy*>(II));
80
456M
    }
81
532M
    return CallSiteBase();
82
632M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::get(llvm::Value const*)
Line
Count
Source
74
1.52G
  static CallSiteBase get(ValTy *V) {
75
1.52G
    if (InstrTy *
II1.52G
= dyn_cast<InstrTy>(V)) {
76
1.22G
      if (II->getOpcode() == Instruction::Call)
77
354M
        return CallSiteBase(static_cast<CallTy*>(II));
78
873M
      else 
if (873M
II->getOpcode() == Instruction::Invoke873M
)
79
4.04M
        return CallSiteBase(static_cast<InvokeTy*>(II));
80
1.22G
    }
81
1.16G
    return CallSiteBase();
82
1.52G
  }
83
84
public:
85
  /// Return true if a CallInst is enclosed. Note that !isCall() does not mean
86
  /// an InvokeInst is enclosed. It may also signify a NULL instruction pointer.
87
1.56G
  bool isCall() const { return I.getInt(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isCall() const
Line
Count
Source
87
548M
  bool isCall() const { return I.getInt(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isCall() const
Line
Count
Source
87
1.02G
  bool isCall() const { return I.getInt(); }
88
89
  /// Return true if a InvokeInst is enclosed.
90
1.75M
  bool isInvoke() const 
{ return getInstruction() && 1.75M
!I.getInt()1.75M
; }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isInvoke() const
Line
Count
Source
90
174
  bool isInvoke() const 
{ return getInstruction() && 174
!I.getInt()174
; }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isInvoke() const
Line
Count
Source
90
1.75M
  bool isInvoke() const 
{ return getInstruction() && 1.75M
!I.getInt()1.75M
; }
91
92
2.07G
  InstrTy *getInstruction() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getInstruction() const
Line
Count
Source
92
727M
  InstrTy *getInstruction() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getInstruction() const
Line
Count
Source
92
1.34G
  InstrTy *getInstruction() const { return I.getPointer(); }
93
50.3M
  InstrTy *operator->() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::operator->() const
Line
Count
Source
93
5.70M
  InstrTy *operator->() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::operator->() const
Line
Count
Source
93
44.6M
  InstrTy *operator->() const { return I.getPointer(); }
94
1.85G
  explicit operator bool() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::operator bool() const
Line
Count
Source
94
1.24G
  explicit operator bool() const { return I.getPointer(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::operator bool() const
Line
Count
Source
94
609M
  explicit operator bool() const { return I.getPointer(); }
95
96
  /// Get the basic block containing the call site.
97
1.41M
  BBTy* getParent() const { return getInstruction()->getParent(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getParent() const
Line
Count
Source
97
1.15M
  BBTy* getParent() const { return getInstruction()->getParent(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getParent() const
Line
Count
Source
97
258k
  BBTy* getParent() const { return getInstruction()->getParent(); }
98
99
  /// Return the pointer to function that is being called.
100
347M
  ValTy *getCalledValue() const {
101
347M
    assert(getInstruction() && "Not a call or invoke instruction!");
102
347M
    return *getCallee();
103
347M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getCalledValue() const
Line
Count
Source
100
222M
  ValTy *getCalledValue() const {
101
222M
    assert(getInstruction() && "Not a call or invoke instruction!");
102
222M
    return *getCallee();
103
222M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getCalledValue() const
Line
Count
Source
100
125M
  ValTy *getCalledValue() const {
101
125M
    assert(getInstruction() && "Not a call or invoke instruction!");
102
125M
    return *getCallee();
103
125M
  }
104
105
  /// Return the function being called if this is a direct call, otherwise
106
  /// return null (if it's an indirect call).
107
272M
  FunTy *getCalledFunction() const {
108
272M
    return dyn_cast<FunTy>(getCalledValue());
109
272M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getCalledFunction() const
Line
Count
Source
107
58.0M
  FunTy *getCalledFunction() const {
108
58.0M
    return dyn_cast<FunTy>(getCalledValue());
109
58.0M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getCalledFunction() const
Line
Count
Source
107
214M
  FunTy *getCalledFunction() const {
108
214M
    return dyn_cast<FunTy>(getCalledValue());
109
214M
  }
110
111
  /// Return true if the callsite is an indirect call.
112
519
  bool isIndirectCall() const {
113
519
    Value *V = getCalledValue();
114
519
    if (!V)
115
0
      return false;
116
519
    
if (519
isa<FunTy>(V) || 519
isa<Constant>(V)95
)
117
451
      return false;
118
68
    
if (CallInst *68
CI68
= dyn_cast<CallInst>(getInstruction())) {
119
56
      if (CI->isInlineAsm())
120
4
        return false;
121
56
    }
122
64
    return true;
123
519
  }
124
125
  /// Set the callee to the specified value.
126
52
  void setCalledFunction(Value *V) {
127
52
    assert(getInstruction() && "Not a call or invoke instruction!");
128
52
    *getCallee() = V;
129
52
  }
130
131
  /// Return the intrinsic ID of the intrinsic called by this CallSite,
132
  /// or Intrinsic::not_intrinsic if the called function is not an
133
  /// intrinsic, or if this CallSite is an indirect call.
134
7.46M
  Intrinsic::ID getIntrinsicID() const {
135
7.46M
    if (auto *F = getCalledFunction())
136
7.13M
      return F->getIntrinsicID();
137
7.46M
    // Don't use Intrinsic::not_intrinsic, as it will require pulling
138
7.46M
    // Intrinsics.h into every header that uses CallSite.
139
331k
    return static_cast<Intrinsic::ID>(0);
140
7.46M
  }
141
142
  /// Determine whether the passed iterator points to the callee operand's Use.
143
  bool isCallee(Value::const_user_iterator UI) const {
144
    return isCallee(&UI.getUse());
145
  }
146
147
  /// Determine whether this Use is the callee operand's Use.
148
9.86M
  bool isCallee(const Use *U) const { return getCallee() == U; }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isCallee(llvm::Use const*) const
Line
Count
Source
148
8.66M
  bool isCallee(const Use *U) const { return getCallee() == U; }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isCallee(llvm::Use const*) const
Line
Count
Source
148
1.19M
  bool isCallee(const Use *U) const { return getCallee() == U; }
149
150
  /// Determine whether the passed iterator points to an argument operand.
151
  bool isArgOperand(Value::const_user_iterator UI) const {
152
    return isArgOperand(&UI.getUse());
153
  }
154
155
  /// Determine whether the passed use points to an argument operand.
156
2.17M
  bool isArgOperand(const Use *U) const {
157
2.17M
    assert(getInstruction() == U->getUser());
158
2.17M
    return arg_begin() <= U && U < arg_end();
159
2.17M
  }
160
161
  /// Determine whether the passed iterator points to a bundle operand.
162
  bool isBundleOperand(Value::const_user_iterator UI) const {
163
    return isBundleOperand(&UI.getUse());
164
  }
165
166
  /// Determine whether the passed use points to a bundle operand.
167
32.1k
  bool isBundleOperand(const Use *U) const {
168
32.1k
    assert(getInstruction() == U->getUser());
169
32.1k
    if (!hasOperandBundles())
170
32.1k
      return false;
171
1
    unsigned OperandNo = U - (*this)->op_begin();
172
1
    return getBundleOperandsStartIndex() <= OperandNo &&
173
1
           OperandNo < getBundleOperandsEndIndex();
174
32.1k
  }
175
176
  /// Determine whether the passed iterator points to a data operand.
177
  bool isDataOperand(Value::const_user_iterator UI) const {
178
    return isDataOperand(&UI.getUse());
179
  }
180
181
  /// Determine whether the passed use points to a data operand.
182
1.78M
  bool isDataOperand(const Use *U) const {
183
1.78M
    return data_operands_begin() <= U && U < data_operands_end();
184
1.78M
  }
185
186
3.64M
  ValTy *getArgument(unsigned ArgNo) const {
187
3.64M
    assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
188
3.64M
    return *(arg_begin() + ArgNo);
189
3.64M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getArgument(unsigned int) const
Line
Count
Source
186
1.65M
  ValTy *getArgument(unsigned ArgNo) const {
187
1.65M
    assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
188
1.65M
    return *(arg_begin() + ArgNo);
189
1.65M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getArgument(unsigned int) const
Line
Count
Source
186
1.98M
  ValTy *getArgument(unsigned ArgNo) const {
187
1.98M
    assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
188
1.98M
    return *(arg_begin() + ArgNo);
189
1.98M
  }
190
191
2.31k
  void setArgument(unsigned ArgNo, Value* newVal) {
192
2.31k
    assert(getInstruction() && "Not a call or invoke instruction!");
193
2.31k
    assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
194
2.31k
    getInstruction()->setOperand(ArgNo, newVal);
195
2.31k
  }
196
197
  /// Given a value use iterator, returns the argument that corresponds to it.
198
  /// Iterator must actually correspond to an argument.
199
  unsigned getArgumentNo(Value::const_user_iterator I) const {
200
    return getArgumentNo(&I.getUse());
201
  }
202
203
  /// Given a use for an argument, get the argument number that corresponds to
204
  /// it.
205
32.1k
  unsigned getArgumentNo(const Use *U) const {
206
32.1k
    assert(getInstruction() && "Not a call or invoke instruction!");
207
32.1k
    assert(isArgOperand(U) && "Argument # out of range!");
208
32.1k
    return U - arg_begin();
209
32.1k
  }
210
211
  /// The type of iterator to use when looping over actual arguments at this
212
  /// call site.
213
  using arg_iterator = IterTy;
214
215
34.2M
  iterator_range<IterTy> args() const {
216
34.2M
    return make_range(arg_begin(), arg_end());
217
34.2M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::args() const
Line
Count
Source
215
1.17M
  iterator_range<IterTy> args() const {
216
1.17M
    return make_range(arg_begin(), arg_end());
217
1.17M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::args() const
Line
Count
Source
215
33.0M
  iterator_range<IterTy> args() const {
216
33.0M
    return make_range(arg_begin(), arg_end());
217
33.0M
  }
218
418k
  bool arg_empty() const { return arg_end() == arg_begin(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::arg_empty() const
Line
Count
Source
218
417k
  bool arg_empty() const { return arg_end() == arg_begin(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::arg_empty() const
Line
Count
Source
218
1.03k
  bool arg_empty() const { return arg_end() == arg_begin(); }
219
8.77M
  unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::arg_size() const
Line
Count
Source
219
1.97M
  unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::arg_size() const
Line
Count
Source
219
6.80M
  unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
220
221
  /// Given a value use iterator, return the data operand corresponding to it.
222
  /// Iterator must actually correspond to a data operand.
223
  unsigned getDataOperandNo(Value::const_user_iterator UI) const {
224
    return getDataOperandNo(&UI.getUse());
225
  }
226
227
  /// Given a use for a data operand, get the data operand number that
228
  /// corresponds to it.
229
1.67M
  unsigned getDataOperandNo(const Use *U) const {
230
1.67M
    assert(getInstruction() && "Not a call or invoke instruction!");
231
1.67M
    assert(isDataOperand(U) && "Data operand # out of range!");
232
1.67M
    return U - data_operands_begin();
233
1.67M
  }
234
235
  /// Type of iterator to use when looping over data operands at this call site
236
  /// (see below).
237
  using data_operand_iterator = IterTy;
238
239
  /// data_operands_begin/data_operands_end - Return iterators iterating over
240
  /// the call / invoke argument list and bundle operands.  For invokes, this is
241
  /// the set of instruction operands except the invoke target and the two
242
  /// successor blocks; and for calls this is the set of instruction operands
243
  /// except the call target.
244
245
17.1M
  IterTy data_operands_begin() const {
246
17.1M
    assert(getInstruction() && "Not a call or invoke instruction!");
247
17.1M
    return (*this)->op_begin();
248
17.1M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::data_operands_begin() const
Line
Count
Source
245
16.7M
  IterTy data_operands_begin() const {
246
16.7M
    assert(getInstruction() && "Not a call or invoke instruction!");
247
16.7M
    return (*this)->op_begin();
248
16.7M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::data_operands_begin() const
Line
Count
Source
245
428k
  IterTy data_operands_begin() const {
246
428k
    assert(getInstruction() && "Not a call or invoke instruction!");
247
428k
    return (*this)->op_begin();
248
428k
  }
249
15.4M
  IterTy data_operands_end() const {
250
15.4M
    assert(getInstruction() && "Not a call or invoke instruction!");
251
15.4M
    return (*this)->op_end() - (isCall() ? 
114.9M
:
3495k
);
252
15.4M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::data_operands_end() const
Line
Count
Source
249
428k
  IterTy data_operands_end() const {
250
428k
    assert(getInstruction() && "Not a call or invoke instruction!");
251
428k
    return (*this)->op_end() - (isCall() ? 
1398k
:
329.7k
);
252
428k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::data_operands_end() const
Line
Count
Source
249
15.0M
  IterTy data_operands_end() const {
250
15.0M
    assert(getInstruction() && "Not a call or invoke instruction!");
251
15.0M
    return (*this)->op_end() - (isCall() ? 
114.5M
:
3465k
);
252
15.0M
  }
253
  iterator_range<IterTy> data_ops() const {
254
    return make_range(data_operands_begin(), data_operands_end());
255
  }
256
  bool data_operands_empty() const {
257
    return data_operands_end() == data_operands_begin();
258
  }
259
  unsigned data_operands_size() const {
260
    return std::distance(data_operands_begin(), data_operands_end());
261
  }
262
263
  /// Return the type of the instruction that generated this call site.
264
2.96M
  Type *getType() const { return (*this)->getType(); }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getType() const
Line
Count
Source
264
3.79k
  Type *getType() const { return (*this)->getType(); }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getType() const
Line
Count
Source
264
2.96M
  Type *getType() const { return (*this)->getType(); }
265
266
  /// Return the caller function for this call site.
267
12.4M
  FunTy *getCaller() const { return (*this)->getParent()->getParent(); }
268
269
  /// Tests if this call site must be tail call optimized. Only a CallInst can
270
  /// be tail call optimized.
271
37.5k
  bool isMustTailCall() const {
272
37.0k
    return isCall() && cast<CallInst>(getInstruction())->isMustTailCall();
273
37.5k
  }
274
275
  /// Tests if this call site is marked as a tail call.
276
2
  bool isTailCall() const {
277
2
    return isCall() && cast<CallInst>(getInstruction())->isTailCall();
278
2
  }
279
280
#define CALLSITE_DELEGATE_GETTER(METHOD) \
281
1.18G
  InstrTy *II = getInstruction();    \
282
1.18G
  return isCall()                        \
283
1.17G
    ? cast<CallInst>(II)->METHOD         \
284
10.9M
    : cast<InvokeInst>(II)->METHOD
285
286
#define CALLSITE_DELEGATE_SETTER(METHOD) \
287
2.27M
  InstrTy *II = getInstruction();    \
288
2.27M
  if (isCall())                          \
289
2.20M
    cast<CallInst>(II)->METHOD;          \
290
2.27M
  else                                   \
291
73.6k
    cast<InvokeInst>(II)->METHOD
292
293
6.57M
  unsigned getNumArgOperands() const {
294
6.57M
    CALLSITE_DELEGATE_GETTER(getNumArgOperands());
295
6.57M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getNumArgOperands() const
Line
Count
Source
293
6.26M
  unsigned getNumArgOperands() const {
294
6.26M
    CALLSITE_DELEGATE_GETTER(getNumArgOperands());
295
6.26M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getNumArgOperands() const
Line
Count
Source
293
308k
  unsigned getNumArgOperands() const {
294
308k
    CALLSITE_DELEGATE_GETTER(getNumArgOperands());
295
308k
  }
296
297
228M
  ValTy *getArgOperand(unsigned i) const {
298
228M
    CALLSITE_DELEGATE_GETTER(getArgOperand(i));
299
228M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getArgOperand(unsigned int) const
Line
Count
Source
297
225M
  ValTy *getArgOperand(unsigned i) const {
298
225M
    CALLSITE_DELEGATE_GETTER(getArgOperand(i));
299
225M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getArgOperand(unsigned int) const
Line
Count
Source
297
2.23M
  ValTy *getArgOperand(unsigned i) const {
298
2.23M
    CALLSITE_DELEGATE_GETTER(getArgOperand(i));
299
2.23M
  }
300
301
97.5M
  ValTy *getReturnedArgOperand() const {
302
97.5M
    CALLSITE_DELEGATE_GETTER(getReturnedArgOperand());
303
97.5M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getReturnedArgOperand() const
Line
Count
Source
301
71.1M
  ValTy *getReturnedArgOperand() const {
302
71.1M
    CALLSITE_DELEGATE_GETTER(getReturnedArgOperand());
303
71.1M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getReturnedArgOperand() const
Line
Count
Source
301
26.3M
  ValTy *getReturnedArgOperand() const {
302
26.3M
    CALLSITE_DELEGATE_GETTER(getReturnedArgOperand());
303
26.3M
  }
304
305
1.70k
  bool isInlineAsm() const {
306
1.70k
    if (isCall())
307
1.66k
      return cast<CallInst>(getInstruction())->isInlineAsm();
308
48
    return false;
309
1.70k
  }
310
311
  /// Get the calling convention of the call.
312
29.4M
  CallingConv::ID getCallingConv() const {
313
29.4M
    CALLSITE_DELEGATE_GETTER(getCallingConv());
314
29.4M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getCallingConv() const
Line
Count
Source
312
2.90M
  CallingConv::ID getCallingConv() const {
313
2.90M
    CALLSITE_DELEGATE_GETTER(getCallingConv());
314
2.90M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getCallingConv() const
Line
Count
Source
312
26.5M
  CallingConv::ID getCallingConv() const {
313
26.5M
    CALLSITE_DELEGATE_GETTER(getCallingConv());
314
26.5M
  }
315
  /// Set the calling convention of the call.
316
703k
  void setCallingConv(CallingConv::ID CC) {
317
703k
    CALLSITE_DELEGATE_SETTER(setCallingConv(CC));
318
703k
  }
319
320
3.74M
  FunctionType *getFunctionType() const {
321
3.74M
    CALLSITE_DELEGATE_GETTER(getFunctionType());
322
3.74M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getFunctionType() const
Line
Count
Source
320
2.90M
  FunctionType *getFunctionType() const {
321
2.90M
    CALLSITE_DELEGATE_GETTER(getFunctionType());
322
2.90M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getFunctionType() const
Line
Count
Source
320
835k
  FunctionType *getFunctionType() const {
321
835k
    CALLSITE_DELEGATE_GETTER(getFunctionType());
322
835k
  }
323
324
493
  void mutateFunctionType(FunctionType *Ty) const {
325
493
    CALLSITE_DELEGATE_SETTER(mutateFunctionType(Ty));
326
493
  }
327
328
  /// Get the parameter attributes of the call.
329
29.6M
  AttributeList getAttributes() const {
330
29.6M
    CALLSITE_DELEGATE_GETTER(getAttributes());
331
29.6M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getAttributes() const
Line
Count
Source
329
27.9M
  AttributeList getAttributes() const {
330
27.9M
    CALLSITE_DELEGATE_GETTER(getAttributes());
331
27.9M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getAttributes() const
Line
Count
Source
329
1.76M
  AttributeList getAttributes() const {
330
1.76M
    CALLSITE_DELEGATE_GETTER(getAttributes());
331
1.76M
  }
332
  /// Set the parameter attributes of the call.
333
1.57M
  void setAttributes(AttributeList PAL) {
334
1.57M
    CALLSITE_DELEGATE_SETTER(setAttributes(PAL));
335
1.57M
  }
336
337
  void addAttribute(unsigned i, Attribute::AttrKind Kind) {
338
    CALLSITE_DELEGATE_SETTER(addAttribute(i, Kind));
339
  }
340
341
5
  void addAttribute(unsigned i, Attribute Attr) {
342
5
    CALLSITE_DELEGATE_SETTER(addAttribute(i, Attr));
343
5
  }
344
345
112
  void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
346
112
    CALLSITE_DELEGATE_SETTER(addParamAttr(ArgNo, Kind));
347
112
  }
348
349
0
  void removeAttribute(unsigned i, Attribute::AttrKind Kind) {
350
0
    CALLSITE_DELEGATE_SETTER(removeAttribute(i, Kind));
351
0
  }
352
353
0
  void removeAttribute(unsigned i, StringRef Kind) {
354
0
    CALLSITE_DELEGATE_SETTER(removeAttribute(i, Kind));
355
0
  }
356
357
112
  void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
358
112
    CALLSITE_DELEGATE_SETTER(removeParamAttr(ArgNo, Kind));
359
112
  }
360
361
  /// Return true if this function has the given attribute.
362
10.6M
  bool hasFnAttr(Attribute::AttrKind Kind) const {
363
10.6M
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
364
10.6M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::hasFnAttr(llvm::Attribute::AttrKind) const
Line
Count
Source
362
4.78M
  bool hasFnAttr(Attribute::AttrKind Kind) const {
363
4.78M
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
364
4.78M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::hasFnAttr(llvm::Attribute::AttrKind) const
Line
Count
Source
362
5.89M
  bool hasFnAttr(Attribute::AttrKind Kind) const {
363
5.89M
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
364
5.89M
  }
365
366
  /// Return true if this function has the given attribute.
367
391
  bool hasFnAttr(StringRef Kind) const {
368
391
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
369
391
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::hasFnAttr(llvm::StringRef) const
Line
Count
Source
367
245
  bool hasFnAttr(StringRef Kind) const {
368
245
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
369
245
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::hasFnAttr(llvm::StringRef) const
Line
Count
Source
367
146
  bool hasFnAttr(StringRef Kind) const {
368
146
    CALLSITE_DELEGATE_GETTER(hasFnAttr(Kind));
369
146
  }
370
371
  /// Return true if this return value has the given attribute.
372
39.6M
  bool hasRetAttr(Attribute::AttrKind Kind) const {
373
39.6M
    CALLSITE_DELEGATE_GETTER(hasRetAttr(Kind));
374
39.6M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::hasRetAttr(llvm::Attribute::AttrKind) const
Line
Count
Source
372
3.76k
  bool hasRetAttr(Attribute::AttrKind Kind) const {
373
3.76k
    CALLSITE_DELEGATE_GETTER(hasRetAttr(Kind));
374
3.76k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::hasRetAttr(llvm::Attribute::AttrKind) const
Line
Count
Source
372
39.6M
  bool hasRetAttr(Attribute::AttrKind Kind) const {
373
39.6M
    CALLSITE_DELEGATE_GETTER(hasRetAttr(Kind));
374
39.6M
  }
375
376
  /// Return true if the call or the callee has the given attribute.
377
110M
  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
378
110M
    CALLSITE_DELEGATE_GETTER(paramHasAttr(ArgNo, Kind));
379
110M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::paramHasAttr(unsigned int, llvm::Attribute::AttrKind) const
Line
Count
Source
377
42.8M
  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
378
42.8M
    CALLSITE_DELEGATE_GETTER(paramHasAttr(ArgNo, Kind));
379
42.8M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::paramHasAttr(unsigned int, llvm::Attribute::AttrKind) const
Line
Count
Source
377
68.0M
  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
378
68.0M
    CALLSITE_DELEGATE_GETTER(paramHasAttr(ArgNo, Kind));
379
68.0M
  }
380
381
1.04k
  Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
382
1.04k
    CALLSITE_DELEGATE_GETTER(getAttribute(i, Kind));
383
1.04k
  }
384
385
0
  Attribute getAttribute(unsigned i, StringRef Kind) const {
386
0
    CALLSITE_DELEGATE_GETTER(getAttribute(i, Kind));
387
0
  }
388
389
  /// Return true if the data operand at index \p i directly or indirectly has
390
  /// the attribute \p A.
391
  ///
392
  /// Normal call or invoke arguments have per operand attributes, as specified
393
  /// in the attribute set attached to this instruction, while operand bundle
394
  /// operands may have some attributes implied by the type of its containing
395
  /// operand bundle.
396
15.5M
  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const {
397
15.5M
    CALLSITE_DELEGATE_GETTER(dataOperandHasImpliedAttr(i, Kind));
398
15.5M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::dataOperandHasImpliedAttr(unsigned int, llvm::Attribute::AttrKind) const
Line
Count
Source
396
1.34M
  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const {
397
1.34M
    CALLSITE_DELEGATE_GETTER(dataOperandHasImpliedAttr(i, Kind));
398
1.34M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::dataOperandHasImpliedAttr(unsigned int, llvm::Attribute::AttrKind) const
Line
Count
Source
396
14.1M
  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const {
397
14.1M
    CALLSITE_DELEGATE_GETTER(dataOperandHasImpliedAttr(i, Kind));
398
14.1M
  }
399
400
  /// Extract the alignment of the return value.
401
  unsigned getRetAlignment() const {
402
    CALLSITE_DELEGATE_GETTER(getRetAlignment());
403
  }
404
405
  /// Extract the alignment for a call or parameter (0=unknown).
406
4.00M
  unsigned getParamAlignment(unsigned ArgNo) const {
407
4.00M
    CALLSITE_DELEGATE_GETTER(getParamAlignment(ArgNo));
408
4.00M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getParamAlignment(unsigned int) const
Line
Count
Source
406
4.00M
  unsigned getParamAlignment(unsigned ArgNo) const {
407
4.00M
    CALLSITE_DELEGATE_GETTER(getParamAlignment(ArgNo));
408
4.00M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getParamAlignment(unsigned int) const
Line
Count
Source
406
282
  unsigned getParamAlignment(unsigned ArgNo) const {
407
282
    CALLSITE_DELEGATE_GETTER(getParamAlignment(ArgNo));
408
282
  }
409
410
  /// Extract the number of dereferenceable bytes for a call or parameter
411
  /// (0=unknown).
412
13.4M
  uint64_t getDereferenceableBytes(unsigned i) const {
413
13.4M
    CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
414
13.4M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getDereferenceableBytes(unsigned int) const
Line
Count
Source
412
602
  uint64_t getDereferenceableBytes(unsigned i) const {
413
602
    CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
414
602
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getDereferenceableBytes(unsigned int) const
Line
Count
Source
412
13.4M
  uint64_t getDereferenceableBytes(unsigned i) const {
413
13.4M
    CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
414
13.4M
  }
415
416
  /// Extract the number of dereferenceable_or_null bytes for a call or
417
  /// parameter (0=unknown).
418
213k
  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
419
213k
    CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
420
213k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getDereferenceableOrNullBytes(unsigned int) const
Line
Count
Source
418
213k
  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
419
213k
    CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
420
213k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getDereferenceableOrNullBytes(unsigned int) const
Line
Count
Source
418
601
  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
419
601
    CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
420
601
  }
421
422
  /// Determine if the return value is marked with NoAlias attribute.
423
  bool returnDoesNotAlias() const {
424
    CALLSITE_DELEGATE_GETTER(returnDoesNotAlias());
425
  }
426
427
  /// Return true if the call should not be treated as a call to a builtin.
428
169M
  bool isNoBuiltin() const {
429
169M
    CALLSITE_DELEGATE_GETTER(isNoBuiltin());
430
169M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isNoBuiltin() const
Line
Count
Source
428
27.1M
  bool isNoBuiltin() const {
429
27.1M
    CALLSITE_DELEGATE_GETTER(isNoBuiltin());
430
27.1M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isNoBuiltin() const
Line
Count
Source
428
142M
  bool isNoBuiltin() const {
429
142M
    CALLSITE_DELEGATE_GETTER(isNoBuiltin());
430
142M
  }
431
432
  /// Return true if the call requires strict floating point semantics.
433
38.7M
  bool isStrictFP() const {
434
38.7M
    CALLSITE_DELEGATE_GETTER(isStrictFP());
435
38.7M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isStrictFP() const
Line
Count
Source
433
29.9M
  bool isStrictFP() const {
434
29.9M
    CALLSITE_DELEGATE_GETTER(isStrictFP());
435
29.9M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isStrictFP() const
Line
Count
Source
433
8.75M
  bool isStrictFP() const {
434
8.75M
    CALLSITE_DELEGATE_GETTER(isStrictFP());
435
8.75M
  }
436
437
  /// Return true if the call should not be inlined.
438
3.01M
  bool isNoInline() const {
439
3.01M
    CALLSITE_DELEGATE_GETTER(isNoInline());
440
3.01M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isNoInline() const
Line
Count
Source
438
522k
  bool isNoInline() const {
439
522k
    CALLSITE_DELEGATE_GETTER(isNoInline());
440
522k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isNoInline() const
Line
Count
Source
438
2.49M
  bool isNoInline() const {
439
2.49M
    CALLSITE_DELEGATE_GETTER(isNoInline());
440
2.49M
  }
441
  void setIsNoInline(bool Value = true) {
442
    CALLSITE_DELEGATE_SETTER(setIsNoInline(Value));
443
  }
444
445
  /// Determine if the call does not access memory.
446
22.8M
  bool doesNotAccessMemory() const {
447
22.8M
    CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
448
22.8M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::doesNotAccessMemory() const
Line
Count
Source
446
22.7M
  bool doesNotAccessMemory() const {
447
22.7M
    CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
448
22.7M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::doesNotAccessMemory() const
Line
Count
Source
446
102k
  bool doesNotAccessMemory() const {
447
102k
    CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
448
102k
  }
449
  void setDoesNotAccessMemory() {
450
    CALLSITE_DELEGATE_SETTER(setDoesNotAccessMemory());
451
  }
452
453
  /// Determine if the call does not access or only reads memory.
454
38.4M
  bool onlyReadsMemory() const {
455
38.4M
    CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
456
38.4M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::onlyReadsMemory() const
Line
Count
Source
454
23.5M
  bool onlyReadsMemory() const {
455
23.5M
    CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
456
23.5M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::onlyReadsMemory() const
Line
Count
Source
454
14.8M
  bool onlyReadsMemory() const {
455
14.8M
    CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
456
14.8M
  }
457
  void setOnlyReadsMemory() {
458
    CALLSITE_DELEGATE_SETTER(setOnlyReadsMemory());
459
  }
460
461
  /// Determine if the call does not access or only writes memory.
462
22.0M
  bool doesNotReadMemory() const {
463
22.0M
    CALLSITE_DELEGATE_GETTER(doesNotReadMemory());
464
22.0M
  }
465
  void setDoesNotReadMemory() {
466
    CALLSITE_DELEGATE_SETTER(setDoesNotReadMemory());
467
  }
468
469
  /// Determine if the call can access memmory only using pointers based
470
  /// on its arguments.
471
23.4M
  bool onlyAccessesArgMemory() const {
472
23.4M
    CALLSITE_DELEGATE_GETTER(onlyAccessesArgMemory());
473
23.4M
  }
474
  void setOnlyAccessesArgMemory() {
475
    CALLSITE_DELEGATE_SETTER(setOnlyAccessesArgMemory());
476
  }
477
478
  /// Determine if the call cannot return.
479
1.76M
  bool doesNotReturn() const {
480
1.76M
    CALLSITE_DELEGATE_GETTER(doesNotReturn());
481
1.76M
  }
482
  void setDoesNotReturn() {
483
    CALLSITE_DELEGATE_SETTER(setDoesNotReturn());
484
  }
485
486
  /// Determine if the call cannot unwind.
487
1.26M
  bool doesNotThrow() const {
488
1.26M
    CALLSITE_DELEGATE_GETTER(doesNotThrow());
489
1.26M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::doesNotThrow() const
Line
Count
Source
487
951k
  bool doesNotThrow() const {
488
951k
    CALLSITE_DELEGATE_GETTER(doesNotThrow());
489
951k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::doesNotThrow() const
Line
Count
Source
487
312k
  bool doesNotThrow() const {
488
312k
    CALLSITE_DELEGATE_GETTER(doesNotThrow());
489
312k
  }
490
22
  void setDoesNotThrow() {
491
22
    CALLSITE_DELEGATE_SETTER(setDoesNotThrow());
492
22
  }
493
494
  /// Determine if the call can be duplicated.
495
846k
  bool cannotDuplicate() const {
496
846k
    CALLSITE_DELEGATE_GETTER(cannotDuplicate());
497
846k
  }
498
  void setCannotDuplicate() {
499
    CALLSITE_DELEGATE_SETTER(setCannotDuplicate());
500
  }
501
502
  /// Determine if the call is convergent.
503
28.2M
  bool isConvergent() const {
504
28.2M
    CALLSITE_DELEGATE_GETTER(isConvergent());
505
28.2M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isConvergent() const
Line
Count
Source
503
1.77M
  bool isConvergent() const {
504
1.77M
    CALLSITE_DELEGATE_GETTER(isConvergent());
505
1.77M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isConvergent() const
Line
Count
Source
503
26.4M
  bool isConvergent() const {
504
26.4M
    CALLSITE_DELEGATE_GETTER(isConvergent());
505
26.4M
  }
506
  void setConvergent() {
507
    CALLSITE_DELEGATE_SETTER(setConvergent());
508
  }
509
1
  void setNotConvergent() {
510
1
    CALLSITE_DELEGATE_SETTER(setNotConvergent());
511
1
  }
512
513
422k
  unsigned getNumOperandBundles() const {
514
422k
    CALLSITE_DELEGATE_GETTER(getNumOperandBundles());
515
422k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getNumOperandBundles() const
Line
Count
Source
513
417k
  unsigned getNumOperandBundles() const {
514
417k
    CALLSITE_DELEGATE_GETTER(getNumOperandBundles());
515
417k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getNumOperandBundles() const
Line
Count
Source
513
5.06k
  unsigned getNumOperandBundles() const {
514
5.06k
    CALLSITE_DELEGATE_GETTER(getNumOperandBundles());
515
5.06k
  }
516
517
45.3M
  bool hasOperandBundles() const {
518
45.3M
    CALLSITE_DELEGATE_GETTER(hasOperandBundles());
519
45.3M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::hasOperandBundles() const
Line
Count
Source
517
333k
  bool hasOperandBundles() const {
518
333k
    CALLSITE_DELEGATE_GETTER(hasOperandBundles());
519
333k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::hasOperandBundles() const
Line
Count
Source
517
45.0M
  bool hasOperandBundles() const {
518
45.0M
    CALLSITE_DELEGATE_GETTER(hasOperandBundles());
519
45.0M
  }
520
521
1
  unsigned getBundleOperandsStartIndex() const {
522
1
    CALLSITE_DELEGATE_GETTER(getBundleOperandsStartIndex());
523
1
  }
524
525
1
  unsigned getBundleOperandsEndIndex() const {
526
1
    CALLSITE_DELEGATE_GETTER(getBundleOperandsEndIndex());
527
1
  }
528
529
  unsigned getNumTotalBundleOperands() const {
530
    CALLSITE_DELEGATE_GETTER(getNumTotalBundleOperands());
531
  }
532
533
2.78k
  OperandBundleUse getOperandBundleAt(unsigned Index) const {
534
2.78k
    CALLSITE_DELEGATE_GETTER(getOperandBundleAt(Index));
535
2.78k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getOperandBundleAt(unsigned int) const
Line
Count
Source
533
934
  OperandBundleUse getOperandBundleAt(unsigned Index) const {
534
934
    CALLSITE_DELEGATE_GETTER(getOperandBundleAt(Index));
535
934
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getOperandBundleAt(unsigned int) const
Line
Count
Source
533
1.84k
  OperandBundleUse getOperandBundleAt(unsigned Index) const {
534
1.84k
    CALLSITE_DELEGATE_GETTER(getOperandBundleAt(Index));
535
1.84k
  }
536
537
  Optional<OperandBundleUse> getOperandBundle(StringRef Name) const {
538
    CALLSITE_DELEGATE_GETTER(getOperandBundle(Name));
539
  }
540
541
252k
  Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
542
252k
    CALLSITE_DELEGATE_GETTER(getOperandBundle(ID));
543
252k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getOperandBundle(unsigned int) const
Line
Count
Source
541
295
  Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
542
295
    CALLSITE_DELEGATE_GETTER(getOperandBundle(ID));
543
295
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getOperandBundle(unsigned int) const
Line
Count
Source
541
252k
  Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
542
252k
    CALLSITE_DELEGATE_GETTER(getOperandBundle(ID));
543
252k
  }
544
545
650
  unsigned countOperandBundlesOfType(uint32_t ID) const {
546
650
    CALLSITE_DELEGATE_GETTER(countOperandBundlesOfType(ID));
547
650
  }
548
549
4.08M
  bool isBundleOperand(unsigned Idx) const {
550
4.08M
    CALLSITE_DELEGATE_GETTER(isBundleOperand(Idx));
551
4.08M
  }
552
553
101M
  IterTy arg_begin() const {
554
101M
    CALLSITE_DELEGATE_GETTER(arg_begin());
555
101M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::arg_begin() const
Line
Count
Source
553
19.7M
  IterTy arg_begin() const {
554
19.7M
    CALLSITE_DELEGATE_GETTER(arg_begin());
555
19.7M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::arg_begin() const
Line
Count
Source
553
82.2M
  IterTy arg_begin() const {
554
82.2M
    CALLSITE_DELEGATE_GETTER(arg_begin());
555
82.2M
  }
556
557
91.1M
  IterTy arg_end() const {
558
91.1M
    CALLSITE_DELEGATE_GETTER(arg_end());
559
91.1M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::arg_end() const
Line
Count
Source
557
79.2M
  IterTy arg_end() const {
558
79.2M
    CALLSITE_DELEGATE_GETTER(arg_end());
559
79.2M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::arg_end() const
Line
Count
Source
557
11.8M
  IterTy arg_end() const {
558
11.8M
    CALLSITE_DELEGATE_GETTER(arg_end());
559
11.8M
  }
560
561
#undef CALLSITE_DELEGATE_GETTER
562
#undef CALLSITE_DELEGATE_SETTER
563
564
29.9k
  void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const {
565
29.9k
    const Instruction *II = getInstruction();
566
29.9k
    // Since this is actually a getter that "looks like" a setter, don't use the
567
29.9k
    // above macros to avoid confusion.
568
29.9k
    if (isCall())
569
29.9k
      cast<CallInst>(II)->getOperandBundlesAsDefs(Defs);
570
29.9k
    else
571
78
      cast<InvokeInst>(II)->getOperandBundlesAsDefs(Defs);
572
29.9k
  }
573
574
  /// Determine whether this data operand is not captured.
575
14.5M
  bool doesNotCapture(unsigned OpNo) const {
576
14.5M
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::NoCapture);
577
14.5M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::doesNotCapture(unsigned int) const
Line
Count
Source
575
616k
  bool doesNotCapture(unsigned OpNo) const {
576
616k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::NoCapture);
577
616k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::doesNotCapture(unsigned int) const
Line
Count
Source
575
13.9M
  bool doesNotCapture(unsigned OpNo) const {
576
13.9M
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::NoCapture);
577
13.9M
  }
578
579
  /// Determine whether this argument is passed by value.
580
9.00M
  bool isByValArgument(unsigned ArgNo) const {
581
9.00M
    return paramHasAttr(ArgNo, Attribute::ByVal);
582
9.00M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::isByValArgument(unsigned int) const
Line
Count
Source
580
308k
  bool isByValArgument(unsigned ArgNo) const {
581
308k
    return paramHasAttr(ArgNo, Attribute::ByVal);
582
308k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::isByValArgument(unsigned int) const
Line
Count
Source
580
8.69M
  bool isByValArgument(unsigned ArgNo) const {
581
8.69M
    return paramHasAttr(ArgNo, Attribute::ByVal);
582
8.69M
  }
583
584
  /// Determine whether this argument is passed in an alloca.
585
1.12M
  bool isInAllocaArgument(unsigned ArgNo) const {
586
1.12M
    return paramHasAttr(ArgNo, Attribute::InAlloca);
587
1.12M
  }
588
589
  /// Determine whether this argument is passed by value or in an alloca.
590
212
  bool isByValOrInAllocaArgument(unsigned ArgNo) const {
591
212
    return paramHasAttr(ArgNo, Attribute::ByVal) ||
592
211
           paramHasAttr(ArgNo, Attribute::InAlloca);
593
212
  }
594
595
  /// Determine if there are is an inalloca argument. Only the last argument can
596
  /// have the inalloca attribute.
597
418k
  bool hasInAllocaArgument() const {
598
338k
    return !arg_empty() && paramHasAttr(arg_size() - 1, Attribute::InAlloca);
599
418k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::hasInAllocaArgument() const
Line
Count
Source
597
932
  bool hasInAllocaArgument() const {
598
592
    return !arg_empty() && paramHasAttr(arg_size() - 1, Attribute::InAlloca);
599
932
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::hasInAllocaArgument() const
Line
Count
Source
597
417k
  bool hasInAllocaArgument() const {
598
338k
    return !arg_empty() && paramHasAttr(arg_size() - 1, Attribute::InAlloca);
599
417k
  }
600
601
368k
  bool doesNotAccessMemory(unsigned OpNo) const {
602
368k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
603
368k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::doesNotAccessMemory(unsigned int) const
Line
Count
Source
601
64.4k
  bool doesNotAccessMemory(unsigned OpNo) const {
602
64.4k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
603
64.4k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::doesNotAccessMemory(unsigned int) const
Line
Count
Source
601
304k
  bool doesNotAccessMemory(unsigned OpNo) const {
602
304k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
603
304k
  }
604
605
204k
  bool onlyReadsMemory(unsigned OpNo) const {
606
204k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadOnly) ||
607
192k
           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
608
204k
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::onlyReadsMemory(unsigned int) const
Line
Count
Source
605
119k
  bool onlyReadsMemory(unsigned OpNo) const {
606
119k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadOnly) ||
607
111k
           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
608
119k
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::onlyReadsMemory(unsigned int) const
Line
Count
Source
605
84.6k
  bool onlyReadsMemory(unsigned OpNo) const {
606
84.6k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadOnly) ||
607
81.4k
           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
608
84.6k
  }
609
610
96.8k
  bool doesNotReadMemory(unsigned OpNo) const {
611
96.8k
    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::WriteOnly) ||
612
90.6k
           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
613
96.8k
  }
614
615
  /// Return true if the return value is known to be not null.
616
  /// This may be because it has the nonnull attribute, or because at least
617
  /// one byte is dereferenceable and the pointer is in addrspace(0).
618
13.2M
  bool isReturnNonNull() const {
619
13.2M
    if (hasRetAttr(Attribute::NonNull))
620
20.2k
      return true;
621
13.2M
    else 
if (13.2M
getDereferenceableBytes(AttributeList::ReturnIndex) > 0 &&
622
19.2k
             getType()->getPointerAddressSpace() == 0)
623
19.2k
      return true;
624
13.2M
625
13.1M
    return false;
626
13.2M
  }
627
628
  /// Returns true if this CallSite passes the given Value* as an argument to
629
  /// the called function.
630
  bool hasArgument(const Value *Arg) const {
631
    for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E;
632
         ++AI)
633
      if (AI->get() == Arg)
634
        return true;
635
    return false;
636
  }
637
638
private:
639
357M
  IterTy getCallee() const {
640
357M
    if (isCall()) // Skip Callee
641
354M
      return cast<CallInst>(getInstruction())->op_end() - 1;
642
357M
    else // Skip BB, BB, Callee
643
3.45M
      return cast<InvokeInst>(getInstruction())->op_end() - 3;
644
357M
  }
llvm::CallSiteBase<llvm::Function const, llvm::BasicBlock const, llvm::Value const, llvm::User const, llvm::Use const, llvm::Instruction const, llvm::CallInst const, llvm::InvokeInst const, llvm::Use const*>::getCallee() const
Line
Count
Source
639
230M
  IterTy getCallee() const {
640
230M
    if (isCall()) // Skip Callee
641
228M
      return cast<CallInst>(getInstruction())->op_end() - 1;
642
230M
    else // Skip BB, BB, Callee
643
2.07M
      return cast<InvokeInst>(getInstruction())->op_end() - 3;
644
230M
  }
llvm::CallSiteBase<llvm::Function, llvm::BasicBlock, llvm::Value, llvm::User, llvm::Use, llvm::Instruction, llvm::CallInst, llvm::InvokeInst, llvm::Use*>::getCallee() const
Line
Count
Source
639
126M
  IterTy getCallee() const {
640
126M
    if (isCall()) // Skip Callee
641
125M
      return cast<CallInst>(getInstruction())->op_end() - 1;
642
126M
    else // Skip BB, BB, Callee
643
1.37M
      return cast<InvokeInst>(getInstruction())->op_end() - 3;
644
126M
  }
645
};
646
647
class CallSite : public CallSiteBase<Function, BasicBlock, Value, User, Use,
648
                                     Instruction, CallInst, InvokeInst,
649
                                     User::op_iterator> {
650
public:
651
2.44M
  CallSite() = default;
652
0
  CallSite(CallSiteBase B) : CallSiteBase(B) {}
653
85.4M
  CallSite(CallInst *CI) : CallSiteBase(CI) {}
654
865k
  CallSite(InvokeInst *II) : CallSiteBase(II) {}
655
211M
  explicit CallSite(Instruction *II) : CallSiteBase(II) {}
656
421M
  explicit CallSite(Value *V) : CallSiteBase(V) {}
657
658
6.41k
  bool operator==(const CallSite &CS) const { return I == CS.I; }
659
0
  bool operator!=(const CallSite &CS) const { return I != CS.I; }
660
0
  bool operator<(const CallSite &CS) const {
661
0
    return getInstruction() < CS.getInstruction();
662
0
  }
663
664
private:
665
  friend struct DenseMapInfo<CallSite>;
666
667
  User::op_iterator getCallee() const;
668
};
669
670
template <> struct DenseMapInfo<CallSite> {
671
  using BaseInfo = DenseMapInfo<decltype(CallSite::I)>;
672
673
1.16k
  static CallSite getEmptyKey() {
674
1.16k
    CallSite CS;
675
1.16k
    CS.I = BaseInfo::getEmptyKey();
676
1.16k
    return CS;
677
1.16k
  }
678
679
589
  static CallSite getTombstoneKey() {
680
589
    CallSite CS;
681
589
    CS.I = BaseInfo::getTombstoneKey();
682
589
    return CS;
683
589
  }
684
685
240
  static unsigned getHashValue(const CallSite &CS) {
686
240
    return BaseInfo::getHashValue(CS.I);
687
240
  }
688
689
6.41k
  static bool isEqual(const CallSite &LHS, const CallSite &RHS) {
690
6.41k
    return LHS == RHS;
691
6.41k
  }
692
};
693
694
/// Establish a view to a call site for examination.
695
class ImmutableCallSite : public CallSiteBase<> {
696
public:
697
1.79M
  ImmutableCallSite() = default;
698
56.4M
  ImmutableCallSite(const CallInst *CI) : CallSiteBase(CI) {}
699
131k
  ImmutableCallSite(const InvokeInst *II) : CallSiteBase(II) {}
700
135M
  explicit ImmutableCallSite(const Instruction *II) : CallSiteBase(II) {}
701
1.35G
  explicit ImmutableCallSite(const Value *V) : CallSiteBase(V) {}
702
41.7M
  ImmutableCallSite(CallSite CS) : CallSiteBase(CS.getInstruction()) {}
703
};
704
705
} // end namespace llvm
706
707
#endif // LLVM_IR_CALLSITE_H