aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-11-03 23:11:06 +0000
committergingerBill <bill@gingerbill.org>2017-11-03 23:11:06 +0000
commit0b29e42adb1a9eebec6c5ecc630be91a41af07f1 (patch)
treef908cc1a2489ff30ab69bc444bf4dfad98868adb /src/ir.cpp
parentfcc8b89e6b8f2df503ff19abbca67f8cbddf11dc (diff)
`link_prefix`; `thread_local`; fix `link_name` for file-scope variables
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);