mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Always call lb_run_remove_dead_instruction_pass to fix -debug issues
This commit is contained in:
@@ -3004,8 +3004,9 @@ gb_internal lbAddr lb_add_local(lbProcedure *p, Type *type, Entity *e, bool zero
|
|||||||
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
|
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
|
||||||
|
|
||||||
char const *name = "";
|
char const *name = "";
|
||||||
if (e != nullptr) {
|
if (e != nullptr && e->token.string.len > 0 && e->token.string != "_") {
|
||||||
// name = alloc_cstring(permanent_allocator(), e->token.string);
|
// NOTE(bill): for debugging purposes only
|
||||||
|
name = alloc_cstring(permanent_allocator(), e->token.string);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMTypeRef llvm_type = lb_type(p->module, type);
|
LLVMTypeRef llvm_type = lb_type(p->module, type);
|
||||||
|
|||||||
@@ -375,16 +375,6 @@ gb_internal void lb_run_function_pass_manager(LLVMPassManagerRef fpm, lbProcedur
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LLVMRunFunctionPassManager(fpm, p->value);
|
LLVMRunFunctionPassManager(fpm, p->value);
|
||||||
switch (pass_manager_kind) {
|
|
||||||
case lbFunctionPassManager_none:
|
|
||||||
return;
|
|
||||||
case lbFunctionPassManager_default:
|
|
||||||
case lbFunctionPassManager_default_without_memcpy:
|
|
||||||
if (build_context.optimization_level < 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// NOTE(bill): LLVMAddDCEPass doesn't seem to be exported in the official DLL's for LLVM
|
// NOTE(bill): LLVMAddDCEPass doesn't seem to be exported in the official DLL's for LLVM
|
||||||
// which means we cannot rely upon it
|
// which means we cannot rely upon it
|
||||||
// This is also useful for read the .ll for debug purposes because a lot of instructions
|
// This is also useful for read the .ll for debug purposes because a lot of instructions
|
||||||
|
|||||||
Reference in New Issue
Block a user