diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-03-01 10:45:20 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-01 12:41:45 +0000 |
commit | f879526899b4680b65da052f4ef396577e6ba621 (patch) | |
tree | 0c2773c99c7cb54e38c427fc1a19165c22f52206 /gcc | |
parent | 0c13515af7e3f6d8a13de87d27cb2f82a5f84e43 (diff) | |
download | gcc-f879526899b4680b65da052f4ef396577e6ba621.zip gcc-f879526899b4680b65da052f4ef396577e6ba621.tar.gz gcc-f879526899b4680b65da052f4ef396577e6ba621.tar.bz2 |
Fix bug when assembling function names with :: in the symbol
When the assembler comes along Foo::new as a symbol name it will fail
we need name mangling to fix this properly.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/backend/rust-compile-implitem.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/rust/backend/rust-compile-implitem.h b/gcc/rust/backend/rust-compile-implitem.h index 8018367..76cc608 100644 --- a/gcc/rust/backend/rust-compile-implitem.h +++ b/gcc/rust/backend/rust-compile-implitem.h @@ -50,7 +50,7 @@ public: ::Btype *type = TyTyResolveCompile::compile (ctx, resolved_type); Bexpression *value = CompileExpr::Compile (constant.get_expr (), ctx); - std::string ident = self->get_name () + "::" + constant.get_identifier (); + std::string ident = self->get_name () + "_" + constant.get_identifier (); Bexpression *const_expr = ctx->get_backend ()->named_constant_expression ( type, constant.get_identifier (), value, constant.get_locus ()); @@ -95,7 +95,7 @@ public: unsigned int flags = 0; std::string fn_identifier - = self->get_name () + "::" + function.function_name; + = self->get_name () + "_" + function.function_name; // if its the main fn or pub visibility mark its as DECL_PUBLIC // please see https://github.com/Rust-GCC/gccrs/pull/137 @@ -259,7 +259,7 @@ public: unsigned int flags = 0; std::string fn_identifier - = self->get_name () + "::" + method.get_method_name (); + = self->get_name () + "_" + method.get_method_name (); // if its the main fn or pub visibility mark its as DECL_PUBLIC // please see https://github.com/Rust-GCC/gccrs/pull/137 |