-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Refactor librustc_codegen_llvm for multiple codegen backends. #45274
Copy link
Copy link
Open
Labels
A-codegenArea: Code generationArea: Code generationA-craneliftThings relevant to the [future] cranelift backendThings relevant to the [future] cranelift backendA-gccThings relevant to the [future] GCC backendThings relevant to the [future] GCC backendC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-craneliftThings relevant to the [future] cranelift backendThings relevant to the [future] cranelift backendA-gccThings relevant to the [future] GCC backendThings relevant to the [future] GCC backendC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
[#50615] Renamelibrustc_transtolibrustc_codegen_llvm.Makerustc_drivereither able to choose codegen backends, or even better, passrustc_codegen_llvmtorustc_driverfromrustc-main.See also #45226.
Possible refactoring steps:
removeSharedCrateContext, useTyCtxtrename(Local)CrateContexttoCodegenContext, remove accessor methodsmergelibrustc_llvmintolibrustc_codegen_llvmpassValueRefas&'ll Valueinstead, encode LLVM lifetimes in FFI signaturesuse this technique for C++ objects that borrow others: Tracking issue for RFC 1861: Extern types #43467 (comment)DI*inheritance hierarchy: Tracking issue for RFC 1861: Extern types #43467 (comment)&'ll Module<'ll>,&'ll Value<'ll>,&'ll Type<'ll>etc. to correctly model lifetime relationships (without an invariant lifetime parameter, very little is actually enforced)craneliftandllvm2craneliftfor common Cranelift/LLVM builder APIscommon tools used by SSA backends could be placed inrustc_codegen_ssarustc_codegen_ssaAPIs to match Cranelift, leave LLVM second-classbinemit"?) and linking components, out ofrustc_codegen_ssa