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 | 6ecaca1f06718ffab58131b56be4ad61d7c65596 (patch) | |
| tree | 2706ab3fdb99ad486e25cbd93e05ea7c3ef13524 | |
| parent | ec1545d9711064b6b0b07b738cf6ac625539c6a4 (diff) | |
| download | rust-6ecaca1f06718ffab58131b56be4ad61d7c65596.tar.gz rust-6ecaca1f06718ffab58131b56be4ad61d7c65596.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.
| -rw-r--r-- | src/builder.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/builder.rs b/src/builder.rs index 31d778823e0..e98a097bf56 100644 --- a/src/builder.rs +++ b/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) } |
