Add cpu/feature specification to cmndline

This commit is contained in:
Layne Gustafson
2019-12-20 21:46:42 -05:00
committed by Andrew Kelley
parent c8f1e0d6d8
commit bd6ef21f85
6 changed files with 123 additions and 4 deletions

View File

@@ -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);