mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-09 13:01:38 -07:00
Add optional LLVM_USE_BASIC_PASSES build flag. If evaluates to a truthy value, it will be do only basic passes for -llvm-api
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
#ifndef LLVM_USE_BASIC_PASSES
|
||||
#define LLVM_USE_BASIC_PASSES 0
|
||||
#endif
|
||||
|
||||
void lb_populate_function_pass_manager(LLVMPassManagerRef fpm, bool ignore_memcpy_pass) {
|
||||
if (!ignore_memcpy_pass) {
|
||||
LLVMAddMemCpyOptPass(fpm);
|
||||
}
|
||||
if (build_context.optimization_level == 0) {
|
||||
if (LLVM_USE_BASIC_PASSES || build_context.optimization_level == 0) {
|
||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||
LLVMAddEarlyCSEPass(fpm);
|
||||
@@ -95,7 +99,7 @@ void lb_populate_module_pass_manager(LLVMTargetMachineRef target_machine, LLVMPa
|
||||
LLVMAddStripDeadPrototypesPass(mpm);
|
||||
LLVMAddAnalysisPasses(target_machine, mpm);
|
||||
LLVMAddPruneEHPass(mpm);
|
||||
if (build_context.optimization_level == 0) {
|
||||
if (LLVM_USE_BASIC_PASSES || build_context.optimization_level == 0) {
|
||||
// LLVMAddMergeFunctionsPass(mpm);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user