Add -obfuscate-source-code-locations

This commit is contained in:
gingerBill
2023-12-13 16:47:34 +00:00
parent 6e9e469abd
commit ca2b2c498e
5 changed files with 68 additions and 7 deletions
+10 -1
View File
@@ -1982,16 +1982,25 @@ gb_internal bool cg_switch_stmt_can_be_trivial_jump_table(AstSwitchStmt *ss) {
if (ss->tag == nullptr) {
return false;
}
enum { DISALLOW_64_SWITCH = true };
bool is_typeid = false;
TypeAndValue tv = type_and_value_of_expr(ss->tag);
if (is_type_integer(core_type(tv.type))) {
if (type_size_of(tv.type) > 8) {
i64 sz = type_size_of(tv.type);
if (sz > 8) {
return false;
}
if (DISALLOW_64_SWITCH && sz == 8) {
return false;
}
// okay
} else if (is_type_typeid(tv.type)) {
// okay
is_typeid = true;
if (DISALLOW_64_SWITCH && build_context.ptr_size == 8) {
return false;
}
} else {
return false;
}