From 58e108c7c6d0fa3c9ebc7eeb681851924e22ddd5 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Fri, 7 May 2021 16:53:17 +0100 Subject: Implement basic rustc legacy symbol mangling Rust supports two different symbol mangling methods legacy and V0. V0 is the goal but its not yet stable. This implements the legacy method but with a dummy hash value since it requires a sip128 implementation to generate the apropriate hash which can be done in a sperate change. This change allows us to actually assemble generic functions and avoid bad symbol duplications. Addresses #305 --- gcc/rust/backend/rust-compile-context.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/rust/backend/rust-compile-context.h') diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h index bdc9eca..7db4ea2 100644 --- a/gcc/rust/backend/rust-compile-context.h +++ b/gcc/rust/backend/rust-compile-context.h @@ -258,6 +258,11 @@ public: return pop; } + std::string mangle_item (const std::string &name) const; + + std::string mangle_impl_item (const TyTy::BaseType *self, + const std::string &name) const; + private: ::Backend *backend; Resolver::Resolver *resolver; -- cgit v1.1