重置上传,新增了多个标准库,开始 TransPyV 自举实验
This commit is contained in:
@@ -792,7 +792,10 @@ class ExprBuiltinHandle(BaseHandle):
|
||||
elif dst.type.width > 64:
|
||||
dst = Gen.builder.trunc(dst, ir.IntType(64), name="trunc_memset_dst")
|
||||
dst = Gen.builder.inttoptr(dst, ir.PointerType(ir.IntType(8)), name="memset_dst_int2ptr")
|
||||
if isinstance(val.type, ir.IntType) and val.type.width != 32:
|
||||
if isinstance(val.type, ir.PointerType):
|
||||
# 0 字面量被推断为 null 指针(i8*),memset 第二参数需要 i32
|
||||
val = ir.Constant(ir.IntType(32), 0)
|
||||
elif isinstance(val.type, ir.IntType) and val.type.width != 32:
|
||||
if val.type.width < 32:
|
||||
val = Gen.builder.zext(val, ir.IntType(32), name="zext_memset_val")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user