aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 3d4d2a8c31..43fc002a12 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -8800,6 +8800,15 @@ static void init(CodeGen *g) {
target_specific_features = "";
}
+ // Override CPU and features if non-null.
+ if (g->llvm_cpu != nullptr) {
+ target_specific_cpu_args = g->llvm_cpu;
+ }
+
+ if (g->llvm_features != nullptr) {
+ target_specific_features = g->llvm_features;
+ }
+
g->target_machine = ZigLLVMCreateTargetMachine(target_ref, buf_ptr(&g->llvm_triple_str),
target_specific_cpu_args, target_specific_features, opt_level, reloc_mode,
LLVMCodeModelDefault, g->function_sections);