mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00: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) {
|
void lb_populate_function_pass_manager(LLVMPassManagerRef fpm, bool ignore_memcpy_pass) {
|
||||||
if (!ignore_memcpy_pass) {
|
if (!ignore_memcpy_pass) {
|
||||||
LLVMAddMemCpyOptPass(fpm);
|
LLVMAddMemCpyOptPass(fpm);
|
||||||
}
|
}
|
||||||
if (build_context.optimization_level == 0) {
|
if (LLVM_USE_BASIC_PASSES || build_context.optimization_level == 0) {
|
||||||
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
LLVMAddPromoteMemoryToRegisterPass(fpm);
|
||||||
LLVMAddMergedLoadStoreMotionPass(fpm);
|
LLVMAddMergedLoadStoreMotionPass(fpm);
|
||||||
LLVMAddEarlyCSEPass(fpm);
|
LLVMAddEarlyCSEPass(fpm);
|
||||||
@@ -95,7 +99,7 @@ void lb_populate_module_pass_manager(LLVMTargetMachineRef target_machine, LLVMPa
|
|||||||
LLVMAddStripDeadPrototypesPass(mpm);
|
LLVMAddStripDeadPrototypesPass(mpm);
|
||||||
LLVMAddAnalysisPasses(target_machine, mpm);
|
LLVMAddAnalysisPasses(target_machine, mpm);
|
||||||
LLVMAddPruneEHPass(mpm);
|
LLVMAddPruneEHPass(mpm);
|
||||||
if (build_context.optimization_level == 0) {
|
if (LLVM_USE_BASIC_PASSES || build_context.optimization_level == 0) {
|
||||||
// LLVMAddMergeFunctionsPass(mpm);
|
// LLVMAddMergeFunctionsPass(mpm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user