diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-07-03 15:46:27 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-07-03 15:46:27 -0400 |
| commit | 4606baee072f832ef794d86f428a7f27d91c6a11 (patch) | |
| tree | 17ff3a599b689a99c674e23d8d7f015a35933d18 /src/zig_llvm.cpp | |
| parent | 2f4faf306d5d7a5b730b4dc6d426af713289bb51 (diff) | |
| download | zig-4606baee072f832ef794d86f428a7f27d91c6a11.tar.gz zig-4606baee072f832ef794d86f428a7f27d91c6a11.zip | |
add -ffunction-sections arg when building C objects
the other changes in this commit are minor tidying up
Diffstat (limited to 'src/zig_llvm.cpp')
| -rw-r--r-- | src/zig_llvm.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index f8d2ccce7e..c51c9e1a50 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -145,8 +145,9 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri TargetOptions opt; opt.FunctionSections = function_sections; - return reinterpret_cast<LLVMTargetMachineRef>(const_cast<TargetMachine *>( - reinterpret_cast<Target*>(T)->createTargetMachine(Triple, CPU, Features, opt, RM, CM, OL, JIT))); + TargetMachine *TM = reinterpret_cast<Target*>(T)->createTargetMachine(Triple, CPU, Features, opt, RM, CM, + OL, JIT); + return reinterpret_cast<LLVMTargetMachineRef>(TM); } bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref, |
