fix(stmt): 移除 raise 翻译中无效的 LLVMType.Double 模式,修复 llc 报错
LLVMType 是 REnum,Float(Bits) 变体已覆盖 double(Bits=64),无独立 Double 变体。case LLVMType.Double(_db) 被 TPV match 按未知变体处理 (匹配一切),导致 Int(32) 等整数返回类型的 raise StopIteration 落入 Double 分支生成 ConstFloat(0.0) 位模式常量(0x0000000000000000), ret i32 0x0000000000000000 被 llc 判为 "floating point constant invalid for type"。删除该分支后整数返回走 case _ 的 ConstZero。
This commit is contained in:
1 parent
07e1efeb82
commit
39ddf11ddc
1 file changed
-4
@@ -187,10 +187,6 @@ class StmtGenMixin:
|
||||
zero_f: llvmlite.Value | t.CPtr = llvmlite.ConstFloat(pool, ret_ty, 0.0)
|
||||
if zero_f is not None:
|
||||
llvmlite.build_ret(builder, zero_f)
|
||||
case llvmlite.LLVMType.Double(_db):
|
||||
zero_f2: llvmlite.Value | t.CPtr = llvmlite.ConstFloat(pool, ret_ty, 0.0)
|
||||
if zero_f2 is not None:
|
||||
llvmlite.build_ret(builder, zero_f2)
|
||||
case _:
|
||||
zero_v: llvmlite.Value | t.CPtr = llvmlite.ConstZero(pool, ret_ty)
|
||||
if zero_v is not None:
|
||||
|
||||
Reference in new issue
Block a user