File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
librustc_codegen_ssa/traits Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,14 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
9090 ) {
9191 base:: write_compressed_metadata ( tcx, metadata, llvm_module)
9292 }
93+ fn write_idata_sections < ' tcx > (
94+ & self ,
95+ tcx : TyCtxt < ' tcx > ,
96+ raw_dylibs : & [ RawDylibImports ] ,
97+ module : & mut ModuleLlvm ,
98+ ) {
99+ base:: write_idata_sections ( tcx, raw_dylibs, module)
100+ }
93101 fn codegen_allocator < ' tcx > (
94102 & self ,
95103 tcx : TyCtxt < ' tcx > ,
Original file line number Diff line number Diff line change @@ -89,6 +89,20 @@ pub trait CodegenBackend {
8989 ) -> Result < ( ) , ErrorReported > ;
9090}
9191
92+ //TODO: Put this somewhere else?
93+ #[ derive( Debug ) ]
94+ pub enum RawDylibImportName {
95+ Name ( Symbol ) ,
96+ Ordinal ( u16 ) ,
97+ }
98+
99+ #[ derive( Debug ) ]
100+ pub struct RawDylibImports {
101+ pub name : Symbol ,
102+ pub items : Vec < RawDylibImportName >
103+ }
104+
105+
92106pub trait ExtraBackendMethods : CodegenBackend + WriteBackendMethods + Sized + Send + Sync {
93107 fn new_metadata ( & self , sess : TyCtxt < ' _ > , mod_name : & str ) -> Self :: Module ;
94108 fn write_compressed_metadata < ' tcx > (
@@ -97,6 +111,12 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
97111 metadata : & EncodedMetadata ,
98112 llvm_module : & mut Self :: Module ,
99113 ) ;
114+ fn write_idata_sections < ' tcx > (
115+ & self ,
116+ tcx : TyCtxt < ' tcx > ,
117+ raw_dylib_imports : & [ RawDylibImports ] ,
118+ mods : & mut Self :: Module ,
119+ ) ;
100120 fn codegen_allocator < ' tcx > (
101121 & self ,
102122 tcx : TyCtxt < ' tcx > ,
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ mod write;
3030pub use self :: abi:: AbiBuilderMethods ;
3131pub use self :: asm:: { AsmBuilderMethods , AsmMethods , InlineAsmOperandRef } ;
3232pub use self :: backend:: { Backend , BackendTypes , CodegenBackend , ExtraBackendMethods } ;
33+ pub use self :: backend:: { RawDylibImports , RawDylibImportName } ;
3334pub use self :: builder:: { BuilderMethods , OverflowOp } ;
3435pub use self :: consts:: ConstMethods ;
3536pub use self :: debuginfo:: { DebugInfoBuilderMethods , DebugInfoMethods } ;
You can’t perform that action at this time.
0 commit comments