summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-09-16 15:45:46 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-09-17 10:24:43 +1000
commit5f98943b5a6e1b5dcc1e815a823ef2e5d8c5deae (patch)
tree969e7308db8929cab01963862e698dc973f672b5 /compiler/rustc_codegen_llvm/src/builder.rs
parent47830edc336832931fe0a058e3eb5c2593c30a73 (diff)
downloadrust-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_llvm/src/builder.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 40783825cae..ed22bf294c2 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -124,10 +124,6 @@ impl<'ll, 'tcx> Deref for Builder<'_, 'll, 'tcx> {
     }
 }
 
-impl<'ll, 'tcx> HasCodegen<'tcx> for Builder<'_, 'll, 'tcx> {
-    type CodegenCx = CodegenCx<'ll, 'tcx>;
-}
-
 macro_rules! builder_methods_for_value_instructions {
     ($($name:ident($($arg:ident),*) => $llvm_capi:ident),+ $(,)?) => {
         $(fn $name(&mut self, $($arg: &'ll Value),*) -> &'ll Value {
@@ -139,6 +135,8 @@ macro_rules! builder_methods_for_value_instructions {
 }
 
 impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
+    type CodegenCx = CodegenCx<'ll, 'tcx>;
+
     fn build(cx: &'a CodegenCx<'ll, 'tcx>, llbb: &'ll BasicBlock) -> Self {
         let bx = Builder::with_cx(cx);
         unsafe {