Skip to content

Commit

Permalink
gccrs: Initial implementation of v0 mangling
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* backend/rust-compile-context.h: Modify declaration.
	* backend/rust-mangle.cc (struct V0Path): New struct.
	(v0_path): New function.
	(legacy_mangle_name): Take Context as argument.
	(v0_numeric_prefix): Fix type strings.
	(v0_complex_type_prefix): New function.
	(v0_add_integer_62): Deleted
	(v0_integer_62): New function.
	(v0_add_opt_integer_62): Deleted.
	(v0_opt_integer_62): New function.
	(v0_add_disambiguator): Deleted.
	(v0_disambiguator): New function.
	(v0_type_prefix): Support more types.
	(v0_generic_args): New function.
	(v0_add_identifier): Deleted.
	(v0_identifier): New function.
	(v0_type_path): New function.
	(v0_function_path): New function.
	(v0_scope_path): New function.
	(v0_crate_path): New function.
	(v0_inherent_or_trait_impl_path): New function.
	(v0_mangle_item): Use v0_path.
	(Mangler::mangle_item): Take Context as argument.
	* backend/rust-mangle.h (class Context): Add forward declaration.
	* hir/tree/rust-hir-item.h: Fix include.

Signed-off-by: Raiki Tamura <[email protected]>
  • Loading branch information
tamaroning committed Sep 21, 2023
1 parent 0f3df91 commit b5b600c
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 51 deletions.
4 changes: 2 additions & 2 deletions gcc/rust/backend/rust-compile-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ class Context
bool const_context_p (void) { return (const_context > 0); }

std::string mangle_item (const TyTy::BaseType *ty,
const Resolver::CanonicalPath &path) const
const Resolver::CanonicalPath &path)
{
return mangler.mangle_item (ty, path);
return mangler.mangle_item (this, ty, path);
}

void push_closure_context (HirId id);
Expand Down
Loading

0 comments on commit b5b600c

Please sign in to comment.