mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Make -target-features flag support disabling of a feature
This commit is contained in:
@@ -3055,7 +3055,10 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
|
|||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
llvm_features = gb_string_appendc(llvm_features, "+");
|
if (*str.text != '+' && *str.text != '-') {
|
||||||
|
llvm_features = gb_string_appendc(llvm_features, "+");
|
||||||
|
}
|
||||||
|
|
||||||
llvm_features = gb_string_append_length(llvm_features, str.text, str.len);
|
llvm_features = gb_string_append_length(llvm_features, str.text, str.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3719,6 +3719,11 @@ int main(int arg_count, char const **arg_ptr) {
|
|||||||
String item = string_split_iterator(&target_it, ',');
|
String item = string_split_iterator(&target_it, ',');
|
||||||
if (item == "") break;
|
if (item == "") break;
|
||||||
|
|
||||||
|
if (*item.text == '+' || *item.text == '-') {
|
||||||
|
item.text++;
|
||||||
|
item.len--;
|
||||||
|
}
|
||||||
|
|
||||||
String invalid;
|
String invalid;
|
||||||
if (!check_target_feature_is_valid_for_target_arch(item, &invalid) && item != str_lit("help")) {
|
if (!check_target_feature_is_valid_for_target_arch(item, &invalid) && item != str_lit("help")) {
|
||||||
if (item != str_lit("?")) {
|
if (item != str_lit("?")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user