Move metadata object generation for dylibs to the linker code

This deduplicates some code between codegen backends and may in the
future allow adding extra metadata that is only known at link time.
This commit is contained in:
bjorn3
2025-05-30 12:51:15 +00:00
parent badabab01f
commit 0bd7aa1116
17 changed files with 92 additions and 220 deletions

View File

@@ -170,7 +170,6 @@ pub(crate) struct CachedModuleCodegen {
#[derive(Copy, Clone, Debug, PartialEq, Encodable, Decodable)]
pub enum ModuleKind {
Regular,
Metadata,
Allocator,
}
@@ -234,6 +233,7 @@ pub struct CrateInfo {
pub windows_subsystem: Option<String>,
pub natvis_debugger_visualizers: BTreeSet<DebuggerVisualizerFile>,
pub lint_levels: CodegenLintLevels,
pub metadata_symbol: String,
}
/// Target-specific options that get set in `cfg(...)`.
@@ -258,7 +258,6 @@ pub struct TargetConfig {
pub struct CodegenResults {
pub modules: Vec<CompiledModule>,
pub allocator_module: Option<CompiledModule>,
pub metadata_module: Option<CompiledModule>,
pub crate_info: CrateInfo,
}