Skip to content

Commit 3242d4c

Browse files
committed
Consistently import llvm::Type and llvm::Value
1 parent 7950f24 commit 3242d4c

File tree

21 files changed

+29
-53
lines changed

21 files changed

+29
-53
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ use smallvec::SmallVec;
2323
use crate::attributes::{self, llfn_attrs_from_instance};
2424
use crate::builder::Builder;
2525
use crate::context::CodegenCx;
26-
use crate::llvm::{self, Attribute, AttributePlace};
26+
use crate::llvm::{self, Attribute, AttributePlace, Type, Value};
2727
use crate::llvm_util;
28-
use crate::type_::Type;
2928
use crate::type_of::LayoutLlvmExt;
30-
use crate::value::Value;
3129

3230
trait ArgAttributesExt {
3331
fn apply_attrs_to_llfn(&self, idx: AttributePlace, cx: &CodegenCx<'_, '_>, llfn: &Value);

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ use rustc_target::asm::*;
1313
use smallvec::SmallVec;
1414
use tracing::debug;
1515

16+
use crate::attributes;
1617
use crate::builder::Builder;
1718
use crate::common::Funclet;
1819
use crate::context::CodegenCx;
19-
use crate::llvm::ToLlvmBool;
20-
use crate::type_::Type;
20+
use crate::llvm::{self, ToLlvmBool, Type, Value};
2121
use crate::type_of::LayoutLlvmExt;
22-
use crate::value::Value;
23-
use crate::{attributes, llvm};
2422

2523
impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
2624
fn codegen_inline_asm(

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ use smallvec::SmallVec;
1313
use crate::context::SimpleCx;
1414
use crate::errors::SanitizerMemtagRequiresMte;
1515
use crate::llvm::AttributePlace::Function;
16-
use crate::llvm::{self, AllocKindFlags, Attribute, AttributeKind, AttributePlace, MemoryEffects};
17-
use crate::value::Value;
16+
use crate::llvm::{
17+
self, AllocKindFlags, Attribute, AttributeKind, AttributePlace, MemoryEffects, Value,
18+
};
1819
use crate::{Session, attributes, llvm_util};
1920

2021
pub(crate) fn apply_to_llfn(llfn: &Value, idx: AttributePlace, attrs: &[&Attribute]) {

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ use crate::errors::{
4343
WithLlvmError, WriteBytecode,
4444
};
4545
use crate::llvm::diagnostic::OptimizationDiagnosticKind::*;
46-
use crate::llvm::{self, DiagnosticInfo};
47-
use crate::type_::Type;
46+
use crate::llvm::{self, DiagnosticInfo, Type};
4847
use crate::{LlvmCodegenBackend, ModuleLlvm, base, common, llvm_util};
4948

5049
pub(crate) fn llvm_err<'a>(dcx: DiagCtxtHandle<'_>, err: LlvmError<'a>) -> ! {

compiler/rustc_codegen_llvm/src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ use rustc_span::Symbol;
2828
use rustc_target::spec::SanitizerSet;
2929

3030
use super::ModuleLlvm;
31+
use crate::attributes;
3132
use crate::builder::Builder;
3233
use crate::context::CodegenCx;
33-
use crate::value::Value;
34-
use crate::{attributes, llvm};
34+
use crate::llvm::{self, Value};
3535

3636
pub(crate) struct ValueIter<'ll> {
3737
cur: Option<&'ll Value>,

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ use crate::common::Funclet;
3737
use crate::context::{CodegenCx, FullCx, GenericCx, SCx};
3838
use crate::llvm::{
3939
self, AtomicOrdering, AtomicRmwBinOp, BasicBlock, GEPNoWrapFlags, Metadata, TRUE, ToLlvmBool,
40+
Type, Value,
4041
};
41-
use crate::type_::Type;
4242
use crate::type_of::LayoutLlvmExt;
43-
use crate::value::Value;
4443

4544
#[must_use]
4645
pub(crate) struct GenericBuilder<'a, 'll, CX: Borrow<SCx<'ll>>> {

compiler/rustc_codegen_llvm/src/builder/autodiff.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ use tracing::debug;
1212
use crate::builder::{Builder, PlaceRef, UNNAMED};
1313
use crate::context::SimpleCx;
1414
use crate::declare::declare_simple_fn;
15-
use crate::llvm;
16-
use crate::llvm::{Metadata, TRUE, Type};
17-
use crate::value::Value;
15+
use crate::llvm::{self, Metadata, TRUE, Type, Value};
1816

1917
pub(crate) fn adjust_activity_to_abi<'tcx>(
2018
tcx: TyCtxt<'tcx>,

compiler/rustc_codegen_llvm/src/callee.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use rustc_middle::ty::{self, Instance, TypeVisitableExt};
1010
use tracing::debug;
1111

1212
use crate::context::CodegenCx;
13-
use crate::llvm;
14-
use crate::value::Value;
13+
use crate::llvm::{self, Value};
1514

1615
/// Codegens a reference to a fn/method item, monomorphizing and
1716
/// inlining as it goes.

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ use tracing::debug;
2020
use crate::consts::const_alloc_to_llvm;
2121
pub(crate) use crate::context::CodegenCx;
2222
use crate::context::{GenericCx, SCx};
23-
use crate::llvm::{self, BasicBlock, ConstantInt, FALSE, Metadata, TRUE, ToLlvmBool};
24-
use crate::type_::Type;
25-
use crate::value::Value;
23+
use crate::llvm::{self, BasicBlock, ConstantInt, FALSE, Metadata, TRUE, ToLlvmBool, Type, Value};
2624

2725
/*
2826
* A note on nomenclature of linking: "extern", "foreign", and "upcall".

compiler/rustc_codegen_llvm/src/consts.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ use tracing::{debug, instrument, trace};
2121

2222
use crate::common::CodegenCx;
2323
use crate::errors::SymbolAlreadyDefined;
24-
use crate::type_::Type;
24+
use crate::llvm::{self, Type, Value};
2525
use crate::type_of::LayoutLlvmExt;
26-
use crate::value::Value;
27-
use crate::{base, debuginfo, llvm};
26+
use crate::{base, debuginfo};
2827

2928
pub(crate) fn const_alloc_to_llvm<'ll>(
3029
cx: &CodegenCx<'ll, '_>,

0 commit comments

Comments
 (0)