LLVM: lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef LLVM_LIB_TRANSFORMS_OBJCARC_ARCRUNTIMEENTRYPOINTS_H
23#define LLVM_LIB_TRANSFORMS_OBJCARC_ARCRUNTIMEENTRYPOINTS_H
24
28#include
29
30namespace llvm {
31
34
36
52
53
54
56public:
58
60 TheModule = M;
61 AutoreleaseRV = nullptr;
62 Release = nullptr;
63 Retain = nullptr;
64 RetainBlock = nullptr;
65 Autorelease = nullptr;
66 StoreStrong = nullptr;
67 RetainRV = nullptr;
68 ClaimRV = nullptr;
69 UnsafeClaimRV = nullptr;
70 RetainAutorelease = nullptr;
71 RetainAutoreleaseRV = nullptr;
72 AutoreleasePoolPush = nullptr;
73 AutoreleasePoolPop = nullptr;
74 }
75
77 assert(TheModule != nullptr && "Not initialized.");
78
79 switch (kind) {
81 return getIntrinsicEntryPoint(AutoreleaseRV,
82 Intrinsic::objc_autoreleaseReturnValue);
84 return getIntrinsicEntryPoint(Release, Intrinsic::objc_release);
86 return getIntrinsicEntryPoint(Retain, Intrinsic::objc_retain);
88 return getIntrinsicEntryPoint(RetainBlock, Intrinsic::objc_retainBlock);
90 return getIntrinsicEntryPoint(Autorelease, Intrinsic::objc_autorelease);
92 return getIntrinsicEntryPoint(StoreStrong, Intrinsic::objc_storeStrong);
94 return getIntrinsicEntryPoint(RetainRV,
95 Intrinsic::objc_retainAutoreleasedReturnValue);
97 return getIntrinsicEntryPoint(
98 ClaimRV, Intrinsic::objc_claimAutoreleasedReturnValue);
100 return getIntrinsicEntryPoint(
101 UnsafeClaimRV, Intrinsic::objc_unsafeClaimAutoreleasedReturnValue);
103 return getIntrinsicEntryPoint(RetainAutorelease,
104 Intrinsic::objc_retainAutorelease);
106 return getIntrinsicEntryPoint(RetainAutoreleaseRV,
107 Intrinsic::objc_retainAutoreleaseReturnValue);
109 return getIntrinsicEntryPoint(AutoreleasePoolPush,
110 Intrinsic::objc_autoreleasePoolPush);
112 return getIntrinsicEntryPoint(AutoreleasePoolPop,
113 Intrinsic::objc_autoreleasePoolPop);
114 }
115
117 }
118
119private:
120
121 Module *TheModule = nullptr;
122
123
125
126
128
129
131
132
134
135
137
138
140
141
143
144
146
147
149
150
152
153
155
156
158
159
161
163 if (Decl)
164 return Decl;
165
167 }
168};
169
170}
171
172}
173
174#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains the simple types necessary to represent the attributes associated with functions a...
A Module instance is used to store all the information related to an LLVM module.
ARCRuntimeEntryPoints()=default
Function * get(ARCRuntimeEntryPointKind kind)
Definition ARCRuntimeEntryPoints.h:76
void init(Module *M)
Definition ARCRuntimeEntryPoints.h:59
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
@ StoreStrong
objc_storeStrong (derived)
@ Autorelease
objc_autorelease
@ RetainRV
objc_retainAutoreleasedReturnValue
@ RetainBlock
objc_retainBlock
@ AutoreleaseRV
objc_autoreleaseReturnValue
@ UnsafeClaimRV
objc_unsafeClaimAutoreleasedReturnValue
ARCRuntimeEntryPointKind
Definition ARCRuntimeEntryPoints.h:37
@ AutoreleasePoolPush
Definition ARCRuntimeEntryPoints.h:49
@ StoreStrong
Definition ARCRuntimeEntryPoints.h:43
@ RetainAutoreleaseRV
Definition ARCRuntimeEntryPoints.h:48
@ Autorelease
Definition ARCRuntimeEntryPoints.h:42
@ RetainRV
Definition ARCRuntimeEntryPoints.h:44
@ RetainBlock
Definition ARCRuntimeEntryPoints.h:41
@ Retain
Definition ARCRuntimeEntryPoints.h:40
@ Release
Definition ARCRuntimeEntryPoints.h:39
@ ClaimRV
Definition ARCRuntimeEntryPoints.h:45
@ RetainAutorelease
Definition ARCRuntimeEntryPoints.h:47
@ AutoreleasePoolPop
Definition ARCRuntimeEntryPoints.h:50
@ AutoreleaseRV
Definition ARCRuntimeEntryPoints.h:38
@ UnsafeClaimRV
Definition ARCRuntimeEntryPoints.h:46
This is an optimization pass for GlobalISel generic memory operations.