llvm.org GIT mirror llvm / 4bbfbdf
[Modules] Move CallSite into the IR library where it belogs. It is abstracting between a CallInst and an InvokeInst, both of which are IR concepts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202816 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
51 changed file(s) with 396 addition(s) and 396 deletion(s). Raw diff Collapse all Expand all
3737 #define LLVM_ANALYSIS_ALIASANALYSIS_H
3838
3939 #include "llvm/ADT/DenseMap.h"
40 #include "llvm/Support/CallSite.h"
40 #include "llvm/IR/CallSite.h"
4141
4242 namespace llvm {
4343
5454 #include "llvm/ADT/GraphTraits.h"
5555 #include "llvm/ADT/OwningPtr.h"
5656 #include "llvm/ADT/STLExtras.h"
57 #include "llvm/IR/CallSite.h"
5758 #include "llvm/IR/Function.h"
5859 #include "llvm/Pass.h"
59 #include "llvm/Support/CallSite.h"
6060 #include "llvm/Support/IncludeFile.h"
6161 #include "llvm/Support/ValueHandle.h"
6262 #include
1515 #define LLVM_ANALYSIS_CODEMETRICS_H
1616
1717 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/Support/CallSite.h"
18 #include "llvm/IR/CallSite.h"
1919
2020 namespace llvm {
2121 class BasicBlock;
1717 #include "llvm/ADT/SmallVector.h"
1818 #include "llvm/CodeGen/ISDOpcodes.h"
1919 #include "llvm/CodeGen/ValueTypes.h"
20 #include "llvm/IR/CallSite.h"
2021 #include "llvm/IR/InlineAsm.h"
2122 #include "llvm/IR/Instructions.h"
22 #include "llvm/Support/CallSite.h"
2323
2424 namespace llvm {
2525
0 //===- CallSite.h - Abstract Call & Invoke instrs ---------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the CallSite class, which is a handy wrapper for code that
10 // wants to treat Call and Invoke instructions in a generic way. When in non-
11 // mutation context (e.g. an analysis) ImmutableCallSite should be used.
12 // Finally, when some degree of customization is necessary between these two
13 // extremes, CallSiteBase<> can be supplied with fine-tuned parameters.
14 //
15 // NOTE: These classes are supposed to have "value semantics". So they should be
16 // passed by value, not by reference; they should not be "new"ed or "delete"d.
17 // They are efficiently copyable, assignable and constructable, with cost
18 // equivalent to copying a pointer (notice that they have only a single data
19 // member). The internal representation carries a flag which indicates which of
20 // the two variants is enclosed. This allows for cheaper checks when various
21 // accessors of CallSite are employed.
22 //
23 //===----------------------------------------------------------------------===//
24
25 #ifndef LLVM_IR_CALLSITE_H
26 #define LLVM_IR_CALLSITE_H
27
28 #include "llvm/ADT/PointerIntPair.h"
29 #include "llvm/IR/Attributes.h"
30 #include "llvm/IR/CallingConv.h"
31 #include "llvm/IR/Instructions.h"
32
33 namespace llvm {
34
35 class CallInst;
36 class InvokeInst;
37
38 template
39 typename ValTy = const Value,
40 typename UserTy = const User,
41 typename InstrTy = const Instruction,
42 typename CallTy = const CallInst,
43 typename InvokeTy = const InvokeInst,
44 typename IterTy = User::const_op_iterator>
45 class CallSiteBase {
46 protected:
47 PointerIntPair I;
48 public:
49 CallSiteBase() : I(0, false) {}
50 CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
51 CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
52 CallSiteBase(ValTy *II) { *this = get(II); }
53 protected:
54 /// CallSiteBase::get - This static method is sort of like a constructor. It
55 /// will create an appropriate call site for a Call or Invoke instruction, but
56 /// it can also create a null initialized CallSiteBase object for something
57 /// which is NOT a call site.
58 ///
59 static CallSiteBase get(ValTy *V) {
60 if (InstrTy *II = dyn_cast(V)) {
61 if (II->getOpcode() == Instruction::Call)
62 return CallSiteBase(static_cast(II));
63 else if (II->getOpcode() == Instruction::Invoke)
64 return CallSiteBase(static_cast(II));
65 }
66 return CallSiteBase();
67 }
68 public:
69 /// isCall - true if a CallInst is enclosed.
70 /// Note that !isCall() does not mean it is an InvokeInst enclosed,
71 /// it also could signify a NULL Instruction pointer.
72 bool isCall() const { return I.getInt(); }
73
74 /// isInvoke - true if a InvokeInst is enclosed.
75 ///
76 bool isInvoke() const { return getInstruction() && !I.getInt(); }
77
78 InstrTy *getInstruction() const { return I.getPointer(); }
79 InstrTy *operator->() const { return I.getPointer(); }
80 LLVM_EXPLICIT operator bool() const { return I.getPointer(); }
81
82 /// getCalledValue - Return the pointer to function that is being called.
83 ///
84 ValTy *getCalledValue() const {
85 assert(getInstruction() && "Not a call or invoke instruction!");
86 return *getCallee();
87 }
88
89 /// getCalledFunction - Return the function being called if this is a direct
90 /// call, otherwise return null (if it's an indirect call).
91 ///
92 FunTy *getCalledFunction() const {
93 return dyn_cast(getCalledValue());
94 }
95
96 /// setCalledFunction - Set the callee to the specified value.
97 ///
98 void setCalledFunction(Value *V) {
99 assert(getInstruction() && "Not a call or invoke instruction!");
100 *getCallee() = V;
101 }
102
103 /// isCallee - Determine whether the passed iterator points to the
104 /// callee operand's Use.
105 ///
106 bool isCallee(value_use_iterator UI) const {
107 return getCallee() == &UI.getUse();
108 }
109
110 ValTy *getArgument(unsigned ArgNo) const {
111 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
112 return *(arg_begin() + ArgNo);
113 }
114
115 void setArgument(unsigned ArgNo, Value* newVal) {
116 assert(getInstruction() && "Not a call or invoke instruction!");
117 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
118 getInstruction()->setOperand(ArgNo, newVal);
119 }
120
121 /// Given a value use iterator, returns the argument that corresponds to it.
122 /// Iterator must actually correspond to an argument.
123 unsigned getArgumentNo(value_use_iterator I) const {
124 assert(getInstruction() && "Not a call or invoke instruction!");
125 assert(arg_begin() <= &I.getUse() && &I.getUse() < arg_end()
126 && "Argument # out of range!");
127 return &I.getUse() - arg_begin();
128 }
129
130 /// arg_iterator - The type of iterator to use when looping over actual
131 /// arguments at this call site.
132 typedef IterTy arg_iterator;
133
134 /// arg_begin/arg_end - Return iterators corresponding to the actual argument
135 /// list for a call site.
136 IterTy arg_begin() const {
137 assert(getInstruction() && "Not a call or invoke instruction!");
138 // Skip non-arguments
139 return (*this)->op_begin();
140 }
141
142 IterTy arg_end() const { return (*this)->op_end() - getArgumentEndOffset(); }
143 bool arg_empty() const { return arg_end() == arg_begin(); }
144 unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
145
146 /// getType - Return the type of the instruction that generated this call site
147 ///
148 Type *getType() const { return (*this)->getType(); }
149
150 /// getCaller - Return the caller function for this call site
151 ///
152 FunTy *getCaller() const { return (*this)->getParent()->getParent(); }
153
154 #define CALLSITE_DELEGATE_GETTER(METHOD) \
155 InstrTy *II = getInstruction(); \
156 return isCall() \
157 ? cast(II)->METHOD \
158 : cast(II)->METHOD
159
160 #define CALLSITE_DELEGATE_SETTER(METHOD) \
161 InstrTy *II = getInstruction(); \
162 if (isCall()) \
163 cast(II)->METHOD; \
164 else \
165 cast(II)->METHOD
166
167 /// getCallingConv/setCallingConv - get or set the calling convention of the
168 /// call.
169 CallingConv::ID getCallingConv() const {
170 CALLSITE_DELEGATE_GETTER(getCallingConv());
171 }
172 void setCallingConv(CallingConv::ID CC) {
173 CALLSITE_DELEGATE_SETTER(setCallingConv(CC));
174 }
175
176 /// getAttributes/setAttributes - get or set the parameter attributes of
177 /// the call.
178 const AttributeSet &getAttributes() const {
179 CALLSITE_DELEGATE_GETTER(getAttributes());
180 }
181 void setAttributes(const AttributeSet &PAL) {
182 CALLSITE_DELEGATE_SETTER(setAttributes(PAL));
183 }
184
185 /// \brief Return true if this function has the given attribute.
186 bool hasFnAttr(Attribute::AttrKind A) const {
187 CALLSITE_DELEGATE_GETTER(hasFnAttr(A));
188 }
189
190 /// \brief Return true if the call or the callee has the given attribute.
191 bool paramHasAttr(unsigned i, Attribute::AttrKind A) const {
192 CALLSITE_DELEGATE_GETTER(paramHasAttr(i, A));
193 }
194
195 /// @brief Extract the alignment for a call or parameter (0=unknown).
196 uint16_t getParamAlignment(uint16_t i) const {
197 CALLSITE_DELEGATE_GETTER(getParamAlignment(i));
198 }
199
200 /// \brief Return true if the call should not be treated as a call to a
201 /// builtin.
202 bool isNoBuiltin() const {
203 CALLSITE_DELEGATE_GETTER(isNoBuiltin());
204 }
205
206 /// @brief Return true if the call should not be inlined.
207 bool isNoInline() const {
208 CALLSITE_DELEGATE_GETTER(isNoInline());
209 }
210 void setIsNoInline(bool Value = true) {
211 CALLSITE_DELEGATE_SETTER(setIsNoInline(Value));
212 }
213
214 /// @brief Determine if the call does not access memory.
215 bool doesNotAccessMemory() const {
216 CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
217 }
218 void setDoesNotAccessMemory() {
219 CALLSITE_DELEGATE_SETTER(setDoesNotAccessMemory());
220 }
221
222 /// @brief Determine if the call does not access or only reads memory.
223 bool onlyReadsMemory() const {
224 CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
225 }
226 void setOnlyReadsMemory() {
227 CALLSITE_DELEGATE_SETTER(setOnlyReadsMemory());
228 }
229
230 /// @brief Determine if the call cannot return.
231 bool doesNotReturn() const {
232 CALLSITE_DELEGATE_GETTER(doesNotReturn());
233 }
234 void setDoesNotReturn() {
235 CALLSITE_DELEGATE_SETTER(setDoesNotReturn());
236 }
237
238 /// @brief Determine if the call cannot unwind.
239 bool doesNotThrow() const {
240 CALLSITE_DELEGATE_GETTER(doesNotThrow());
241 }
242 void setDoesNotThrow() {
243 CALLSITE_DELEGATE_SETTER(setDoesNotThrow());
244 }
245
246 #undef CALLSITE_DELEGATE_GETTER
247 #undef CALLSITE_DELEGATE_SETTER
248
249 /// @brief Determine whether this argument is not captured.
250 bool doesNotCapture(unsigned ArgNo) const {
251 return paramHasAttr(ArgNo + 1, Attribute::NoCapture);
252 }
253
254 /// @brief Determine whether this argument is passed by value.
255 bool isByValArgument(unsigned ArgNo) const {
256 return paramHasAttr(ArgNo + 1, Attribute::ByVal);
257 }
258
259 /// @brief Determine whether this argument is passed in an alloca.
260 bool isInAllocaArgument(unsigned ArgNo) const {
261 return paramHasAttr(ArgNo + 1, Attribute::InAlloca);
262 }
263
264 /// @brief Determine whether this argument is passed by value or in an alloca.
265 bool isByValOrInAllocaArgument(unsigned ArgNo) const {
266 return paramHasAttr(ArgNo + 1, Attribute::ByVal) ||
267 paramHasAttr(ArgNo + 1, Attribute::InAlloca);
268 }
269
270 /// @brief Determine if there are is an inalloca argument. Only the last
271 /// argument can have the inalloca attribute.
272 bool hasInAllocaArgument() const {
273 return paramHasAttr(arg_size(), Attribute::InAlloca);
274 }
275
276 bool doesNotAccessMemory(unsigned ArgNo) const {
277 return paramHasAttr(ArgNo + 1, Attribute::ReadNone);
278 }
279
280 bool onlyReadsMemory(unsigned ArgNo) const {
281 return paramHasAttr(ArgNo + 1, Attribute::ReadOnly) ||
282 paramHasAttr(ArgNo + 1, Attribute::ReadNone);
283 }
284
285 /// hasArgument - Returns true if this CallSite passes the given Value* as an
286 /// argument to the called function.
287 bool hasArgument(const Value *Arg) const {
288 for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E;
289 ++AI)
290 if (AI->get() == Arg)
291 return true;
292 return false;
293 }
294
295 private:
296 unsigned getArgumentEndOffset() const {
297 if (isCall())
298 return 1; // Skip Callee
299 else
300 return 3; // Skip BB, BB, Callee
301 }
302
303 IterTy getCallee() const {
304 if (isCall()) // Skip Callee
305 return cast(getInstruction())->op_end() - 1;
306 else // Skip BB, BB, Callee
307 return cast(getInstruction())->op_end() - 3;
308 }
309 };
310
311 class CallSite : public CallSiteBase
312 CallInst, InvokeInst, User::op_iterator> {
313 typedef CallSiteBase
314 CallInst, InvokeInst, User::op_iterator> Base;
315 public:
316 CallSite() {}
317 CallSite(Base B) : Base(B) {}
318 CallSite(Value* V) : Base(V) {}
319 CallSite(CallInst *CI) : Base(CI) {}
320 CallSite(InvokeInst *II) : Base(II) {}
321 CallSite(Instruction *II) : Base(II) {}
322
323 bool operator==(const CallSite &CS) const { return I == CS.I; }
324 bool operator!=(const CallSite &CS) const { return I != CS.I; }
325 bool operator<(const CallSite &CS) const {
326 return getInstruction() < CS.getInstruction();
327 }
328
329 private:
330 User::op_iterator getCallee() const;
331 };
332
333 /// ImmutableCallSite - establish a view to a call site for examination
334 class ImmutableCallSite : public CallSiteBase<> {
335 typedef CallSiteBase<> Base;
336 public:
337 ImmutableCallSite(const Value* V) : Base(V) {}
338 ImmutableCallSite(const CallInst *CI) : Base(CI) {}
339 ImmutableCallSite(const InvokeInst *II) : Base(II) {}
340 ImmutableCallSite(const Instruction *II) : Base(II) {}
341 ImmutableCallSite(CallSite CS) : Base(CS.getInstruction()) {}
342 };
343
344 } // End llvm namespace
345
346 #endif
1010 #ifndef LLVM_INSTVISITOR_H
1111 #define LLVM_INSTVISITOR_H
1212
13 #include "llvm/IR/CallSite.h"
1314 #include "llvm/IR/Function.h"
1415 #include "llvm/IR/Instructions.h"
1516 #include "llvm/IR/IntrinsicInst.h"
1617 #include "llvm/IR/Intrinsics.h"
1718 #include "llvm/IR/Module.h"
18 #include "llvm/Support/CallSite.h"
1919 #include "llvm/Support/ErrorHandling.h"
2020
2121 namespace llvm {
+0
-347
include/llvm/Support/CallSite.h less more
None //===-- llvm/Support/CallSite.h - Abstract Call & Invoke instrs -*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the CallSite class, which is a handy wrapper for code that
10 // wants to treat Call and Invoke instructions in a generic way. When in non-
11 // mutation context (e.g. an analysis) ImmutableCallSite should be used.
12 // Finally, when some degree of customization is necessary between these two
13 // extremes, CallSiteBase<> can be supplied with fine-tuned parameters.
14 //
15 // NOTE: These classes are supposed to have "value semantics". So they should be
16 // passed by value, not by reference; they should not be "new"ed or "delete"d.
17 // They are efficiently copyable, assignable and constructable, with cost
18 // equivalent to copying a pointer (notice that they have only a single data
19 // member). The internal representation carries a flag which indicates which of
20 // the two variants is enclosed. This allows for cheaper checks when various
21 // accessors of CallSite are employed.
22 //
23 //===----------------------------------------------------------------------===//
24
25 #ifndef LLVM_SUPPORT_CALLSITE_H
26 #define LLVM_SUPPORT_CALLSITE_H
27
28 #include "llvm/ADT/PointerIntPair.h"
29 #include "llvm/IR/Attributes.h"
30 #include "llvm/IR/CallingConv.h"
31 #include "llvm/IR/Instructions.h"
32
33 namespace llvm {
34
35 class CallInst;
36 class InvokeInst;
37
38 template
39 typename ValTy = const Value,
40 typename UserTy = const User,
41 typename InstrTy = const Instruction,
42 typename CallTy = const CallInst,
43 typename InvokeTy = const InvokeInst,
44 typename IterTy = User::const_op_iterator>
45 class CallSiteBase {
46 protected:
47 PointerIntPair I;
48 public:
49 CallSiteBase() : I(0, false) {}
50 CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
51 CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
52 CallSiteBase(ValTy *II) { *this = get(II); }
53 protected:
54 /// CallSiteBase::get - This static method is sort of like a constructor. It
55 /// will create an appropriate call site for a Call or Invoke instruction, but
56 /// it can also create a null initialized CallSiteBase object for something
57 /// which is NOT a call site.
58 ///
59 static CallSiteBase get(ValTy *V) {
60 if (InstrTy *II = dyn_cast(V)) {
61 if (II->getOpcode() == Instruction::Call)
62 return CallSiteBase(static_cast(II));
63 else if (II->getOpcode() == Instruction::Invoke)
64 return CallSiteBase(static_cast(II));
65 }
66 return CallSiteBase();
67 }
68 public:
69 /// isCall - true if a CallInst is enclosed.
70 /// Note that !isCall() does not mean it is an InvokeInst enclosed,
71 /// it also could signify a NULL Instruction pointer.
72 bool isCall() const { return I.getInt(); }
73
74 /// isInvoke - true if a InvokeInst is enclosed.
75 ///
76 bool isInvoke() const { return getInstruction() && !I.getInt(); }
77
78 InstrTy *getInstruction() const { return I.getPointer(); }
79 InstrTy *operator->() const { return I.getPointer(); }
80 LLVM_EXPLICIT operator bool() const { return I.getPointer(); }
81
82 /// getCalledValue - Return the pointer to function that is being called.
83 ///
84 ValTy *getCalledValue() const {
85 assert(getInstruction() && "Not a call or invoke instruction!");
86 return *getCallee();
87 }
88
89 /// getCalledFunction - Return the function being called if this is a direct
90 /// call, otherwise return null (if it's an indirect call).
91 ///
92 FunTy *getCalledFunction() const {
93 return dyn_cast(getCalledValue());
94 }
95
96 /// setCalledFunction - Set the callee to the specified value.
97 ///
98 void setCalledFunction(Value *V) {
99 assert(getInstruction() && "Not a call or invoke instruction!");
100 *getCallee() = V;
101 }
102
103 /// isCallee - Determine whether the passed iterator points to the
104 /// callee operand's Use.
105 ///
106 bool isCallee(value_use_iterator UI) const {
107 return getCallee() == &UI.getUse();
108 }
109
110 ValTy *getArgument(unsigned ArgNo) const {
111 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
112 return *(arg_begin() + ArgNo);
113 }
114
115 void setArgument(unsigned ArgNo, Value* newVal) {
116 assert(getInstruction() && "Not a call or invoke instruction!");
117 assert(arg_begin() + ArgNo < arg_end() && "Argument # out of range!");
118 getInstruction()->setOperand(ArgNo, newVal);
119 }
120
121 /// Given a value use iterator, returns the argument that corresponds to it.
122 /// Iterator must actually correspond to an argument.
123 unsigned getArgumentNo(value_use_iterator I) const {
124 assert(getInstruction() && "Not a call or invoke instruction!");
125 assert(arg_begin() <= &I.getUse() && &I.getUse() < arg_end()
126 && "Argument # out of range!");
127 return &I.getUse() - arg_begin();
128 }
129
130 /// arg_iterator - The type of iterator to use when looping over actual
131 /// arguments at this call site.
132 typedef IterTy arg_iterator;
133
134 /// arg_begin/arg_end - Return iterators corresponding to the actual argument
135 /// list for a call site.
136 IterTy arg_begin() const {
137 assert(getInstruction() && "Not a call or invoke instruction!");
138 // Skip non-arguments
139 return (*this)->op_begin();
140 }
141
142 IterTy arg_end() const { return (*this)->op_end() - getArgumentEndOffset(); }
143 bool arg_empty() const { return arg_end() == arg_begin(); }
144 unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
145
146 /// getType - Return the type of the instruction that generated this call site
147 ///
148 Type *getType() const { return (*this)->getType(); }
149
150 /// getCaller - Return the caller function for this call site
151 ///
152 FunTy *getCaller() const { return (*this)->getParent()->getParent(); }
153
154 #define CALLSITE_DELEGATE_GETTER(METHOD) \
155 InstrTy *II = getInstruction(); \
156 return isCall() \
157 ? cast(II)->METHOD \
158 : cast(II)->METHOD
159
160 #define CALLSITE_DELEGATE_SETTER(METHOD) \
161 InstrTy *II = getInstruction(); \
162 if (isCall()) \
163 cast(II)->METHOD; \
164 else \
165 cast(II)->METHOD
166
167 /// getCallingConv/setCallingConv - get or set the calling convention of the
168 /// call.
169 CallingConv::ID getCallingConv() const {
170 CALLSITE_DELEGATE_GETTER(getCallingConv());
171 }
172 void setCallingConv(CallingConv::ID CC) {
173 CALLSITE_DELEGATE_SETTER(setCallingConv(CC));
174 }
175
176 /// getAttributes/setAttributes - get or set the parameter attributes of
177 /// the call.
178 const AttributeSet &getAttributes() const {
179 CALLSITE_DELEGATE_GETTER(getAttributes());
180 }
181 void setAttributes(const AttributeSet &PAL) {
182 CALLSITE_DELEGATE_SETTER(setAttributes(PAL));
183 }
184
185 /// \brief Return true if this function has the given attribute.
186 bool hasFnAttr(Attribute::AttrKind A) const {
187 CALLSITE_DELEGATE_GETTER(hasFnAttr(A));
188 }
189
190 /// \brief Return true if the call or the callee has the given attribute.
191 bool paramHasAttr(unsigned i, Attribute::AttrKind A) const {
192 CALLSITE_DELEGATE_GETTER(paramHasAttr(i, A));
193 }
194
195 /// @brief Extract the alignment for a call or parameter (0=unknown).
196 uint16_t getParamAlignment(uint16_t i) const {
197 CALLSITE_DELEGATE_GETTER(getParamAlignment(i));
198 }
199
200 /// \brief Return true if the call should not be treated as a call to a
201 /// builtin.
202 bool isNoBuiltin() const {
203 CALLSITE_DELEGATE_GETTER(isNoBuiltin());
204 }
205
206 /// @brief Return true if the call should not be inlined.
207 bool isNoInline() const {
208 CALLSITE_DELEGATE_GETTER(isNoInline());
209 }
210 void setIsNoInline(bool Value = true) {
211 CALLSITE_DELEGATE_SETTER(setIsNoInline(Value));
212 }
213
214 /// @brief Determine if the call does not access memory.
215 bool doesNotAccessMemory() const {
216 CALLSITE_DELEGATE_GETTER(doesNotAccessMemory());
217 }
218 void setDoesNotAccessMemory() {
219 CALLSITE_DELEGATE_SETTER(setDoesNotAccessMemory());
220 }
221
222 /// @brief Determine if the call does not access or only reads memory.
223 bool onlyReadsMemory() const {
224 CALLSITE_DELEGATE_GETTER(onlyReadsMemory());
225 }
226 void setOnlyReadsMemory() {
227 CALLSITE_DELEGATE_SETTER(setOnlyReadsMemory());
228 }
229
230 /// @brief Determine if the call cannot return.
231 bool doesNotReturn() const {
232 CALLSITE_DELEGATE_GETTER(doesNotReturn());
233 }
234 void setDoesNotReturn() {
235 CALLSITE_DELEGATE_SETTER(setDoesNotReturn());
236 }
237
238 /// @brief Determine if the call cannot unwind.
239 bool doesNotThrow() const {
240 CALLSITE_DELEGATE_GETTER(doesNotThrow());
241 }
242 void setDoesNotThrow() {
243 CALLSITE_DELEGATE_SETTER(setDoesNotThrow());
244 }
245
246 #undef CALLSITE_DELEGATE_GETTER
247 #undef CALLSITE_DELEGATE_SETTER
248
249 /// @brief Determine whether this argument is not captured.
250 bool doesNotCapture(unsigned ArgNo) const {
251 return paramHasAttr(ArgNo + 1, Attribute::NoCapture);
252 }
253
254 /// @brief Determine whether this argument is passed by value.
255 bool isByValArgument(unsigned ArgNo) const {
256 return paramHasAttr(ArgNo + 1, Attribute::ByVal);
257 }
258
259 /// @brief Determine whether this argument is passed in an alloca.
260 bool isInAllocaArgument(unsigned ArgNo) const {
261 return paramHasAttr(ArgNo + 1, Attribute::InAlloca);
262 }
263
264 /// @brief Determine whether this argument is passed by value or in an alloca.
265 bool isByValOrInAllocaArgument(unsigned ArgNo) const {
266 return paramHasAttr(ArgNo + 1, Attribute::ByVal) ||
267 paramHasAttr(ArgNo + 1, Attribute::InAlloca);
268 }
269
270 /// @brief Determine if there are is an inalloca argument. Only the last
271 /// argument can have the inalloca attribute.
272 bool hasInAllocaArgument() const {
273 return paramHasAttr(arg_size(), Attribute::InAlloca);
274 }
275
276 bool doesNotAccessMemory(unsigned ArgNo) const {
277 return paramHasAttr(ArgNo + 1, Attribute::ReadNone);
278 }
279
280 bool onlyReadsMemory(unsigned ArgNo) const {
281 return paramHasAttr(ArgNo + 1, Attribute::ReadOnly) ||
282 paramHasAttr(ArgNo + 1, Attribute::ReadNone);
283 }
284
285 /// hasArgument - Returns true if this CallSite passes the given Value* as an
286 /// argument to the called function.
287 bool hasArgument(const Value *Arg) const {
288 for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E;
289 ++AI)
290 if (AI->get() == Arg)
291 return true;
292 return false;
293 }
294
295 private:
296 unsigned getArgumentEndOffset() const {
297 if (isCall())
298 return 1; // Skip Callee
299 else
300 return 3; // Skip BB, BB, Callee
301 }
302
303 IterTy getCallee() const {
304 if (isCall()) // Skip Callee
305 return cast(getInstruction())->op_end() - 1;
306 else // Skip BB, BB, Callee
307 return cast(getInstruction())->op_end() - 3;
308 }
309 };
310
311 class CallSite : public CallSiteBase
312 CallInst, InvokeInst, User::op_iterator> {
313 typedef CallSiteBase
314 CallInst, InvokeInst, User::op_iterator> Base;
315 public:
316 CallSite() {}
317 CallSite(Base B) : Base(B) {}
318 CallSite(Value* V) : Base(V) {}
319 CallSite(CallInst *CI) : Base(CI) {}
320 CallSite(InvokeInst *II) : Base(II) {}
321 CallSite(Instruction *II) : Base(II) {}
322
323 bool operator==(const CallSite &CS) const { return I == CS.I; }
324 bool operator!=(const CallSite &CS) const { return I != CS.I; }
325 bool operator<(const CallSite &CS) const {
326 return getInstruction() < CS.getInstruction();
327 }
328
329 private:
330 User::op_iterator getCallee() const;
331 };
332
333 /// ImmutableCallSite - establish a view to a call site for examination
334 class ImmutableCallSite : public CallSiteBase<> {
335 typedef CallSiteBase<> Base;
336 public:
337 ImmutableCallSite(const Value* V) : Base(V) {}
338 ImmutableCallSite(const CallInst *CI) : Base(CI) {}
339 ImmutableCallSite(const InvokeInst *II) : Base(II) {}
340 ImmutableCallSite(const Instruction *II) : Base(II) {}
341 ImmutableCallSite(CallSite CS) : Base(CS.getInstruction()) {}
342 };
343
344 } // End llvm namespace
345
346 #endif
2828 #ifndef LLVM_SUPPORT_PATTERNMATCH_H
2929 #define LLVM_SUPPORT_PATTERNMATCH_H
3030
31 #include "llvm/IR/CallSite.h"
3132 #include "llvm/IR/Constants.h"
3233 #include "llvm/IR/Instructions.h"
3334 #include "llvm/IR/IntrinsicInst.h"
3435 #include "llvm/IR/Operator.h"
35 #include "llvm/Support/CallSite.h"
3636
3737 namespace llvm {
3838 namespace PatternMatch {
2727 #include "llvm/CodeGen/RuntimeLibcalls.h"
2828 #include "llvm/CodeGen/SelectionDAGNodes.h"
2929 #include "llvm/IR/Attributes.h"
30 #include "llvm/IR/CallSite.h"
3031 #include "llvm/IR/CallingConv.h"
3132 #include "llvm/IR/InlineAsm.h"
32 #include "llvm/Support/CallSite.h"
3333 #include "llvm/Target/TargetCallingConv.h"
3434 #include "llvm/Target/TargetMachine.h"
3535 #include
1919 #include "llvm/ADT/SmallVector.h"
2020 #include "llvm/Analysis/AliasAnalysis.h"
2121 #include "llvm/Analysis/CaptureTracking.h"
22 #include "llvm/IR/CallSite.h"
2223 #include "llvm/IR/Constants.h"
2324 #include "llvm/IR/Instructions.h"
24 #include "llvm/Support/CallSite.h"
2525
2626 using namespace llvm;
2727
1212
1313 #include "llvm/Analysis/CodeMetrics.h"
1414 #include "llvm/Analysis/TargetTransformInfo.h"
15 #include "llvm/IR/CallSite.h"
1516 #include "llvm/IR/DataLayout.h"
1617 #include "llvm/IR/Function.h"
1718 #include "llvm/IR/IntrinsicInst.h"
18 #include "llvm/Support/CallSite.h"
1919
2020 using namespace llvm;
2121
77 //===----------------------------------------------------------------------===//
88
99 #include "llvm/Analysis/CallGraph.h"
10 #include "llvm/IR/CallSite.h"
1011 #include "llvm/IR/Instructions.h"
1112 #include "llvm/IR/IntrinsicInst.h"
1213 #include "llvm/IR/Module.h"
13 #include "llvm/Support/CallSite.h"
1414 #include "llvm/Support/Debug.h"
1515 #include "llvm/Support/raw_ostream.h"
1616 using namespace llvm;
2020 #include "llvm/Analysis/ConstantFolding.h"
2121 #include "llvm/Analysis/InstructionSimplify.h"
2222 #include "llvm/Analysis/TargetTransformInfo.h"
23 #include "llvm/IR/CallSite.h"
2324 #include "llvm/IR/CallingConv.h"
2425 #include "llvm/IR/DataLayout.h"
2526 #include "llvm/IR/GetElementPtrTypeIterator.h"
2728 #include "llvm/IR/IntrinsicInst.h"
2829 #include "llvm/IR/Operator.h"
2930 #include "llvm/InstVisitor.h"
30 #include "llvm/Support/CallSite.h"
3131 #include "llvm/Support/Debug.h"
3232 #include "llvm/Support/raw_ostream.h"
3333
88
99 #include "llvm/Analysis/LazyCallGraph.h"
1010 #include "llvm/ADT/SCCIterator.h"
11 #include "llvm/IR/CallSite.h"
1112 #include "llvm/IR/Instructions.h"
1213 #include "llvm/IR/PassManager.h"
1314 #include "llvm/InstVisitor.h"
14 #include "llvm/Support/CallSite.h"
1515 #include "llvm/Support/raw_ostream.h"
1616
1717 using namespace llvm;
4141 #include "llvm/Analysis/Loads.h"
4242 #include "llvm/Analysis/Passes.h"
4343 #include "llvm/Analysis/ValueTracking.h"
44 #include "llvm/IR/CallSite.h"
4445 #include "llvm/IR/DataLayout.h"
4546 #include "llvm/IR/Dominators.h"
4647 #include "llvm/IR/Function.h"
4849 #include "llvm/InstVisitor.h"
4950 #include "llvm/Pass.h"
5051 #include "llvm/PassManager.h"
51 #include "llvm/Support/CallSite.h"
5252 #include "llvm/Support/Debug.h"
5353 #include "llvm/Support/raw_ostream.h"
5454 #include "llvm/Target/TargetLibraryInfo.h"
1212 #include "llvm/Analysis/Passes.h"
1313 #include "llvm/ADT/SetVector.h"
1414 #include "llvm/Analysis/MemoryDependenceAnalysis.h"
15 #include "llvm/IR/CallSite.h"
1516 #include "llvm/IR/InstIterator.h"
1617 #include "llvm/IR/LLVMContext.h"
17 #include "llvm/Support/CallSite.h"
1818 #include "llvm/Support/ErrorHandling.h"
1919 #include "llvm/Support/raw_ostream.h"
2020 using namespace llvm;
88
99 #define DEBUG_TYPE "tti"
1010 #include "llvm/Analysis/TargetTransformInfo.h"
11 #include "llvm/IR/CallSite.h"
1112 #include "llvm/IR/DataLayout.h"
1213 #include "llvm/IR/Instruction.h"
1314 #include "llvm/IR/Instructions.h"
1415 #include "llvm/IR/IntrinsicInst.h"
1516 #include "llvm/IR/Operator.h"
16 #include "llvm/Support/CallSite.h"
1717 #include "llvm/Support/ErrorHandling.h"
1818
1919 using namespace llvm;
1919 #include "llvm/ADT/Statistic.h"
2020 #include "llvm/ADT/ValueMap.h"
2121 #include "llvm/Analysis/InstructionSimplify.h"
22 #include "llvm/IR/CallSite.h"
2223 #include "llvm/IR/Constants.h"
2324 #include "llvm/IR/DataLayout.h"
2425 #include "llvm/IR/DerivedTypes.h"
3031 #include "llvm/IR/Instructions.h"
3132 #include "llvm/IR/IntrinsicInst.h"
3233 #include "llvm/Pass.h"
33 #include "llvm/Support/CallSite.h"
3434 #include "llvm/Support/CommandLine.h"
3535 #include "llvm/Support/Debug.h"
3636 #include "llvm/Support/PatternMatch.h"
1414 #define DEBUG_TYPE "dwarfehprepare"
1515 #include "llvm/CodeGen/Passes.h"
1616 #include "llvm/ADT/Statistic.h"
17 #include "llvm/IR/CallSite.h"
1718 #include "llvm/IR/Dominators.h"
1819 #include "llvm/IR/Function.h"
1920 #include "llvm/IR/Instructions.h"
2122 #include "llvm/IR/Module.h"
2223 #include "llvm/MC/MCAsmInfo.h"
2324 #include "llvm/Pass.h"
24 #include "llvm/Support/CallSite.h"
2525 #include "llvm/Target/TargetLowering.h"
2626 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
2727 #include "llvm/Transforms/Utils/SSAUpdater.h"
1212
1313 #include "llvm/CodeGen/IntrinsicLowering.h"
1414 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/IR/CallSite.h"
1516 #include "llvm/IR/Constants.h"
1617 #include "llvm/IR/DataLayout.h"
1718 #include "llvm/IR/DerivedTypes.h"
1819 #include "llvm/IR/IRBuilder.h"
1920 #include "llvm/IR/Module.h"
2021 #include "llvm/IR/Type.h"
21 #include "llvm/Support/CallSite.h"
2222 #include "llvm/Support/ErrorHandling.h"
2323 #include "llvm/Support/raw_ostream.h"
2424 using namespace llvm;
1818 #include "llvm/CodeGen/SelectionDAG.h"
1919 #include "llvm/CodeGen/SelectionDAGNodes.h"
2020 #include "llvm/CodeGen/ValueTypes.h"
21 #include "llvm/IR/CallSite.h"
2122 #include "llvm/IR/Constants.h"
22 #include "llvm/Support/CallSite.h"
2323 #include "llvm/Support/ErrorHandling.h"
2424 #include
2525
2828 #include "llvm/CodeGen/GCs.h"
2929 #include "llvm/ADT/StringExtras.h"
3030 #include "llvm/CodeGen/GCStrategy.h"
31 #include "llvm/IR/CallSite.h"
3132 #include "llvm/IR/IRBuilder.h"
3233 #include "llvm/IR/IntrinsicInst.h"
3334 #include "llvm/IR/Module.h"
34 #include "llvm/Support/CallSite.h"
3535
3636 using namespace llvm;
3737
1515
1616 #include "llvm/ExecutionEngine/ExecutionEngine.h"
1717 #include "llvm/ExecutionEngine/GenericValue.h"
18 #include "llvm/IR/CallSite.h"
1819 #include "llvm/IR/DataLayout.h"
1920 #include "llvm/IR/Function.h"
2021 #include "llvm/InstVisitor.h"
21 #include "llvm/Support/CallSite.h"
2222 #include "llvm/Support/DataTypes.h"
2323 #include "llvm/Support/ErrorHandling.h"
2424 #include "llvm/Support/raw_ostream.h"
1212
1313 #include "llvm/AutoUpgrade.h"
1414 #include "llvm/DebugInfo.h"
15 #include "llvm/IR/CallSite.h"
1516 #include "llvm/IR/Constants.h"
1617 #include "llvm/IR/DiagnosticInfo.h"
1718 #include "llvm/IR/Function.h"
2122 #include "llvm/IR/LLVMContext.h"
2223 #include "llvm/IR/Module.h"
2324 #include "llvm/Support/CFG.h"
24 #include "llvm/Support/CallSite.h"
2525 #include "llvm/Support/ErrorHandling.h"
2626 #include
2727 using namespace llvm;
1414 #include "llvm-c/Core.h"
1515 #include "llvm/Bitcode/ReaderWriter.h"
1616 #include "llvm/IR/Attributes.h"
17 #include "llvm/IR/CallSite.h"
1718 #include "llvm/IR/Constants.h"
1819 #include "llvm/IR/DerivedTypes.h"
1920 #include "llvm/IR/GlobalAlias.h"
2425 #include "llvm/IR/LLVMContext.h"
2526 #include "llvm/IR/Module.h"
2627 #include "llvm/PassManager.h"
27 #include "llvm/Support/CallSite.h"
2828 #include "llvm/Support/Debug.h"
2929 #include "llvm/Support/ErrorHandling.h"
3030 #include "llvm/Support/ManagedStatic.h"
1717 #include "llvm/ADT/STLExtras.h"
1818 #include "llvm/ADT/StringExtras.h"
1919 #include "llvm/CodeGen/ValueTypes.h"
20 #include "llvm/IR/CallSite.h"
2021 #include "llvm/IR/DerivedTypes.h"
2122 #include "llvm/IR/InstIterator.h"
2223 #include "llvm/IR/IntrinsicInst.h"
2324 #include "llvm/IR/LLVMContext.h"
2425 #include "llvm/IR/Module.h"
25 #include "llvm/Support/CallSite.h"
2626 #include "llvm/Support/LeakDetector.h"
2727 #include "llvm/Support/ManagedStatic.h"
2828 #include "llvm/Support/RWMutex.h"
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "llvm/IR/Instruction.h"
14 #include "llvm/IR/CallSite.h"
1415 #include "llvm/IR/Constants.h"
1516 #include "llvm/IR/Instructions.h"
1617 #include "llvm/IR/Module.h"
1718 #include "llvm/IR/Operator.h"
1819 #include "llvm/IR/Type.h"
19 #include "llvm/Support/CallSite.h"
2020 #include "llvm/Support/LeakDetector.h"
2121 using namespace llvm;
2222
1313
1414 #include "llvm/IR/Instructions.h"
1515 #include "LLVMContextImpl.h"
16 #include "llvm/IR/CallSite.h"
1617 #include "llvm/IR/Constants.h"
1718 #include "llvm/IR/DataLayout.h"
1819 #include "llvm/IR/DerivedTypes.h"
1920 #include "llvm/IR/Function.h"
2021 #include "llvm/IR/Module.h"
2122 #include "llvm/IR/Operator.h"
22 #include "llvm/Support/CallSite.h"
2323 #include "llvm/Support/ConstantRange.h"
2424 #include "llvm/Support/ErrorHandling.h"
2525 #include "llvm/Support/MathExtras.h"
5151 #include "llvm/ADT/SmallVector.h"
5252 #include "llvm/ADT/StringExtras.h"
5353 #include "llvm/DebugInfo.h"
54 #include "llvm/IR/CallSite.h"
5455 #include "llvm/IR/CallingConv.h"
5556 #include "llvm/IR/Constants.h"
5657 #include "llvm/IR/DataLayout.h"
6566 #include "llvm/InstVisitor.h"
6667 #include "llvm/Pass.h"
6768 #include "llvm/Support/CFG.h"
68 #include "llvm/Support/CallSite.h"
6969 #include "llvm/Support/CommandLine.h"
7070 #include "llvm/Support/ConstantRange.h"
7171 #include "llvm/Support/Debug.h"
2929 #include "llvm/CodeGen/MachineMemOperand.h"
3030 #include "llvm/CodeGen/MachineModuleInfo.h"
3131 #include "llvm/CodeGen/MachineRegisterInfo.h"
32 #include "llvm/IR/CallSite.h"
3233 #include "llvm/IR/CallingConv.h"
3334 #include "llvm/IR/DataLayout.h"
3435 #include "llvm/IR/DerivedTypes.h"
3839 #include "llvm/IR/IntrinsicInst.h"
3940 #include "llvm/IR/Module.h"
4041 #include "llvm/IR/Operator.h"
41 #include "llvm/Support/CallSite.h"
4242 #include "llvm/Support/CommandLine.h"
4343 #include "llvm/Support/ErrorHandling.h"
4444 #include "llvm/Target/TargetInstrInfo.h"
2121 #include "llvm/CodeGen/MachineInstrBuilder.h"
2222 #include "llvm/CodeGen/MachineRegisterInfo.h"
2323 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
24 #include "llvm/IR/CallSite.h"
2425 #include "llvm/IR/DerivedTypes.h"
2526 #include "llvm/IR/Function.h"
2627 #include "llvm/IR/GlobalValue.h"
2829 #include "llvm/IR/Intrinsics.h"
2930 #include "llvm/IR/Module.h"
3031 #include "llvm/MC/MCSectionELF.h"
31 #include "llvm/Support/CallSite.h"
3232 #include "llvm/Support/CommandLine.h"
3333 #include "llvm/Support/Debug.h"
3434 #include "llvm/Support/ErrorHandling.h"
2525 #include "llvm/CodeGen/MachineConstantPool.h"
2626 #include "llvm/CodeGen/MachineFrameInfo.h"
2727 #include "llvm/CodeGen/MachineRegisterInfo.h"
28 #include "llvm/IR/CallSite.h"
2829 #include "llvm/IR/CallingConv.h"
2930 #include "llvm/IR/DerivedTypes.h"
3031 #include "llvm/IR/GetElementPtrTypeIterator.h"
3334 #include "llvm/IR/Instructions.h"
3435 #include "llvm/IR/IntrinsicInst.h"
3536 #include "llvm/IR/Operator.h"
36 #include "llvm/Support/CallSite.h"
3737 #include "llvm/Support/ErrorHandling.h"
3838 #include "llvm/Target/TargetOptions.h"
3939 using namespace llvm;
3030 #include "llvm/CodeGen/MachineJumpTableInfo.h"
3131 #include "llvm/CodeGen/MachineModuleInfo.h"
3232 #include "llvm/CodeGen/MachineRegisterInfo.h"
33 #include "llvm/IR/CallSite.h"
3334 #include "llvm/IR/CallingConv.h"
3435 #include "llvm/IR/Constants.h"
3536 #include "llvm/IR/DerivedTypes.h"
4243 #include "llvm/MC/MCContext.h"
4344 #include "llvm/MC/MCExpr.h"
4445 #include "llvm/MC/MCSymbol.h"
45 #include "llvm/Support/CallSite.h"
4646 #include "llvm/Support/Debug.h"
4747 #include "llvm/Support/ErrorHandling.h"
4848 #include "llvm/Support/MathExtras.h"
3636 #include "llvm/Analysis/AliasAnalysis.h"
3737 #include "llvm/Analysis/CallGraph.h"
3838 #include "llvm/Analysis/CallGraphSCCPass.h"
39 #include "llvm/IR/CallSite.h"
3940 #include "llvm/IR/Constants.h"
4041 #include "llvm/IR/DerivedTypes.h"
4142 #include "llvm/IR/Instructions.h"
4243 #include "llvm/IR/LLVMContext.h"
4344 #include "llvm/IR/Module.h"
4445 #include "llvm/Support/CFG.h"
45 #include "llvm/Support/CallSite.h"
4646 #include "llvm/Support/Debug.h"
4747 #include "llvm/Support/raw_ostream.h"
4848 #include
2424 #include "llvm/ADT/StringExtras.h"
2525 #include "llvm/DIBuilder.h"
2626 #include "llvm/DebugInfo.h"
27 #include "llvm/IR/CallSite.h"
2728 #include "llvm/IR/CallingConv.h"
2829 #include "llvm/IR/Constant.h"
2930 #include "llvm/IR/DerivedTypes.h"
3233 #include "llvm/IR/LLVMContext.h"
3334 #include "llvm/IR/Module.h"
3435 #include "llvm/Pass.h"
35 #include "llvm/Support/CallSite.h"
3636 #include "llvm/Support/Debug.h"
3737 #include "llvm/Support/raw_ostream.h"
3838 #include
2121 #include "llvm/ADT/Statistic.h"
2222 #include "llvm/Analysis/ConstantFolding.h"
2323 #include "llvm/Analysis/MemoryBuiltins.h"
24 #include "llvm/IR/CallSite.h"
2425 #include "llvm/IR/CallingConv.h"
2526 #include "llvm/IR/Constants.h"
2627 #include "llvm/IR/DataLayout.h"
3132 #include "llvm/IR/Module.h"
3233 #include "llvm/IR/Operator.h"
3334 #include "llvm/Pass.h"
34 #include "llvm/Support/CallSite.h"
3535 #include "llvm/Support/Debug.h"
3636 #include "llvm/Support/ErrorHandling.h"
3737 #include "llvm/Support/MathExtras.h"
1919 #include "llvm/ADT/SmallVector.h"
2020 #include "llvm/ADT/Statistic.h"
2121 #include "llvm/Analysis/ValueTracking.h"
22 #include "llvm/IR/CallSite.h"
2223 #include "llvm/IR/Constants.h"
2324 #include "llvm/IR/Instructions.h"
2425 #include "llvm/IR/Module.h"
2526 #include "llvm/Pass.h"
26 #include "llvm/Support/CallSite.h"
2727 using namespace llvm;
2828
2929 STATISTIC(NumArgumentsProped, "Number of args turned into constants");
1616 #include "llvm/ADT/SmallPtrSet.h"
1717 #include "llvm/Analysis/CallGraph.h"
1818 #include "llvm/Analysis/InlineCost.h"
19 #include "llvm/IR/CallSite.h"
1920 #include "llvm/IR/CallingConv.h"
2021 #include "llvm/IR/DataLayout.h"
2122 #include "llvm/IR/Instructions.h"
2223 #include "llvm/IR/IntrinsicInst.h"
2324 #include "llvm/IR/Module.h"
2425 #include "llvm/IR/Type.h"
25 #include "llvm/Support/CallSite.h"
2626 #include "llvm/Transforms/IPO/InlinerPass.h"
2727
2828 using namespace llvm;
1414 #include "llvm/Transforms/IPO.h"
1515 #include "llvm/Analysis/CallGraph.h"
1616 #include "llvm/Analysis/InlineCost.h"
17 #include "llvm/IR/CallSite.h"
1718 #include "llvm/IR/CallingConv.h"
1819 #include "llvm/IR/DataLayout.h"
1920 #include "llvm/IR/Instructions.h"
2021 #include "llvm/IR/IntrinsicInst.h"
2122 #include "llvm/IR/Module.h"
2223 #include "llvm/IR/Type.h"
23 #include "llvm/Support/CallSite.h"
2424 #include "llvm/Transforms/IPO/InlinerPass.h"
2525
2626 using namespace llvm;
1818 #include "llvm/ADT/Statistic.h"
1919 #include "llvm/Analysis/CallGraph.h"
2020 #include "llvm/Analysis/InlineCost.h"
21 #include "llvm/IR/CallSite.h"
2122 #include "llvm/IR/DataLayout.h"
2223 #include "llvm/IR/Instructions.h"
2324 #include "llvm/IR/IntrinsicInst.h"
2425 #include "llvm/IR/Module.h"
25 #include "llvm/Support/CallSite.h"
2626 #include "llvm/Support/CommandLine.h"
2727 #include "llvm/Support/Debug.h"
2828 #include "llvm/Support/raw_ostream.h"
4949 #include "llvm/ADT/STLExtras.h"
5050 #include "llvm/ADT/SmallSet.h"
5151 #include "llvm/ADT/Statistic.h"
52 #include "llvm/IR/CallSite.h"
5253 #include "llvm/IR/Constants.h"
5354 #include "llvm/IR/DataLayout.h"
5455 #include "llvm/IR/IRBuilder.h"
5859 #include "llvm/IR/Module.h"
5960 #include "llvm/IR/Operator.h"
6061 #include "llvm/Pass.h"
61 #include "llvm/Support/CallSite.h"
6262 #include "llvm/Support/Debug.h"
6363 #include "llvm/Support/ErrorHandling.h"
6464 #include "llvm/Support/ValueHandle.h"
1313 #include "InstCombine.h"
1414 #include "llvm/ADT/Statistic.h"
1515 #include "llvm/Analysis/MemoryBuiltins.h"
16 #include "llvm/IR/CallSite.h"
1617 #include "llvm/IR/DataLayout.h"
17 #include "llvm/Support/CallSite.h"
1818 #include "llvm/Support/PatternMatch.h"
1919 #include "llvm/Transforms/Utils/BuildLibCalls.h"
2020 #include "llvm/Transforms/Utils/Local.h"
2626 #include "llvm/ADT/StringExtras.h"
2727 #include "llvm/ADT/Triple.h"
2828 #include "llvm/DIBuilder.h"
29 #include "llvm/IR/CallSite.h"
2930 #include "llvm/IR/DataLayout.h"
3031 #include "llvm/IR/Function.h"
3132 #include "llvm/IR/IRBuilder.h"
3637 #include "llvm/IR/Module.h"
3738 #include "llvm/IR/Type.h"
3839 #include "llvm/InstVisitor.h"
39 #include "llvm/Support/CallSite.h"
4040 #include "llvm/Support/CommandLine.h"
4141 #include "llvm/Support/DataTypes.h"
4242 #include "llvm/Support/Debug.h"
2626 #include "llvm/Analysis/AliasAnalysis.h"
2727 #include "llvm/Analysis/Passes.h"
2828 #include "llvm/Analysis/ValueTracking.h"
29 #include "llvm/IR/CallSite.h"
2930 #include "llvm/IR/InstIterator.h"
3031 #include "llvm/IR/Module.h"
3132 #include "llvm/Pass.h"
32 #include "llvm/Support/CallSite.h"
3333 #include "llvm/Transforms/ObjCARC.h"
3434 #include "llvm/Transforms/Utils/Local.h"
3535
2525 #include "llvm/ADT/SmallVector.h"
2626 #include "llvm/ADT/Statistic.h"
2727 #include "llvm/Analysis/ConstantFolding.h"
28 #include "llvm/IR/CallSite.h"
2829 #include "llvm/IR/Constants.h"
2930 #include "llvm/IR/DataLayout.h"
3031 #include "llvm/IR/DerivedTypes.h"
3132 #include "llvm/IR/Instructions.h"
3233 #include "llvm/InstVisitor.h"
3334 #include "llvm/Pass.h"
34 #include "llvm/Support/CallSite.h"
3535 #include "llvm/Support/Debug.h"
3636 #include "llvm/Support/ErrorHandling.h"
3737 #include "llvm/Support/raw_ostream.h"
2727 #include "llvm/Analysis/ValueTracking.h"
2828 #include "llvm/DIBuilder.h"
2929 #include "llvm/DebugInfo.h"
30 #include "llvm/IR/CallSite.h"
3031 #include "llvm/IR/Constants.h"
3132 #include "llvm/IR/DataLayout.h"
3233 #include "llvm/IR/DerivedTypes.h"
4142 #include "llvm/IR/Module.h"
4243 #include "llvm/IR/Operator.h"
4344 #include "llvm/Pass.h"
44 #include "llvm/Support/CallSite.h"
4545 #include "llvm/Support/Debug.h"
4646 #include "llvm/Support/ErrorHandling.h"
4747 #include "llvm/Support/MathExtras.h"
5959 #include "llvm/Analysis/InstructionSimplify.h"
6060 #include "llvm/Analysis/Loads.h"
6161 #include "llvm/Analysis/TargetTransformInfo.h"
62 #include "llvm/IR/CallSite.h"
6263 #include "llvm/IR/Constants.h"
6364 #include "llvm/IR/DerivedTypes.h"
6465 #include "llvm/IR/Function.h"
6768 #include "llvm/IR/Module.h"
6869 #include "llvm/Pass.h"
6970 #include "llvm/Support/CFG.h"
70 #include "llvm/Support/CallSite.h"
7171 #include "llvm/Support/Debug.h"
7272 #include "llvm/Support/ValueHandle.h"
7373 #include "llvm/Support/raw_ostream.h"
88
99 #include "llvm/ADT/SmallPtrSet.h"
1010 #include "llvm/IR/BasicBlock.h"
11 #include "llvm/IR/CallSite.h"
1112 #include "llvm/IR/GlobalVariable.h"
1213 #include "llvm/IR/IntrinsicInst.h"
13 #include "llvm/Support/CallSite.h"
1414 #include "llvm/Transforms/Utils/GlobalStatus.h"
1515
1616 using namespace llvm;
1818 #include "llvm/Analysis/InstructionSimplify.h"
1919 #include "llvm/DebugInfo.h"
2020 #include "llvm/IR/Attributes.h"
21 #include "llvm/IR/CallSite.h"
2122 #include "llvm/IR/Constants.h"
2223 #include "llvm/IR/DataLayout.h"
2324 #include "llvm/IR/DerivedTypes.h"
2627 #include "llvm/IR/IntrinsicInst.h"
2728 #include "llvm/IR/Intrinsics.h"
2829 #include "llvm/IR/Module.h"
29 #include "llvm/Support/CallSite.h"
3030 #include "llvm/Transforms/Utils/Local.h"
3131 using namespace llvm;
3232
1717 #include "llvm/ADT/SmallVector.h"
1818 #include "llvm/ADT/StringRef.h"
1919 #include "llvm/ADT/StringSet.h"
20 #include "llvm/IR/CallSite.h"
2021 #include "llvm/IR/Constants.h"
2122 #include "llvm/IR/Function.h"
2223 #include "llvm/IR/Instructions.h"
2324 #include "llvm/IR/Module.h"
2425 #include "llvm/Support/CFG.h"
25 #include "llvm/Support/CallSite.h"
2626 #include "llvm/Support/ErrorHandling.h"
2727 #include "llvm/Support/raw_ostream.h"
2828 #include "llvm/Support/type_traits.h"
1717 //===----------------------------------------------------------------------===//
1818
1919 #include "llvm/Analysis/CallGraph.h"
20 #include "llvm/IR/CallSite.h"
2021 #include "llvm/IR/Module.h"
2122 #include "llvm/Pass.h"
22 #include "llvm/Support/CallSite.h"
2323 #include "llvm/Support/raw_ostream.h"
2424 using namespace llvm;
2525