mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Handle llvm package name edge case for IR mangling
This commit is contained in:
+3
-2
@@ -6440,8 +6440,9 @@ String ir_mangle_name(irGen *s, Entity *e) {
|
|||||||
GB_ASSERT_MSG(pkg != nullptr, "Missing package for '%.*s'", LIT(name));
|
GB_ASSERT_MSG(pkg != nullptr, "Missing package for '%.*s'", LIT(name));
|
||||||
String pkgn = pkg->name;
|
String pkgn = pkg->name;
|
||||||
GB_ASSERT(!rune_is_digit(pkgn[0]));
|
GB_ASSERT(!rune_is_digit(pkgn[0]));
|
||||||
|
if (pkgn == "llvm") {
|
||||||
|
pkgn = str_lit("llvm$");
|
||||||
|
}
|
||||||
|
|
||||||
isize max_len = pkgn.len + 1 + name.len + 1;
|
isize max_len = pkgn.len + 1 + name.len + 1;
|
||||||
bool require_suffix_id = is_type_polymorphic(e->type, true);
|
bool require_suffix_id = is_type_polymorphic(e->type, true);
|
||||||
|
|||||||
@@ -794,7 +794,9 @@ String lb_mangle_name(lbModule *m, Entity *e) {
|
|||||||
GB_ASSERT_MSG(pkg != nullptr, "Missing package for '%.*s'", LIT(name));
|
GB_ASSERT_MSG(pkg != nullptr, "Missing package for '%.*s'", LIT(name));
|
||||||
String pkgn = pkg->name;
|
String pkgn = pkg->name;
|
||||||
GB_ASSERT(!rune_is_digit(pkgn[0]));
|
GB_ASSERT(!rune_is_digit(pkgn[0]));
|
||||||
|
if (pkgn == "llvm") {
|
||||||
|
pkgn = str_lit("llvm$");
|
||||||
|
}
|
||||||
|
|
||||||
isize max_len = pkgn.len + 1 + name.len + 1;
|
isize max_len = pkgn.len + 1 + name.len + 1;
|
||||||
bool require_suffix_id = is_type_polymorphic(e->type, true);
|
bool require_suffix_id = is_type_polymorphic(e->type, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user