Skip to content

Commit 69a975f

Browse files
committed
Consistently import llvm::Type and llvm::Value
1 parent 4fa824b commit 69a975f

File tree

20 files changed

+28
-52
lines changed

20 files changed

+28
-52
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ use smallvec::SmallVec;
2222
use crate::attributes::{self, llfn_attrs_from_instance};
2323
use crate::builder::Builder;
2424
use crate::context::CodegenCx;
25-
use crate::llvm::{self, Attribute, AttributePlace};
25+
use crate::llvm::{self, Attribute, AttributePlace, Type, Value};
2626
use crate::llvm_util;
27-
use crate::type_::Type;
2827
use crate::type_of::LayoutLlvmExt;
29-
use crate::value::Value;
3028

3129
trait ArgAttributesExt {
3230
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/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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ use crate::common::Funclet;
3737
use crate::context::{CodegenCx, FullCx, GenericCx, SCx};
3838
use crate::llvm::{
3939
self, AtomicOrdering, AtomicRmwBinOp, BasicBlock, FromGeneric, GEPNoWrapFlags, Metadata, TRUE,
40-
ToLlvmBool,
40+
ToLlvmBool, Type, Value,
4141
};
42-
use crate::type_::Type;
4342
use crate::type_of::LayoutLlvmExt;
44-
use crate::value::Value;
4543

4644
#[must_use]
4745
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, '_>,

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ use crate::abi::to_llvm_calling_convention;
3535
use crate::back::write::to_llvm_code_model;
3636
use crate::callee::get_fn;
3737
use crate::debuginfo::metadata::apply_vcall_visibility_metadata;
38-
use crate::llvm::{Metadata, MetadataKindId, Module};
39-
use crate::type_::Type;
40-
use crate::value::Value;
41-
use crate::{attributes, common, coverageinfo, debuginfo, llvm, llvm_util};
38+
use crate::llvm::{self, Metadata, MetadataKindId, Module, Type, Value};
39+
use crate::{attributes, common, coverageinfo, debuginfo, llvm_util};
4240

4341
/// `TyCtxt` (and related cache datastructures) can't be move between threads.
4442
/// However, there are various cx related functions which we want to be available to the builder and

0 commit comments

Comments
 (0)