@@ -26,7 +26,7 @@ public function register(): void {
26
26
27
27
);
28
28
$ fn___cfcd208495d565ef66e7dff9f98764da = $ this ->context ->module ->addFunction ('__mm__malloc ' , $ fntype___cfcd208495d565ef66e7dff9f98764da );
29
- $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
29
+ $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (\ PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
30
30
31
31
32
32
@@ -44,7 +44,7 @@ public function register(): void {
44
44
45
45
);
46
46
$ fn___cfcd208495d565ef66e7dff9f98764da = $ this ->context ->module ->addFunction ('__mm__realloc ' , $ fntype___cfcd208495d565ef66e7dff9f98764da );
47
- $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
47
+ $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (\ PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
48
48
49
49
50
50
@@ -62,7 +62,7 @@ public function register(): void {
62
62
63
63
);
64
64
$ fn___cfcd208495d565ef66e7dff9f98764da = $ this ->context ->module ->addFunction ('__mm__free ' , $ fntype___cfcd208495d565ef66e7dff9f98764da );
65
- $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
65
+ $ fn___cfcd208495d565ef66e7dff9f98764da ->addAttributeAtIndex (\ PHPLLVM \Attribute::INDEX_FUNCTION , $ this ->context ->attributes ['alwaysinline ' ]);
66
66
67
67
68
68
@@ -169,69 +169,69 @@ public function realloc(PHPLLVM\Value $value, PHPLLVM\Value $extra): PHPLLVM\Val
169
169
$ __kind = $ __type ->getKind ();
170
170
$ __value = $ value ;
171
171
switch ($ __kind ) {
172
- case PHPLLVM \Type::KIND_INTEGER :
172
+ case \ PHPLLVM \Type::KIND_INTEGER :
173
173
if (!is_object ($ __value )) {
174
174
$ void = $ __type ->constInt ($ __value , false );
175
175
break ;
176
176
}
177
177
$ __other_type = $ __value ->typeOf ();
178
178
switch ($ __other_type ->getKind ()) {
179
- case PHPLLVM \Type::KIND_INTEGER :
179
+ case \ PHPLLVM \Type::KIND_INTEGER :
180
180
if ($ __other_type ->getWidth () >= $ __type ->getWidth ()) {
181
181
$ void = $ this ->context ->builder ->truncOrBitCast ($ __value , $ __type );
182
182
} else {
183
183
$ void = $ this ->context ->builder ->zExtOrBitCast ($ __value , $ __type );
184
184
}
185
185
break ;
186
- case PHPLLVM \Type::KIND_DOUBLE :
186
+ case \ PHPLLVM \Type::KIND_DOUBLE :
187
187
$ void = $ this ->context ->builder ->fpToUi ($ __value , $ __type );
188
188
189
189
190
190
break ;
191
- case PHPLLVM \Type::KIND_ARRAY :
192
- case PHPLLVM \Type::KIND_POINTER :
191
+ case \ PHPLLVM \Type::KIND_ARRAY :
192
+ case \ PHPLLVM \Type::KIND_POINTER :
193
193
$ void = $ this ->context ->builder ->ptrToInt ($ __value , $ __type );
194
194
break ;
195
195
default :
196
196
throw new \LogicException ("Unknown how to handle type pair (int, " . $ __other_type ->toString () . ") " );
197
197
}
198
198
break ;
199
- case PHPLLVM \Type::KIND_DOUBLE :
199
+ case \ PHPLLVM \Type::KIND_DOUBLE :
200
200
if (!is_object ($ __value )) {
201
201
$ void = $ __type ->constReal ($ value );
202
202
break ;
203
203
}
204
204
$ __other_type = $ __value ->typeOf ();
205
205
switch ($ __other_type ->getKind ()) {
206
- case PHPLLVM \Type::KIND_INTEGER :
206
+ case \ PHPLLVM \Type::KIND_INTEGER :
207
207
$ void = $ this ->context ->builder ->uiToFp ($ __value , $ __type );
208
208
209
209
210
210
break ;
211
- case PHPLLVM \Type::KIND_DOUBLE :
211
+ case \ PHPLLVM \Type::KIND_DOUBLE :
212
212
$ void = $ this ->context ->builder ->fpCast ($ __value , $ __type );
213
213
break ;
214
214
default :
215
215
throw new \LogicException ("Unknown how to handle type pair (double, " . $ __other_type ->toString () . ") " );
216
216
}
217
217
break ;
218
- case PHPLLVM \Type::KIND_ARRAY :
219
- case PHPLLVM \Type::KIND_POINTER :
218
+ case \ PHPLLVM \Type::KIND_ARRAY :
219
+ case \ PHPLLVM \Type::KIND_POINTER :
220
220
if (!is_object ($ __value )) {
221
221
// this is very likely very wrong...
222
222
$ void = $ __type ->constInt ($ __value , false );
223
223
break ;
224
224
}
225
225
$ __other_type = $ __value ->typeOf ();
226
226
switch ($ __other_type ->getKind ()) {
227
- case PHPLLVM \Type::KIND_INTEGER :
227
+ case \ PHPLLVM \Type::KIND_INTEGER :
228
228
$ void = $ this ->context ->builder ->intToPtr ($ __value , $ __type );
229
229
break ;
230
- case PHPLLVM \Type::KIND_ARRAY :
230
+ case \ PHPLLVM \Type::KIND_ARRAY :
231
231
// $__tmp = $this->context->builder->($__value, $this->context->context->int64Type());
232
232
// $(result) = $this->context->builder->intToPtr($__tmp, $__type);
233
233
// break;
234
- case PHPLLVM \Type::KIND_POINTER :
234
+ case \ PHPLLVM \Type::KIND_POINTER :
235
235
$ void = $ this ->context ->builder ->pointerCast ($ __value , $ __type );
236
236
break ;
237
237
default :
@@ -258,69 +258,69 @@ public function free(PHPLLVM\Value $value): void {
258
258
$ __kind = $ __type ->getKind ();
259
259
$ __value = $ value ;
260
260
switch ($ __kind ) {
261
- case PHPLLVM \Type::KIND_INTEGER :
261
+ case \ PHPLLVM \Type::KIND_INTEGER :
262
262
if (!is_object ($ __value )) {
263
263
$ void = $ __type ->constInt ($ __value , false );
264
264
break ;
265
265
}
266
266
$ __other_type = $ __value ->typeOf ();
267
267
switch ($ __other_type ->getKind ()) {
268
- case PHPLLVM \Type::KIND_INTEGER :
268
+ case \ PHPLLVM \Type::KIND_INTEGER :
269
269
if ($ __other_type ->getWidth () >= $ __type ->getWidth ()) {
270
270
$ void = $ this ->context ->builder ->truncOrBitCast ($ __value , $ __type );
271
271
} else {
272
272
$ void = $ this ->context ->builder ->zExtOrBitCast ($ __value , $ __type );
273
273
}
274
274
break ;
275
- case PHPLLVM \Type::KIND_DOUBLE :
275
+ case \ PHPLLVM \Type::KIND_DOUBLE :
276
276
277
277
$ void = $ this ->context ->builder ->fpToSi ($ __value , $ __type );
278
278
279
279
break ;
280
- case PHPLLVM \Type::KIND_ARRAY :
281
- case PHPLLVM \Type::KIND_POINTER :
280
+ case \ PHPLLVM \Type::KIND_ARRAY :
281
+ case \ PHPLLVM \Type::KIND_POINTER :
282
282
$ void = $ this ->context ->builder ->ptrToInt ($ __value , $ __type );
283
283
break ;
284
284
default :
285
285
throw new \LogicException ("Unknown how to handle type pair (int, " . $ __other_type ->toString () . ") " );
286
286
}
287
287
break ;
288
- case PHPLLVM \Type::KIND_DOUBLE :
288
+ case \ PHPLLVM \Type::KIND_DOUBLE :
289
289
if (!is_object ($ __value )) {
290
290
$ void = $ __type ->constReal ($ value );
291
291
break ;
292
292
}
293
293
$ __other_type = $ __value ->typeOf ();
294
294
switch ($ __other_type ->getKind ()) {
295
- case PHPLLVM \Type::KIND_INTEGER :
295
+ case \ PHPLLVM \Type::KIND_INTEGER :
296
296
297
297
$ void = $ this ->context ->builder ->siToFp ($ __value , $ __type );
298
298
299
299
break ;
300
- case PHPLLVM \Type::KIND_DOUBLE :
300
+ case \ PHPLLVM \Type::KIND_DOUBLE :
301
301
$ void = $ this ->context ->builder ->fpCast ($ __value , $ __type );
302
302
break ;
303
303
default :
304
304
throw new \LogicException ("Unknown how to handle type pair (double, " . $ __other_type ->toString () . ") " );
305
305
}
306
306
break ;
307
- case PHPLLVM \Type::KIND_ARRAY :
308
- case PHPLLVM \Type::KIND_POINTER :
307
+ case \ PHPLLVM \Type::KIND_ARRAY :
308
+ case \ PHPLLVM \Type::KIND_POINTER :
309
309
if (!is_object ($ __value )) {
310
310
// this is very likely very wrong...
311
311
$ void = $ __type ->constInt ($ __value , false );
312
312
break ;
313
313
}
314
314
$ __other_type = $ __value ->typeOf ();
315
315
switch ($ __other_type ->getKind ()) {
316
- case PHPLLVM \Type::KIND_INTEGER :
316
+ case \ PHPLLVM \Type::KIND_INTEGER :
317
317
$ void = $ this ->context ->builder ->intToPtr ($ __value , $ __type );
318
318
break ;
319
- case PHPLLVM \Type::KIND_ARRAY :
319
+ case \ PHPLLVM \Type::KIND_ARRAY :
320
320
// $__tmp = $this->context->builder->($__value, $this->context->context->int64Type());
321
321
// $(result) = $this->context->builder->intToPtr($__tmp, $__type);
322
322
// break;
323
- case PHPLLVM \Type::KIND_POINTER :
323
+ case \ PHPLLVM \Type::KIND_POINTER :
324
324
$ void = $ this ->context ->builder ->pointerCast ($ __value , $ __type );
325
325
break ;
326
326
default :
0 commit comments