mirror of
https://github.com/ziglang/zig.git
synced 2025-12-15 02:33:07 +00:00
stage1: Store target info in the LLVM module
This is needed to let LLVM (or, better, libLTO) produce code using the target options specified by the user. Fix #8803
This commit is contained in:
parent
2f538f30fd
commit
3ed6379192
@ -589,6 +589,13 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
|
||||
// use the ABI alignment, which is fine.
|
||||
}
|
||||
|
||||
if (g->zig_target->llvm_cpu_name != nullptr) {
|
||||
ZigLLVMAddFunctionAttr(llvm_fn, "target-cpu", g->zig_target->llvm_cpu_name);
|
||||
}
|
||||
if (g->zig_target->llvm_cpu_features != nullptr) {
|
||||
ZigLLVMAddFunctionAttr(llvm_fn, "target-features", g->zig_target->llvm_cpu_features);
|
||||
}
|
||||
|
||||
if (is_async) {
|
||||
addLLVMArgAttr(llvm_fn, 0, "nonnull");
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user