diff options
| author | gingerBill <bill@gingerbill.org> | 2023-05-30 00:05:52 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-05-30 00:05:52 +0100 |
| commit | 3ab01dbc004e7c4b8eebdb5e1dc726e80bc535cc (patch) | |
| tree | fd490fd19fa4c180988d8b7150843afb593694dc /src/llvm_backend_opt.cpp | |
| parent | c241edaa30ae536f6172ed3c943e2d2637b32acf (diff) | |
Fix type `switch` debug information on `-o:none`
Diffstat (limited to 'src/llvm_backend_opt.cpp')
| -rw-r--r-- | src/llvm_backend_opt.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp index 61f51b15b..141ee88c7 100644 --- a/src/llvm_backend_opt.cpp +++ b/src/llvm_backend_opt.cpp @@ -370,11 +370,21 @@ gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) { } -gb_internal void lb_run_function_pass_manager(LLVMPassManagerRef fpm, lbProcedure *p) { +gb_internal void lb_run_function_pass_manager(LLVMPassManagerRef fpm, lbProcedure *p, lbFunctionPassManagerKind pass_manager_kind) { if (p == nullptr) { return; } 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 // which means we cannot rely upon it // This is also useful for read the .ll for debug purposes because a lot of instructions |