aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
-rw-r--r--gcc/rust/backend/rust-compile-base.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index 80ea7a4e..fb4aace 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -25,7 +25,8 @@
#include "rust-compile-type.h"
#include "rust-constexpr.h"
#include "rust-diagnostics.h"
-#include "rust-expr.h" // for AST::AttrInputLiteral
+#include "rust-expr.h" // for AST::AttrInputLiteral
+#include "rust-hir-map.h"
#include "rust-macro.h" // for AST::MetaNameValueStr
#include "rust-hir-path-probe.h"
#include "rust-type-util.h"
@@ -39,6 +40,9 @@
#include "tree.h"
#include "print-tree.h"
+// rust-name-resolution-2.0
+#include "options.h"
+
namespace Rust {
namespace Compile {
@@ -667,6 +671,11 @@ HIRCompileBase::compile_function (
}
std::string asm_name = fn_name;
+ auto &mappings = Analysis::Mappings::get ();
+
+ if (flag_name_resolution_2_0)
+ ir_symbol_name = mappings.get_current_crate_name () + "::" + ir_symbol_name;
+
unsigned int flags = 0;
tree fndecl = Backend::function (compiled_fn_type, ir_symbol_name,
"" /* asm_name */, flags, locus);