aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorLayne Gustafson <lgustaf1@binghamton.edu>2019-12-20 21:46:42 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-19 20:53:19 -0500
commitbd6ef21f8556b3872c5780eee70621e6c66a0aa4 (patch)
tree8b7c28b324ff41905b26d28c5e0c3441f93c06f0 /src/codegen.cpp
parentc8f1e0d6d8f3ccfa952e9612903783baa9b2c12f (diff)
downloadzig-bd6ef21f8556b3872c5780eee70621e6c66a0aa4.tar.gz
zig-bd6ef21f8556b3872c5780eee70621e6c66a0aa4.zip
Add cpu/feature specification to cmndline
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);