-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor librustc_codegen_llvm for multiple codegen backends. #45274
Labels
A-codegen
Area: Code generation
A-cranelift
Things relevant to the [future] cranelift backend
A-gcc
Things relevant to the [future] GCC backend
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
kennytm
added
the
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
label
Oct 14, 2017
bors
added a commit
that referenced
this issue
May 17, 2018
Rename trans to codegen everywhere. Part of #45274.
eddyb
changed the title
Rename librustc_trans to librustc_codegen_llvm.
Refactor librustc_codegen_llvm for multiple codegen backends.
Jul 13, 2018
bors
added a commit
that referenced
this issue
Jul 31, 2018
rustc_codegen_llvm: use safe references for LLVM FFI types. Part of #45274.
bors
added a commit
that referenced
this issue
Sep 7, 2018
rustc_codegen_llvm: traitification of LLVM-specific CodegenCx and Builder methods This PR is the continuation of #52461 in the grand plan of #45274 to allow for multiple codegen backends. A first attempt at this was #52987 but since @irinagpopa is no longer working on it I'm taking ownership of the PR. The changes are refactoring only and do not affect the logic of the code. Performance should not be impacted since all parametrization is done with generics (no trait objects). The `librustc_codegen_llvm` crate now contains a new folder `interfaces` that describes with traits part of how the compiler interfaces with LLVM during codegen. `CodegenCx` and `Builder` implement those traits. Many things are still missing. All the calls to LLVM are not yet under a trait, and later LLVM-agnostic code should be parametrized.
bors
added a commit
that referenced
this issue
Nov 17, 2018
rustc_codegen_llvm: traitification of LLVM-specific CodegenCx and Builder methods This PR is the continuation of #54012 and earlier PRs, in the grand plan of #45274 to allow for multiple codegen backends. High-level summary: interpose a set of traits between Rust's codegen logic and the LLVM APIs, allowing another backend to implement the traits and share most of the codegen logic. These traits are currently somewhat LLVM-specific, but once this refactoring is in place, they can evolve to be more general. See [this README](https://github.com/rust-lang/rust/blob/756f84d7cef90b7364ae88ca707e59670dde4c92/src/librustc_codegen_ssa/README.md) for a writeup on the current trait organization.
Centril
added
A-cranelift
Things relevant to the [future] cranelift backend
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Mar 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-codegen
Area: Code generation
A-cranelift
Things relevant to the [future] cranelift backend
A-gcc
Things relevant to the [future] GCC backend
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
[#50615] Renamelibrustc_trans
tolibrustc_codegen_llvm
.Makerustc_driver
either able to choose codegen backends, or even better, passrustc_codegen_llvm
torustc_driver
fromrustc-main
.See also #45226.
Possible refactoring steps:
removeSharedCrateContext
, useTyCtxt
rename(Local)CrateContext
toCodegenContext
, remove accessor methodsmergelibrustc_llvm
intolibrustc_codegen_llvm
passValueRef
as&'ll Value
instead, 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)cranelift
andllvm2cranelift
for common Cranelift/LLVM builder APIscommon tools used by SSA backends could be placed inrustc_codegen_ssa
rustc_codegen_ssa
APIs to match Cranelift, leave LLVM second-classbinemit
"?) and linking components, out ofrustc_codegen_ssa
The text was updated successfully, but these errors were encountered: