mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-22 06:45:13 +00:00
Use rustc_codegen_llvm's get_dylib_metadata to unblock proc macros. (#268)
This commit is contained in:
parent
a92d76a81c
commit
28f604eb77
@ -230,8 +230,16 @@ impl MetadataLoader for SpirvMetadataLoader {
|
|||||||
link::read_metadata(path)
|
link::read_metadata(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_dylib_metadata(&self, _: &Target, _: &Path) -> Result<MetadataRef, String> {
|
fn get_dylib_metadata(&self, target: &Target, path: &Path) -> Result<MetadataRef, String> {
|
||||||
Err("TODO: implement get_dylib_metadata".to_string())
|
// HACK(eddyb) this is needed to allow metadata loading for proc macros
|
||||||
|
// (compiled as host dylibs); perhaps it'd be better to use the `object`
|
||||||
|
// crate, like `rustc_codegen_cranelift` does.
|
||||||
|
// NOTE(eddyb) while both `::new()` and `.metadata_loader()` call `Box::new`,
|
||||||
|
// they only do so with ZST values, and so we don't pointlessly allocate.
|
||||||
|
extern crate rustc_codegen_llvm;
|
||||||
|
rustc_codegen_llvm::LlvmCodegenBackend::new()
|
||||||
|
.metadata_loader()
|
||||||
|
.get_dylib_metadata(target, path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user