Skip to content

Commit 6beb6f8

Browse files
committed
Rename supertraits of CodegenMethods.
Supertraits of `BuilderMethods` are all called `XyzBuilderMethods`. Supertraits of `CodegenMethods` are all called `XyzMethods`. This commit changes the latter to `XyzCodegenMethods`, for consistency.
1 parent 748a44b commit 6beb6f8

File tree

15 files changed

+35
-27
lines changed

15 files changed

+35
-27
lines changed

src/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(feature = "master")]
22
use gccjit::FnAttribute;
33
use gccjit::{ToLValue, ToRValue, Type};
4-
use rustc_codegen_ssa::traits::{AbiBuilderMethods, BaseTypeMethods};
4+
use rustc_codegen_ssa::traits::{AbiBuilderMethods, BaseTypeCodegenMethods};
55
use rustc_data_structures::fx::FxHashSet;
66
use rustc_middle::bug;
77
use rustc_middle::ty::layout::LayoutOf;

src/asm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
55
use rustc_codegen_ssa::mir::operand::OperandValue;
66
use rustc_codegen_ssa::mir::place::PlaceRef;
77
use rustc_codegen_ssa::traits::{
8-
AsmBuilderMethods, AsmMethods, BaseTypeMethods, BuilderMethods, GlobalAsmOperandRef,
9-
InlineAsmOperandRef,
8+
AsmBuilderMethods, AsmCodegenMethods, BaseTypeCodegenMethods, BuilderMethods,
9+
GlobalAsmOperandRef, InlineAsmOperandRef,
1010
};
1111
use rustc_middle::bug;
1212
use rustc_middle::ty::Instance;
@@ -770,7 +770,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
770770
}
771771
}
772772

773-
impl<'gcc, 'tcx> AsmMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
773+
impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
774774
fn codegen_global_asm(
775775
&self,
776776
template: &[InlineAsmTemplatePiece],

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::time::Instant;
66
use gccjit::{CType, FunctionType, GlobalKind};
77
use rustc_codegen_ssa::base::maybe_create_entry_wrapper;
88
use rustc_codegen_ssa::mono_item::MonoItemExt;
9-
use rustc_codegen_ssa::traits::DebugInfoMethods;
9+
use rustc_codegen_ssa::traits::DebugInfoCodegenMethods;
1010
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind};
1111
use rustc_middle::dep_graph;
1212
use rustc_middle::mir::mono::Linkage;

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use rustc_codegen_ssa::common::{
1414
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
1515
use rustc_codegen_ssa::mir::place::PlaceRef;
1616
use rustc_codegen_ssa::traits::{
17-
BackendTypes, BaseTypeMethods, BuilderMethods, ConstMethods, LayoutTypeMethods, OverflowOp,
18-
StaticBuilderMethods,
17+
BackendTypes, BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods,
18+
LayoutTypeCodegenMethods, OverflowOp, StaticBuilderMethods,
1919
};
2020
use rustc_codegen_ssa::MemFlags;
2121
use rustc_data_structures::fx::FxHashSet;

src/common.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use gccjit::{LValue, RValue, ToRValue, Type};
2-
use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods, MiscMethods, StaticMethods};
2+
use rustc_codegen_ssa::traits::{
3+
BaseTypeCodegenMethods, ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods,
4+
};
35
use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar};
46
use rustc_middle::mir::Mutability;
57
use rustc_middle::ty::layout::LayoutOf;
@@ -55,7 +57,7 @@ pub fn type_is_pointer(typ: Type<'_>) -> bool {
5557
typ.get_pointee().is_some()
5658
}
5759

58-
impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
60+
impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
5961
fn const_null(&self, typ: Type<'gcc>) -> RValue<'gcc> {
6062
if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) }
6163
}

src/consts.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#[cfg(feature = "master")]
22
use gccjit::{FnAttribute, VarAttribute, Visibility};
33
use gccjit::{Function, GlobalKind, LValue, RValue, ToRValue, Type};
4-
use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods, StaticMethods};
4+
use rustc_codegen_ssa::traits::{
5+
BaseTypeCodegenMethods, ConstCodegenMethods, StaticCodegenMethods,
6+
};
57
use rustc_hir::def::DefKind;
68
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
79
use rustc_middle::mir::interpret::{
@@ -37,7 +39,7 @@ fn set_global_alignment<'gcc, 'tcx>(
3739
gv.set_alignment(align.bytes() as i32);
3840
}
3941

40-
impl<'gcc, 'tcx> StaticMethods for CodegenCx<'gcc, 'tcx> {
42+
impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {
4143
fn static_addr_of(&self, cv: RValue<'gcc>, align: Align, kind: Option<&str>) -> RValue<'gcc> {
4244
// TODO(antoyo): implement a proper rvalue comparison in libgccjit instead of doing the
4345
// following:

src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use gccjit::{
55
};
66
use rustc_codegen_ssa::base::wants_msvc_seh;
77
use rustc_codegen_ssa::errors as ssa_errors;
8-
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeMethods, MiscMethods};
8+
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, MiscCodegenMethods};
99
use rustc_data_structures::base_n::{ToBaseN, ALPHANUMERIC_ONLY};
1010
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1111
use rustc_middle::mir::mono::CodegenUnit;
@@ -426,7 +426,7 @@ impl<'gcc, 'tcx> BackendTypes for CodegenCx<'gcc, 'tcx> {
426426
type DIVariable = (); // TODO(antoyo)
427427
}
428428

429-
impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
429+
impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
430430
fn vtables(
431431
&self,
432432
) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), RValue<'gcc>>> {

src/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::ops::Range;
22

33
use gccjit::{Location, RValue};
44
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
5-
use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoMethods};
5+
use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoCodegenMethods};
66
use rustc_data_structures::sync::Lrc;
77
use rustc_index::bit_set::BitSet;
88
use rustc_index::{Idx, IndexVec};
@@ -206,7 +206,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
206206
}
207207
}
208208

209-
impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
209+
impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
210210
fn create_vtable_debuginfo(
211211
&self,
212212
_ty: Ty<'tcx>,

src/declare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(feature = "master")]
22
use gccjit::{FnAttribute, ToRValue};
33
use gccjit::{Function, FunctionType, GlobalKind, LValue, RValue, Type};
4-
use rustc_codegen_ssa::traits::BaseTypeMethods;
4+
use rustc_codegen_ssa::traits::BaseTypeCodegenMethods;
55
use rustc_middle::ty::Ty;
66
use rustc_span::Symbol;
77
use rustc_target::abi::call::FnAbi;

src/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use gccjit::{BinaryOp, ComparisonOp, FunctionType, Location, RValue, ToRValue, Type, UnaryOp};
66
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
7-
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeMethods, BuilderMethods, OverflowOp};
7+
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, BuilderMethods, OverflowOp};
88
use rustc_middle::ty::{ParamEnv, Ty};
99
use rustc_target::abi::call::{ArgAbi, ArgAttributes, Conv, FnAbi, PassMode};
1010
use rustc_target::abi::Endian;

0 commit comments

Comments
 (0)