修正了 TPV,使其能够编译 Test
This commit is contained in:
@@ -470,6 +470,12 @@ def translate_function_def(trans: HT.Translator | t.CPtr,
|
||||
|
||||
if is_extern_decl != 0:
|
||||
# 外部声明函数:生成 declare(仅声明,不定义)
|
||||
# 先检查是否已由 forward_declare_functions 创建,避免重复 declare
|
||||
existing_extern: llvmlite.Function | t.CPtr = HandlesExprCall.find_func_in_module(mod, mangled_name)
|
||||
if existing_extern is not None:
|
||||
# 已存在前向声明,复用之,不再重复创建
|
||||
return 0
|
||||
|
||||
func: llvmlite.Function | t.CPtr = llvmlite.create_declare(
|
||||
pool, mod, mangled_name, ret_ty)
|
||||
if func is None:
|
||||
|
||||
Reference in New Issue
Block a user