@@ -18,36 +18,47 @@ namespace llvm {
18
18
19
19
namespace LibFunc {
20
20
enum Func {
21
+ // / int __cxa_atexit(void (*f)(void *), void *p, void *d);
22
+ cxa_atexit,
23
+ // / void __cxa_guard_abort(guard_t *guard);
24
+ // / guard_t is int64_t in Itanium ABI or int32_t on ARM eabi.
25
+ cxa_guard_abort,
26
+ // / int __cxa_guard_acquire(guard_t *guard);
27
+ cxa_guard_acquire,
28
+ // / void __cxa_guard_release(guard_t *guard);
29
+ cxa_guard_release,
30
+ // / void *__memcpy_chk(void *s1, const void *s2, size_t n, size_t s1size);
31
+ memcpy_chk,
21
32
// / double acos(double x);
22
33
acos,
23
- // / long double acosl(long double x);
24
- acosl,
25
34
// / float acosf(float x);
26
35
acosf,
36
+ // / long double acosl(long double x);
37
+ acosl,
27
38
// / double asin(double x);
28
39
asin,
29
- // / long double asinl(long double x);
30
- asinl,
31
40
// / float asinf(float x);
32
41
asinf,
42
+ // / long double asinl(long double x);
43
+ asinl,
33
44
// / double atan(double x);
34
45
atan,
35
- // / long double atanl(long double x);
36
- atanl,
37
- // / float atanf(float x);
38
- atanf,
39
46
// / double atan2(double y, double x);
40
47
atan2,
41
- // / long double atan2l(long double y, long double x);
42
- atan2l,
43
48
// / float atan2f(float y, float x);
44
49
atan2f,
50
+ // / long double atan2l(long double y, long double x);
51
+ atan2l,
52
+ // / float atanf(float x);
53
+ atanf,
54
+ // / long double atanl(long double x);
55
+ atanl,
45
56
// / double ceil(double x);
46
57
ceil,
47
- // / long double ceill(long double x);
48
- ceill,
49
58
// / float ceilf(float x);
50
59
ceilf,
60
+ // / long double ceill(long double x);
61
+ ceill,
51
62
// / double copysign(double x, double y);
52
63
copysign,
53
64
// / float copysignf(float x, float y);
@@ -56,54 +67,54 @@ namespace llvm {
56
67
copysignl,
57
68
// / double cos(double x);
58
69
cos,
59
- // / long double cosl(long double x);
60
- cosl,
61
70
// / float cosf(float x);
62
71
cosf,
63
72
// / double cosh(double x);
64
73
cosh,
65
- // / long double coshl(long double x);
66
- coshl,
67
74
// / float coshf(float x);
68
75
coshf,
76
+ // / long double coshl(long double x);
77
+ coshl,
78
+ // / long double cosl(long double x);
79
+ cosl,
69
80
// / double exp(double x);
70
81
exp,
71
- // / long double expl(long double x);
72
- expl,
73
- // / float expf(float x);
74
- expf,
75
82
// / double exp2(double x);
76
83
exp2,
77
- // / long double exp2l(long double x);
78
- exp2l,
79
84
// / float exp2f(float x);
80
85
exp2f,
86
+ // / long double exp2l(long double x);
87
+ exp2l,
88
+ // / float expf(float x);
89
+ expf,
90
+ // / long double expl(long double x);
91
+ expl,
81
92
// / double expm1(double x);
82
93
expm1,
83
- // / long double expm1l(long double x);
84
- expm1l,
85
94
// / float expm1f(float x);
86
95
expm1f,
96
+ // / long double expm1l(long double x);
97
+ expm1l,
87
98
// / double fabs(double x);
88
99
fabs,
89
- // / long double fabsl(long double x);
90
- fabsl,
91
100
// / float fabsf(float x);
92
101
fabsf,
102
+ // / long double fabsl(long double x);
103
+ fabsl,
104
+ // / int fiprintf(FILE *stream, const char *format, ...);
105
+ fiprintf,
93
106
// / double floor(double x);
94
107
floor,
95
- // / long double floorl(long double x);
96
- floorl,
97
108
// / float floorf(float x);
98
109
floorf,
99
- // / int fiprintf(FILE *stream, const char *format, ... );
100
- fiprintf ,
110
+ // / long double floorl(long double x );
111
+ floorl ,
101
112
// / double fmod(double x, double y);
102
113
fmod,
103
- // / long double fmodl(long double x, long double y);
104
- fmodl,
105
114
// / float fmodf(float x, float y);
106
115
fmodf,
116
+ // / long double fmodl(long double x, long double y);
117
+ fmodl,
107
118
// / int fputc(int c, FILE *stream);
108
119
fputc,
109
120
// / int fputs(const char *s, FILE *stream);
@@ -115,28 +126,28 @@ namespace llvm {
115
126
iprintf,
116
127
// / double log(double x);
117
128
log,
118
- // / long double logl(long double x);
119
- logl,
120
- // / float logf(float x);
121
- logf,
122
- // / double log2(double x);
123
- log2,
124
- // / double long double log2l(long double x);
125
- log2l,
126
- // / float log2f(float x);
127
- log2f,
128
129
// / double log10(double x);
129
130
log10,
130
- // / long double log10l(long double x);
131
- log10l,
132
131
// / float log10f(float x);
133
132
log10f,
133
+ // / long double log10l(long double x);
134
+ log10l,
134
135
// / double log1p(double x);
135
136
log1p,
136
- // / long double log1pl(long double x);
137
- log1pl,
138
137
// / float log1pf(float x);
139
138
log1pf,
139
+ // / long double log1pl(long double x);
140
+ log1pl,
141
+ // / double log2(double x);
142
+ log2,
143
+ // / float log2f(float x);
144
+ log2f,
145
+ // / double long double log2l(long double x);
146
+ log2l,
147
+ // / float logf(float x);
148
+ logf,
149
+ // / long double logl(long double x);
150
+ logl,
140
151
// / void *memchr(const void *s, int c, size_t n);
141
152
memchr,
142
153
// / int memcmp(const void *s1, const void *s2, size_t n);
@@ -179,24 +190,24 @@ namespace llvm {
179
190
roundl,
180
191
// / double sin(double x);
181
192
sin,
182
- // / long double sinl(long double x);
183
- sinl,
184
193
// / float sinf(float x);
185
194
sinf,
186
195
// / double sinh(double x);
187
196
sinh,
188
- // / long double sinhl(long double x);
189
- sinhl,
190
197
// / float sinhf(float x);
191
198
sinhf,
199
+ // / long double sinhl(long double x);
200
+ sinhl,
201
+ // / long double sinl(long double x);
202
+ sinl,
192
203
// / int siprintf(char *str, const char *format, ...);
193
204
siprintf,
194
205
// / double sqrt(double x);
195
206
sqrt,
196
- // / long double sqrtl(long double x);
197
- sqrtl,
198
207
// / float sqrtf(float x);
199
208
sqrtf,
209
+ // / long double sqrtl(long double x);
210
+ sqrtl,
200
211
// / char *strcat(char *s1, const char *s2);
201
212
strcat,
202
213
// / char *strchr(const char *s, int c);
@@ -215,33 +226,22 @@ namespace llvm {
215
226
strnlen,
216
227
// / double tan(double x);
217
228
tan,
218
- // / long double tanl(long double x);
219
- tanl,
220
229
// / float tanf(float x);
221
230
tanf,
222
231
// / double tanh(double x);
223
232
tanh,
224
- // / long double tanhl(long double x);
225
- tanhl,
226
233
// / float tanhf(float x);
227
234
tanhf,
235
+ // / long double tanhl(long double x);
236
+ tanhl,
237
+ // / long double tanl(long double x);
238
+ tanl,
228
239
// / double trunc(double x);
229
240
trunc,
230
241
// / float truncf(float x);
231
242
truncf,
232
243
// / long double truncl(long double x);
233
244
truncl,
234
- // / int __cxa_atexit(void (*f)(void *), void *p, void *d);
235
- cxa_atexit,
236
- // / void __cxa_guard_abort(guard_t *guard);
237
- // / guard_t is int64_t in Itanium ABI or int32_t on ARM eabi.
238
- cxa_guard_abort,
239
- // / int __cxa_guard_acquire(guard_t *guard);
240
- cxa_guard_acquire,
241
- // / void __cxa_guard_release(guard_t *guard);
242
- cxa_guard_release,
243
- // / void *__memcpy_chk(void *s1, const void *s2, size_t n, size_t s1size);
244
- memcpy_chk,
245
245
246
246
NumLibFuncs
247
247
};
@@ -275,6 +275,10 @@ class TargetLibraryInfo : public ImmutablePass {
275
275
TargetLibraryInfo (const Triple &T);
276
276
explicit TargetLibraryInfo (const TargetLibraryInfo &TLI);
277
277
278
+ // / getLibFunc - Search for a particular function name. If it is one of the
279
+ // / known library functions, return true and set F to the corresponding value.
280
+ bool getLibFunc (StringRef funcName, LibFunc::Func &F) const ;
281
+
278
282
// / has - This function is used by optimizations that want to match on or form
279
283
// / a given library function.
280
284
bool has (LibFunc::Func F) const {
0 commit comments