feat: if let 语句 — if let Option::Some = expr { ... }
This commit is contained in:
@@ -813,6 +813,15 @@ LLVMModuleRef codegen_module(AstNode* ast, Arena* codegen_arena,
|
||||
memcpy_args, 3, false);
|
||||
ctx.memcpy_fn = LLVMAddFunction(ctx.module, "memcpy", memcpy_ty);
|
||||
|
||||
// __chkstk 桩:LLVM 在生成大栈帧代码时会引用此符号(MinGW x64: __chkstk)
|
||||
{
|
||||
LLVMTypeRef chkstk_ty = LLVMFunctionType(LLVMVoidTypeInContext(ctx.context), NULL, 0, false);
|
||||
LLVMValueRef chkstk_fn = LLVMAddFunction(ctx.module, "__chkstk", chkstk_ty);
|
||||
LLVMBasicBlockRef chk_bb = LLVMAppendBasicBlockInContext(ctx.context, chkstk_fn, "entry");
|
||||
LLVMPositionBuilderAtEnd(ctx.builder, chk_bb);
|
||||
LLVMBuildRetVoid(ctx.builder);
|
||||
}
|
||||
|
||||
// 第零遍:先创建所有命名结构体(占位符,未设置 body)
|
||||
for (size_t i = 0; i < ast->as.program.struct_count; i++) {
|
||||
AstNode* sd = ast->as.program.structs[i];
|
||||
|
||||
Reference in New Issue
Block a user