Compare commits

...

2 Commits

Author SHA1 Message Date
adfce1d43e Implement for, among other stuff
All checks were successful
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 3m25s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 3m27s
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 3m30s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 13m48s
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 3m31s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 3m28s
CI / ci (Release, ubuntu-latest) (push) Successful in 3m26s
CI / ci (Debug, ubuntu-latest) (push) Successful in 13m48s
2025-06-16 10:03:09 -06:00
b24b5f29f7 Shortcircuiting 2025-06-14 06:57:11 -06:00
2 changed files with 980 additions and 59 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5172,7 +5172,7 @@ fn SliceEmitResult emit_string_literal(Module* module, Value* value)
LLVMThreadLocalMode tlm = LLVMNotThreadLocal; LLVMThreadLocalMode tlm = LLVMNotThreadLocal;
bool externally_initialized = false; bool externally_initialized = false;
u32 alignment = 1; u32 alignment = 1;
auto global = llvm_create_global_variable(module->llvm.module, string_type, is_constant, LLVMInternalLinkage, constant_string, string_literal("conststring"), tlm, externally_initialized, alignment, LLVMGlobalUnnamedAddr); auto global = llvm_create_global_variable(module->llvm.module, string_type, is_constant, LLVMInternalLinkage, constant_string, string_literal("const.string"), tlm, externally_initialized, alignment, LLVMGlobalUnnamedAddr);
return { global, LLVMConstInt(uint64(module)->llvm.abi, length, false) }; return { global, LLVMConstInt(uint64(module)->llvm.abi, length, false) };
} break; } break;
@ -7372,9 +7372,6 @@ fn void emit_value(Module* module, Value* value, TypeKind type_kind, bool expect
auto* left = value->binary.left; auto* left = value->binary.left;
auto llvm_function = module->current_function->variable.storage->llvm;
assert(llvm_function);
auto* right_block = LLVMAppendBasicBlockInContext(module->llvm.context, llvm_function, "shortcircuit.right"); auto* right_block = LLVMAppendBasicBlockInContext(module->llvm.context, llvm_function, "shortcircuit.right");
auto* end_block = LLVMAppendBasicBlockInContext(module->llvm.context, llvm_function, "shortcircuit.end"); auto* end_block = LLVMAppendBasicBlockInContext(module->llvm.context, llvm_function, "shortcircuit.end");
@ -7439,7 +7436,6 @@ fn void emit_value(Module* module, Value* value, TypeKind type_kind, bool expect
auto boolean_type = uint1(module); auto boolean_type = uint1(module);
resolve_type_in_place(module, boolean_type); resolve_type_in_place(module, boolean_type);
auto boolean = boolean_type->llvm.abi; auto boolean = boolean_type->llvm.abi;
LLVMValueRef incoming_left = 0; LLVMValueRef incoming_left = 0;
@ -8948,6 +8944,8 @@ fn void analyze_statement(Module* module, Scope* scope, Statement* statement, u3
} }
} }
assert(!local);
analyze_statement(module, &statement->for_each.scope, statement->for_each.predicate, last_line, last_column, last_debug_location); analyze_statement(module, &statement->for_each.scope, statement->for_each.predicate, last_line, last_column, last_debug_location);
if (LLVMGetInsertBlock(module->llvm.builder)) if (LLVMGetInsertBlock(module->llvm.builder))