aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2019-07-01 15:22:57 +0200
committerTimon Kruiper <timonkruiper@gmail.com>2019-07-02 19:54:29 +0200
commitbbc0d440b86a1783c1fddc5e594f9b4067016489 (patch)
tree6669783a72d03a9818e581a1896bd455ef3251d6 /src-self-hosted
parent7586f613d58db8f210649c890c467edce11643b9 (diff)
downloadzig-bbc0d440b86a1783c1fddc5e594f9b4067016489.tar.gz
zig-bbc0d440b86a1783c1fddc5e594f9b4067016489.zip
Added ZigLLVMCreateTargetMachine and pass function-sections flag
Also added extra cache line Added the ZigLVVMCreateTargetMachine to self hosted zig code
Diffstat (limited to 'src-self-hosted')
-rw-r--r--src-self-hosted/compilation.zig1
-rw-r--r--src-self-hosted/llvm.zig6
2 files changed, 4 insertions, 3 deletions
diff --git a/src-self-hosted/compilation.zig b/src-self-hosted/compilation.zig
index bd20442d4b..a64e52a2b6 100644
--- a/src-self-hosted/compilation.zig
+++ b/src-self-hosted/compilation.zig
@@ -516,6 +516,7 @@ pub const Compilation = struct {
opt_level,
reloc_mode,
llvm.CodeModelDefault,
+ false // TODO: add -ffunction-sections option
) orelse return error.OutOfMemory;
defer llvm.DisposeTargetMachine(comp.target_machine);
diff --git a/src-self-hosted/llvm.zig b/src-self-hosted/llvm.zig
index 149b534ea0..40d414e5f7 100644
--- a/src-self-hosted/llvm.zig
+++ b/src-self-hosted/llvm.zig
@@ -163,8 +163,8 @@ extern fn LLVMCopyStringRepOfTargetData(TD: *TargetData) ?[*]u8;
pub const CreateTargetDataLayout = LLVMCreateTargetDataLayout;
extern fn LLVMCreateTargetDataLayout(T: *TargetMachine) ?*TargetData;
-pub const CreateTargetMachine = LLVMCreateTargetMachine;
-extern fn LLVMCreateTargetMachine(
+pub const CreateTargetMachine = ZigLLVMCreateTargetMachine;
+extern fn ZigLLVMCreateTargetMachine(
T: *Target,
Triple: [*]const u8,
CPU: [*]const u8,
@@ -172,6 +172,7 @@ extern fn LLVMCreateTargetMachine(
Level: CodeGenOptLevel,
Reloc: RelocMode,
CodeModel: CodeModel,
+ function_sections: bool,
) ?*TargetMachine;
pub const GetHostCPUName = LLVMGetHostCPUName;
@@ -283,7 +284,6 @@ extern fn ZigLLVMTargetMachineEmitToFile(
error_message: *[*]u8,
is_debug: bool,
is_small: bool,
- function_sections: bool,
) bool;
pub const BuildCall = ZigLLVMBuildCall;