diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-16 15:45:46 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-17 10:24:43 +1000 |
| commit | 5f98943b5a6e1b5dcc1e815a823ef2e5d8c5deae (patch) | |
| tree | 969e7308db8929cab01963862e698dc973f672b5 /compiler/rustc_codegen_gcc/src | |
| parent | 47830edc336832931fe0a058e3eb5c2593c30a73 (diff) | |
| download | rust-5f98943b5a6e1b5dcc1e815a823ef2e5d8c5deae.tar.gz rust-5f98943b5a6e1b5dcc1e815a823ef2e5d8c5deae.zip | |
Merge `HasCodegen` into `BuilderMethods`.
It has `Backend` and `Deref` boudns, plus an associated type `CodegenCx`, and it has a single use. This commit "inlines" it into `BuilderMethods`, which makes the complicated backend trait situation a little simpler.
Diffstat (limited to 'compiler/rustc_codegen_gcc/src')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/builder.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index 31d778823e0..e98a097bf56 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -14,8 +14,8 @@ use rustc_codegen_ssa::common::{ use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; use rustc_codegen_ssa::mir::place::PlaceRef; use rustc_codegen_ssa::traits::{ - BackendTypes, BaseTypeMethods, BuilderMethods, ConstMethods, HasCodegen, LayoutTypeMethods, - OverflowOp, StaticBuilderMethods, + BackendTypes, BaseTypeMethods, BuilderMethods, ConstMethods, LayoutTypeMethods, OverflowOp, + StaticBuilderMethods, }; use rustc_codegen_ssa::MemFlags; use rustc_data_structures::fx::FxHashSet; @@ -460,10 +460,6 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { } } -impl<'gcc, 'tcx> HasCodegen<'tcx> for Builder<'_, 'gcc, 'tcx> { - type CodegenCx = CodegenCx<'gcc, 'tcx>; -} - impl<'tcx> HasTyCtxt<'tcx> for Builder<'_, '_, 'tcx> { fn tcx(&self) -> TyCtxt<'tcx> { self.cx.tcx() @@ -531,6 +527,8 @@ fn set_rvalue_location<'a, 'gcc, 'tcx>( } impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { + type CodegenCx = CodegenCx<'gcc, 'tcx>; + fn build(cx: &'a CodegenCx<'gcc, 'tcx>, block: Block<'gcc>) -> Builder<'a, 'gcc, 'tcx> { Builder::with_cx(cx, block) } |
