Skip to content

Commit f1b2195

Browse files
committed
Fix merge conflict
2 parents 7f5e48b + a7c27de commit f1b2195

File tree

14 files changed

+763
-763
lines changed

14 files changed

+763
-763
lines changed

lib/JIT.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function compileBlock(Block $block, ?string $funcName = null): PHPLLVM\V
146146
$lcname = strtolower($funcName);
147147
$this->context->functions[$lcname] = $func;
148148
if ($isVarArgs) {
149-
$this->context->functionProxies[$lcname] = new JIT\Call\Vararg($func, $funcName, $args, count($args));
149+
$this->context->functionProxies[$lcname] = new JIT\Call\Vararg($func, $funcName, count($args));
150150
} else {
151151
$this->context->functionProxies[$lcname] = new JIT\Call\Native($func, $funcName, $args);
152152
}
@@ -580,4 +580,4 @@ private function assignOperandValue(Operand $result, PHPLLVM\Value $value): void
580580
$result->addref();
581581
}
582582

583-
}
583+
}

lib/JIT.pre

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class JIT {
143143
$lcname = strtolower($funcName);
144144
$this->context->functions[$lcname] = $func;
145145
if ($isVarArgs) {
146-
$this->context->functionProxies[$lcname] = new JIT\Call\Vararg($func, $funcName, $args, count($args));
146+
$this->context->functionProxies[$lcname] = new JIT\Call\Vararg($func, $funcName, count($args));
147147
} else {
148148
$this->context->functionProxies[$lcname] = new JIT\Call\Native($func, $funcName, $args);
149149
}
@@ -520,4 +520,4 @@ class JIT {
520520
$result->addref();
521521
}
522522

523-
}
523+
}

lib/JIT/Builtin/MemoryManager.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function register(): void {
2626

2727
);
2828
$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']);
3030

3131

3232

@@ -44,7 +44,7 @@ public function register(): void {
4444

4545
);
4646
$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']);
4848

4949

5050

@@ -62,7 +62,7 @@ public function register(): void {
6262

6363
);
6464
$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']);
6666

6767

6868

@@ -169,69 +169,69 @@ public function realloc(PHPLLVM\Value $value, PHPLLVM\Value $extra): PHPLLVM\Val
169169
$__kind = $__type->getKind();
170170
$__value = $value;
171171
switch ($__kind) {
172-
case PHPLLVM\Type::KIND_INTEGER:
172+
case \PHPLLVM\Type::KIND_INTEGER:
173173
if (!is_object($__value)) {
174174
$void = $__type->constInt($__value, false);
175175
break;
176176
}
177177
$__other_type = $__value->typeOf();
178178
switch ($__other_type->getKind()) {
179-
case PHPLLVM\Type::KIND_INTEGER:
179+
case \PHPLLVM\Type::KIND_INTEGER:
180180
if ($__other_type->getWidth() >= $__type->getWidth()) {
181181
$void = $this->context->builder->truncOrBitCast($__value, $__type);
182182
} else {
183183
$void = $this->context->builder->zExtOrBitCast($__value, $__type);
184184
}
185185
break;
186-
case PHPLLVM\Type::KIND_DOUBLE:
186+
case \PHPLLVM\Type::KIND_DOUBLE:
187187
$void = $this->context->builder->fpToUi($__value, $__type);
188188

189189

190190
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:
193193
$void = $this->context->builder->ptrToInt($__value, $__type);
194194
break;
195195
default:
196196
throw new \LogicException("Unknown how to handle type pair (int, " . $__other_type->toString() . ")");
197197
}
198198
break;
199-
case PHPLLVM\Type::KIND_DOUBLE:
199+
case \PHPLLVM\Type::KIND_DOUBLE:
200200
if (!is_object($__value)) {
201201
$void = $__type->constReal($value);
202202
break;
203203
}
204204
$__other_type = $__value->typeOf();
205205
switch ($__other_type->getKind()) {
206-
case PHPLLVM\Type::KIND_INTEGER:
206+
case \PHPLLVM\Type::KIND_INTEGER:
207207
$void = $this->context->builder->uiToFp($__value, $__type);
208208

209209

210210
break;
211-
case PHPLLVM\Type::KIND_DOUBLE:
211+
case \PHPLLVM\Type::KIND_DOUBLE:
212212
$void = $this->context->builder->fpCast($__value, $__type);
213213
break;
214214
default:
215215
throw new \LogicException("Unknown how to handle type pair (double, " . $__other_type->toString() . ")");
216216
}
217217
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:
220220
if (!is_object($__value)) {
221221
// this is very likely very wrong...
222222
$void = $__type->constInt($__value, false);
223223
break;
224224
}
225225
$__other_type = $__value->typeOf();
226226
switch ($__other_type->getKind()) {
227-
case PHPLLVM\Type::KIND_INTEGER:
227+
case \PHPLLVM\Type::KIND_INTEGER:
228228
$void = $this->context->builder->intToPtr($__value, $__type);
229229
break;
230-
case PHPLLVM\Type::KIND_ARRAY:
230+
case \PHPLLVM\Type::KIND_ARRAY:
231231
// $__tmp = $this->context->builder->($__value, $this->context->context->int64Type());
232232
// $(result) = $this->context->builder->intToPtr($__tmp, $__type);
233233
// break;
234-
case PHPLLVM\Type::KIND_POINTER:
234+
case \PHPLLVM\Type::KIND_POINTER:
235235
$void = $this->context->builder->pointerCast($__value, $__type);
236236
break;
237237
default:
@@ -258,69 +258,69 @@ public function free(PHPLLVM\Value $value): void {
258258
$__kind = $__type->getKind();
259259
$__value = $value;
260260
switch ($__kind) {
261-
case PHPLLVM\Type::KIND_INTEGER:
261+
case \PHPLLVM\Type::KIND_INTEGER:
262262
if (!is_object($__value)) {
263263
$void = $__type->constInt($__value, false);
264264
break;
265265
}
266266
$__other_type = $__value->typeOf();
267267
switch ($__other_type->getKind()) {
268-
case PHPLLVM\Type::KIND_INTEGER:
268+
case \PHPLLVM\Type::KIND_INTEGER:
269269
if ($__other_type->getWidth() >= $__type->getWidth()) {
270270
$void = $this->context->builder->truncOrBitCast($__value, $__type);
271271
} else {
272272
$void = $this->context->builder->zExtOrBitCast($__value, $__type);
273273
}
274274
break;
275-
case PHPLLVM\Type::KIND_DOUBLE:
275+
case \PHPLLVM\Type::KIND_DOUBLE:
276276

277277
$void = $this->context->builder->fpToSi($__value, $__type);
278278

279279
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:
282282
$void = $this->context->builder->ptrToInt($__value, $__type);
283283
break;
284284
default:
285285
throw new \LogicException("Unknown how to handle type pair (int, " . $__other_type->toString() . ")");
286286
}
287287
break;
288-
case PHPLLVM\Type::KIND_DOUBLE:
288+
case \PHPLLVM\Type::KIND_DOUBLE:
289289
if (!is_object($__value)) {
290290
$void = $__type->constReal($value);
291291
break;
292292
}
293293
$__other_type = $__value->typeOf();
294294
switch ($__other_type->getKind()) {
295-
case PHPLLVM\Type::KIND_INTEGER:
295+
case \PHPLLVM\Type::KIND_INTEGER:
296296

297297
$void = $this->context->builder->siToFp($__value, $__type);
298298

299299
break;
300-
case PHPLLVM\Type::KIND_DOUBLE:
300+
case \PHPLLVM\Type::KIND_DOUBLE:
301301
$void = $this->context->builder->fpCast($__value, $__type);
302302
break;
303303
default:
304304
throw new \LogicException("Unknown how to handle type pair (double, " . $__other_type->toString() . ")");
305305
}
306306
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:
309309
if (!is_object($__value)) {
310310
// this is very likely very wrong...
311311
$void = $__type->constInt($__value, false);
312312
break;
313313
}
314314
$__other_type = $__value->typeOf();
315315
switch ($__other_type->getKind()) {
316-
case PHPLLVM\Type::KIND_INTEGER:
316+
case \PHPLLVM\Type::KIND_INTEGER:
317317
$void = $this->context->builder->intToPtr($__value, $__type);
318318
break;
319-
case PHPLLVM\Type::KIND_ARRAY:
319+
case \PHPLLVM\Type::KIND_ARRAY:
320320
// $__tmp = $this->context->builder->($__value, $this->context->context->int64Type());
321321
// $(result) = $this->context->builder->intToPtr($__tmp, $__type);
322322
// break;
323-
case PHPLLVM\Type::KIND_POINTER:
323+
case \PHPLLVM\Type::KIND_POINTER:
324324
$void = $this->context->builder->pointerCast($__value, $__type);
325325
break;
326326
default:

0 commit comments

Comments
 (0)