From 0b29e42adb1a9eebec6c5ecc630be91a41af07f1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 3 Nov 2017 23:11:06 +0000 Subject: `link_prefix`; `thread_local`; fix `link_name` for file-scope variables --- src/ir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') 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); -- cgit v1.2.3