aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-context.h
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-09-09 14:17:41 +0200
committerThomas Schwinge <thomas@codesourcery.com>2021-09-09 14:17:41 +0200
commite17824d3c307376ac79041836dc3eea6ffcb6046 (patch)
treeeb8033b46d5d9fe7fcae7542913b100552c0af75 /gcc/rust/backend/rust-compile-context.h
parenta8fb0fd650712b91c7c18a493b56e10faa5a1fd0 (diff)
parentbca1debe33bf477df850db5979e4206627b3790b (diff)
downloadgcc-e17824d3c307376ac79041836dc3eea6ffcb6046.zip
gcc-e17824d3c307376ac79041836dc3eea6ffcb6046.tar.gz
gcc-e17824d3c307376ac79041836dc3eea6ffcb6046.tar.bz2
Merge commit 'bca1debe33bf477df850db5979e4206627b3790b' into HEAD
Diffstat (limited to 'gcc/rust/backend/rust-compile-context.h')
-rw-r--r--gcc/rust/backend/rust-compile-context.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h
index bffe97c..05c15e3 100644
--- a/gcc/rust/backend/rust-compile-context.h
+++ b/gcc/rust/backend/rust-compile-context.h
@@ -28,6 +28,7 @@
#include "rust-ast-full.h"
#include "rust-hir-full.h"
#include "rust-hir-const-fold-ctx.h"
+#include "rust-mangle.h"
namespace Rust {
namespace Compile {
@@ -45,7 +46,7 @@ public:
: backend (backend), resolver (Resolver::Resolver::get ()),
tyctx (Resolver::TypeCheckContext::get ()),
mappings (Analysis::Mappings::get ()),
- const_ctx (ConstFold::Context::get ())
+ const_ctx (ConstFold::Context::get ()), mangler (Mangler ())
{
// insert the builtins
auto builtins = resolver->get_builtin_types ();
@@ -285,13 +286,19 @@ public:
return pop;
}
- // this needs to support Legacy and V0 see github #429 or #305
std::string mangle_item (const TyTy::BaseType *ty,
- const Resolver::CanonicalPath &path) const;
+ const Resolver::CanonicalPath &path) const
+ {
+ return mangler.mangle_item (ty, path, mappings->get_current_crate_name ());
+ }
std::string mangle_impl_item (const TyTy::BaseType *self,
const TyTy::BaseType *ty,
- const std::string &name) const;
+ const std::string &name) const
+ {
+ return mangler.mangle_impl_item (self, ty, name,
+ mappings->get_current_crate_name ());
+ }
private:
::Backend *backend;
@@ -300,6 +307,7 @@ private:
Analysis::Mappings *mappings;
ConstFold::Context *const_ctx;
std::set<HirId> builtin_range;
+ Mangler mangler;
// state
std::vector<fncontext> fn_stack;