From 8fcc6ca4647b98ef81292e598237297326018059 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 29 Mar 2021 16:51:06 +0100 Subject: Add `LLVM_USE_NO_EXTRA_PASSES` build flag --- src/llvm_backend_opt.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/llvm_backend_opt.cpp') diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp index 97da50d1b..18b52b0a9 100644 --- a/src/llvm_backend_opt.cpp +++ b/src/llvm_backend_opt.cpp @@ -1,7 +1,12 @@ +#ifndef LLVM_USE_NO_EXTRA_PASSES +#define LLVM_USE_NO_EXTRA_PASSES 0 +#endif + #ifndef LLVM_USE_BASIC_PASSES -#define LLVM_USE_BASIC_PASSES 0 +#define LLVM_USE_BASIC_PASSES LLVM_USE_NO_EXTRA_PASSES #endif + void lb_populate_function_pass_manager(LLVMPassManagerRef fpm, bool ignore_memcpy_pass, i32 optimization_level) { // NOTE(bill): Treat -opt:3 as if it was -opt:2 // TODO(bill): Determine which opt definitions should exist in the first place @@ -111,6 +116,9 @@ void lb_populate_module_pass_manager(LLVMTargetMachineRef target_machine, LLVMPa if (LLVM_USE_BASIC_PASSES) { optimization_level = 0; } + if (LLVM_USE_NO_EXTRA_PASSES) { + return; + } LLVMAddAlwaysInlinerPass(mpm); LLVMAddStripDeadPrototypesPass(mpm); -- cgit v1.2.3