File tree 1 file changed +10
-2
lines changed
crates/rustc_codegen_spirv/src
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -230,8 +230,16 @@ impl MetadataLoader for SpirvMetadataLoader {
230
230
link:: read_metadata ( path)
231
231
}
232
232
233
- fn get_dylib_metadata ( & self , _: & Target , _: & Path ) -> Result < MetadataRef , String > {
234
- Err ( "TODO: implement get_dylib_metadata" . to_string ( ) )
233
+ fn get_dylib_metadata ( & self , target : & Target , path : & Path ) -> Result < MetadataRef , String > {
234
+ // HACK(eddyb) this is needed to allow metadata loading for proc macros
235
+ // (compiled as host dylibs); perhaps it'd be better to use the `object`
236
+ // crate, like `rustc_codegen_cranelift` does.
237
+ // NOTE(eddyb) while both `::new()` and `.metadata_loader()` call `Box::new`,
238
+ // they only do so with ZST values, and so we don't pointlessly allocate.
239
+ extern crate rustc_codegen_llvm;
240
+ rustc_codegen_llvm:: LlvmCodegenBackend :: new ( )
241
+ . metadata_loader ( )
242
+ . get_dylib_metadata ( target, path)
235
243
}
236
244
}
237
245
You can’t perform that action at this time.
0 commit comments