gccrs: Remove metadata export visitor

The metadata format will likely change over the upcoming month and right
now it doesn't support trait impl. This commit simplifies metadata export
by dumping the whole AST within metadatas. This is slower but it should
be more complete and correct.

gcc/rust/ChangeLog:

	* ast/rust-collect-lang-items.cc (CollectLangItems::visit): Visit
	extern crate's content when collecting lang items.
	* ast/rust-collect-lang-items.h: Add function protototype.
	* metadata/rust-export-metadata.cc (ExportContext::push_module_scope):
	Remove.
	(ExportContext::emit_crate): Add a function to export the whole crate.
	(ExportContext::pop_module_scope): Remove.
	(ExportContext::emit_trait): Likewise.
	(ExportContext::emit_use_declaration): Likewise.
	(ExportContext::emit_function): Likewise.
	(ExportContext::emit_extern_block): Likewise.
	(ExportContext::emit_module): Likewise.
	(class ExportVisItems): Likewise.
	(PublicInterface::gather_export_data): Dump the AST.
	* metadata/rust-export-metadata.h: Update prototypes.

gcc/testsuite/ChangeLog:

	* rust/link/simple_function_0.rs: Remove bogus match.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
5 files changed