Compare commits

..

1 Commits

Author SHA1 Message Date
171151651b Compile the compiler
All checks were successful
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 5m26s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 5m28s
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 5m30s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 18m1s
2025-06-20 08:30:20 -06:00

View File

@ -2860,7 +2860,6 @@ llvm_create_global_variable = fn (module: &LLVMModule, type: &LLVMType, is_const
[extern] LLVMConstNamedStruct = fn [cc(c)] (type: &LLVMType, constant_pointer: &&LLVMValue, constant_count: u32) &LLVMValue;
[extern] LLVMConstStructInContext = fn [cc(c)] (context: &LLVMContext, constant_pointer: &&LLVMValue, constant_count: u32, packed: s32) &LLVMValue;
[extern] LLVMGetInstructionParent = fn [cc(c)] (value: &LLVMValue) &LLVMBasicBlock;
[extern] LLVMInstructionEraseFromParent = fn [cc(c)] (value: &LLVMValue) void;
[extern] LLVMGetOperand = fn [cc(c)] (value: &LLVMValue, index: u32) &LLVMValue;
[extern] LLVMGetFirstUse = fn [cc(c)] (value: &LLVMValue) &LLVMUse;
@ -17882,26 +17881,18 @@ emit = fn (module: &Module) void
if (first_use)
{
>second_use = LLVMGetNextUse(first_use);
>has_one_use = first_use != zero and second_use == zero;
>has_one_use = first_use != zero and first_use == zero;
if (has_one_use)
{
user = LLVMGetUser(first_use);
has_single_jump_to_return_block = LLVMIsABranchInst(user) != zero and? LLVMIsConditional(user) == 0 and? LLVMGetSuccessor(user, 0) == return_block;
has_single_jump_to_return_block = LLVMIsABranchInst(user) != zero and? LLVMIsConditional(user) != 0 and? LLVMGetSuccessor(user, 0) == return_block;
}
}
if (has_single_jump_to_return_block)
{
assert(LLVMGetBasicBlockParent(return_block) != zero);
>new_return_block = LLVMGetInstructionParent(user);
// Remove unconditional branch instruction to the return block
LLVMInstructionEraseFromParent(user);
assert(!LLVMGetFirstUse(#pointer_cast(return_block)));
assert(!LLVMGetBasicBlockTerminator(return_block));
assert(LLVMGetBasicBlockParent(return_block) != zero);
LLVMPositionBuilderAtEnd(module.llvm.builder, new_return_block);
LLVMDeleteBasicBlock(return_block);
#trap();
}
else
{