aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2019-06-28 00:58:35 +0200
committerTimon Kruiper <timonkruiper@gmail.com>2019-07-01 17:49:08 +0200
commit7586f613d58db8f210649c890c467edce11643b9 (patch)
treefd3374a298e0cfc4cc4f2232cf607c1cff893234 /src/zig_llvm.cpp
parent0dd2e93e4cb28205823e840d5fdb0fccce9cc2e7 (diff)
downloadzig-7586f613d58db8f210649c890c467edce11643b9.tar.gz
zig-7586f613d58db8f210649c890c467edce11643b9.zip
Added function-section functionality
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index fe1b279cf0..bd118d936b 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -95,7 +95,7 @@ static const bool assertions_on = false;
bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref,
const char *filename, ZigLLVM_EmitOutputType output_type, char **error_message, bool is_debug,
- bool is_small, bool time_report)
+ bool is_small, bool time_report, bool function_sections)
{
TimePassesIsEnabled = time_report;
@@ -108,6 +108,8 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref);
target_machine->setO0WantsFastISel(true);
+ target_machine->Options.FunctionSections = function_sections;
+
Module* module = unwrap(module_ref);
PassManagerBuilder *PMBuilder = new(std::nothrow) PassManagerBuilder();