aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 565329ef1..e554666f2 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -8176,14 +8176,15 @@ void ir_gen_tree(irGen *s) {
if (decl == nullptr) {
continue;
}
+ GB_ASSERT(e->kind == Entity_Variable);
bool is_foreign = e->Variable.is_foreign;
bool is_export = e->Variable.is_export;
+ bool no_name_mangle = e->scope->is_global || e->Variable.link_name.len > 0 || is_foreign || is_export;
String name = e->token.string;
- String original_name = name;
- if (!e->scope->is_global && !(is_foreign || is_export)) {
+ if (!no_name_mangle) {
name = ir_mangle_name(s, e->token.pos.file, e);
}
ir_add_entity_name(m, e, name);