Skip to content

Commit

Permalink
Re-export all TIR nodes at the top level
Browse files Browse the repository at this point in the history
  • Loading branch information
kontheocharis committed Sep 14, 2023
1 parent c1a002b commit e9c48a6
Show file tree
Hide file tree
Showing 112 changed files with 331 additions and 582 deletions.
7 changes: 2 additions & 5 deletions compiler/hash-ast-expand/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ use hash_target::HasTarget;
use hash_tir::{
intrinsics::definitions::Primitive,
tir::{
args::Arg,
lits::{CharLit, FloatLit, IntLit, Lit, StrLit},
node::{Node, NodeOrigin},
params::{utils::validate_and_reorder_args_against_params, ParamIndex},
terms::{Term, Ty, TyId},
validate_and_reorder_args_against_params, Arg, CharLit, FloatLit, IntLit, Lit, Node,
NodeOrigin, ParamIndex, StrLit, Term, Ty, TyId,
},
};

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-ast-expand/src/diagnostics/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use hash_reporting::{
reporter::{Reporter, Reports},
};
use hash_source::identifier::Identifier;
use hash_tir::tir::{params::utils::ParamError, terms::TyId};
use hash_tir::tir::{ParamError, TyId};
use hash_utils::derive_more::{Constructor, From};

#[derive(Constructor, Debug)]
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-ast-utils/src/pretty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ mod state;
use collection::CollectionPrintingOptions;
use config::AstPrintingConfig;
use hash_ast::{
ast::{self, walk_mut_self, AstVisitorMutSelf, ParamOrigin},
ast::{
walk_mut_self, AstVisitorMutSelf, ParamOrigin, {self},
},
ast_visitor_mut_self_default_impl,
};
use hash_token::{delimiter::Delimiter, FloatLitKind, IntLitKind};
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-attrs/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use hash_source::{
};
use hash_storage::store::{DefaultPartialStore, PartialStore};
use hash_target::{abi::Integer, data_layout::HasDataLayout, primitives::IntTy, size::Size};
use hash_tir::tir::params::ParamIndex;
use hash_tir::tir::ParamIndex;
use hash_utils::{derive_more::From, fxhash::FxHashMap, lazy_static::lazy_static};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-attrs/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use hash_ast_utils::attr::AttrTarget;
use hash_source::identifier::Identifier;
use hash_tir::tir::params::ParamsId;
use hash_tir::tir::ParamsId;
use hash_utils::{
fxhash::FxHashMap,
index_vec::{define_index_type, IndexVec},
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen-llvm/src/translation/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use hash_codegen::{
},
traits::{constants::ConstValueBuilderMethods, ty::TypeBuilderMethods},
};
use hash_ir::constant::{self, AllocRange};
use hash_ir::constant::{
AllocRange, {self},
};
use hash_source::constant::{InternedStr, Size};
use hash_storage::store::statics::StoreId;
use inkwell::{
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen/src/lower/locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use core::fmt;

use fixedbitset::FixedBitSet;
use hash_ir::{
ir::{self, IrRef, Local, PlaceProjection, START_BLOCK},
ir::{
IrRef, Local, PlaceProjection, START_BLOCK, {self},
},
traversal,
visitor::{ImmutablePlaceContext, IrVisitorMut, MutablePlaceContext, PlaceContext},
};
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen/src/lower/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use std::iter;
use fixedbitset::FixedBitSet;
use hash_abi::{FnAbiId, PassMode};
use hash_ir::{
ir::{self, Local},
ir::{
Local, {self},
},
traversal,
ty::InstanceId,
};
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen/src/lower/operands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use hash_ir::{
use hash_layout::TyInfo;
use hash_storage::store::statics::StoreId;
use hash_target::{
abi::{self, AbiRepresentation},
abi::{
AbiRepresentation, {self},
},
alignment::Alignment,
size::Size,
};
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen/src/lower/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
//! IR.
use hash_ir::{
ir::{self, ProjectionId},
ir::{
ProjectionId, {self},
},
ty::{IrTyId, PlaceTy, VariantIdx},
};
use hash_layout::{LayoutShape, Variants};
Expand Down
8 changes: 6 additions & 2 deletions compiler/hash-codegen/src/lower/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ use std::cmp::Ordering;

use hash_ir::{
cast::{CastTy, IntCastKind},
ir::{self, BinOp, RValue},
ty::{self, IrTyId, RefKind, VariantIdx, COMMON_IR_TYS},
ir::{
BinOp, RValue, {self},
},
ty::{
IrTyId, RefKind, VariantIdx, COMMON_IR_TYS, {self},
},
};
use hash_storage::store::statics::StoreId;

Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-codegen/src/traits/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
//! entry point of the program.
use hash_abi::FnAbi;
use hash_ir::ty::{self, InstanceId};
use hash_ir::ty::{
InstanceId, {self},
};

use super::BackendTypes;

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-exhaustiveness/src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! used within the exhaustiveness sub-system to represent these values within
//! a single data type.
use hash_source::constant::InternedInt;
use hash_tir::tir::terms::TyId;
use hash_tir::tir::TyId;

#[derive(Debug, Clone, Copy)]
pub struct Constant {
Expand Down
10 changes: 4 additions & 6 deletions compiler/hash-exhaustiveness/src/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
//!
//! In other words, all the possible (valid) values of the `char` type.
//! A similar process occurs with all other wildcard types,
use std::fmt::{self, Debug};
use std::fmt::{
Debug, {self},
};

use hash_source::constant::InternedStr;
use hash_storage::store::{statics::StoreId, SequenceStoreKey, Store};
use hash_tir::tir::{
data::{CtorDefId, DataTy},
node::NodesId,
terms::{tuples::TupleTy, Ty},
};
use hash_tir::tir::{CtorDefId, DataTy, NodesId, TupleTy, Ty};
use hash_utils::smallvec::{smallvec, SmallVec};

use super::range::{IntRange, SplitIntRange};
Expand Down
11 changes: 4 additions & 7 deletions compiler/hash-exhaustiveness/src/deconstruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@
//! [DeconstructedPat]s stored within the `fields` parameter of the structure.
use std::{
cell::Cell,
fmt::{self, Debug},
fmt::{
Debug, {self},
},
};

use hash_storage::store::{statics::StoreId, Store};
use hash_tir::{
intrinsics::utils::try_use_ty_as_array_ty,
tir::{
data::{CtorDefId, DataTy},
node::NodesId,
pats::PatId,
terms::{Ty, TyId},
},
tir::{CtorDefId, DataTy, NodesId, PatId, Ty, TyId},
};
use hash_utils::{itertools::Itertools, smallvec::SmallVec};

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-exhaustiveness/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use hash_reporting::{
reporter::Reporter,
};
use hash_source::location::Span;
use hash_tir::tir::{lits::LitPat, node::HasAstNodeId, pats::PatId};
use hash_tir::tir::{HasAstNodeId, LitPat, PatId};
use hash_utils::{
itertools::Itertools,
pluralise,
Expand Down
6 changes: 1 addition & 5 deletions compiler/hash-exhaustiveness/src/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
use hash_storage::store::{statics::StoreId, Store};
use hash_tir::{
intrinsics::utils::try_use_ty_as_array_ty,
tir::{
data::{CtorDefId, DataDefCtors, DataTy},
node::NodesId,
terms::{tuples::TupleTy, Ty, TyId},
},
tir::{CtorDefId, DataDefCtors, DataTy, NodesId, TupleTy, Ty, TyId},
};
use hash_utils::itertools::Itertools;

Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-exhaustiveness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ use hash_reporting::diagnostic::Diagnostics;
use hash_source::location::Span;
use hash_storage::store::CloneStore;
use hash_target::HasTarget;
use hash_tir::tir::{pats::PatId, terms::TyId};
use hash_tir::tir::{PatId, TyId};
use hash_utils::derive_more::Deref;
use storage::{
DeconstructedCtorId, DeconstructedCtorStore, DeconstructedPatId, DeconstructedPatStore,
Expand Down
16 changes: 3 additions & 13 deletions compiler/hash-exhaustiveness/src/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,9 @@ use hash_tir::{
scopes::BindingPat,
term_as_variant,
tir::{
args::{PatArg, PatArgsId, PatOrCapture},
data::{ArrayCtorInfo, CtorDefId, CtorPat, DataTy},
lits::{CharLit, IntLit, Lit, LitPat, StrLit},
node::{Node, NodeOrigin, NodesId},
params::{ParamId, ParamsId},
pats::{Pat, PatId, RangePat, Spread},
symbols::SymbolId,
terms::{
arrays::ArrayPat,
control::{IfPat, OrPat},
tuples::{TuplePat, TupleTy},
Ty, TyId,
},
ArrayCtorInfo, ArrayPat, CharLit, CtorDefId, CtorPat, DataTy, IfPat, IntLit, Lit, LitPat,
Node, NodeOrigin, NodesId, OrPat, ParamId, ParamsId, Pat, PatArg, PatArgsId, PatId,
PatOrCapture, RangePat, Spread, StrLit, SymbolId, TuplePat, TupleTy, Ty, TyId,
},
};
use hash_utils::{itertools::Itertools, smallvec::SmallVec};
Expand Down
5 changes: 1 addition & 4 deletions compiler/hash-exhaustiveness/src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ use hash_reporting::diagnostic::Diagnostics;
use hash_storage::store::Store;
use hash_tir::{
intrinsics::utils::try_use_ty_as_int_ty,
tir::{
pats::{PatId, RangePat},
terms::TyId,
},
tir::{PatId, RangePat, TyId},
};

use crate::{
Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-exhaustiveness/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
//! transformations, and [StackOps] contains functions
//! that are relevant to the usefulness and exhaustiveness
//! algorithm.
use std::fmt::{self, Debug};
use std::fmt::{
Debug, {self},
};

use hash_utils::smallvec::{smallvec, SmallVec};

Expand Down
4 changes: 2 additions & 2 deletions compiler/hash-exhaustiveness/src/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use std::iter::once;

use hash_storage::store::Store;
use hash_tir::tir::{pats::PatId, terms::TyId};
use hash_tir::tir::{PatId, TyId};
use hash_utils::{itertools::Itertools, stack::ensure_sufficient_stack};

use super::{
Expand Down Expand Up @@ -113,7 +113,7 @@ pub(crate) struct MatchArm {
/// Whether the arm has an `if-guard`.
pub(crate) has_guard: bool,

/// The corresponding [hash_tir::tir::pats::Pat] with this
/// The corresponding [hash_tir::tir::Pat] with this
/// match arm.
pub(crate) id: PatId,
}
Expand Down
5 changes: 1 addition & 4 deletions compiler/hash-exhaustiveness/src/wildcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use hash_storage::store::{statics::StoreId, SequenceStoreKey, Store, TrivialSequ
use hash_target::size::Size;
use hash_tir::{
intrinsics::utils::try_use_ty_as_int_ty,
tir::{
data::{DataDefCtors, DataTy, NumericCtorBits, PrimitiveCtorInfo},
terms::Ty,
},
tir::{DataDefCtors, DataTy, NumericCtorBits, PrimitiveCtorInfo, Ty},
};
use hash_utils::smallvec::{smallvec, SmallVec};

Expand Down
4 changes: 3 additions & 1 deletion compiler/hash-ir-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ pub mod pretty;

use std::{
fmt,
io::{self, Write},
io::{
Write, {self},
},
iter,
ops::Deref,
};
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-ir/src/basic_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::{cell::OnceCell, fmt};

use hash_utils::{
graph::{
self,
dominators::{dominators, Dominators},
{self},
},
index_vec::IndexVec,
smallvec::{smallvec, SmallVec},
Expand Down
2 changes: 1 addition & 1 deletion compiler/hash-ir/src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use hash_storage::{static_single_store, store::statics::StoreId};
use hash_target::{
alignment::Alignment, data_layout::HasDataLayout, primitives::IntTy, size::Size,
};
use hash_tir::tir::lits::Lit;
use hash_tir::tir::Lit;
use hash_utils::derive_more::Constructor;

use crate::{
Expand Down
8 changes: 6 additions & 2 deletions compiler/hash-ir/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
use core::slice;
use std::{
fmt,
iter::{self, once},
iter::{
once, {self},
},
};

use hash_ast::ast::AstNodeId;
Expand All @@ -21,7 +23,9 @@ use hash_tir::intrinsics::definitions::{
};
use hash_utils::{
graph::dominators::Dominators,
index_vec::{self, IndexVec},
index_vec::{
IndexVec, {self},
},
smallvec::{smallvec, SmallVec},
};

Expand Down
5 changes: 1 addition & 4 deletions compiler/hash-ir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ use hash_source::entry_point::EntryPointState;
use hash_storage::{store::SequenceStoreKey, stores};
use hash_tir::{
intrinsics::definitions::Intrinsic as TirIntrinsic,
tir::{
data::{DataDefId, DataTy},
terms::{fns::FnDefId, TyId},
},
tir::{DataDefId, DataTy, FnDefId, TyId},
};
use hash_utils::fxhash::FxHashMap;
use intrinsics::Intrinsics;
Expand Down
12 changes: 9 additions & 3 deletions compiler/hash-ir/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use std::{
cmp,
fmt::{self, Debug},
fmt::{
Debug, {self},
},
};

use hash_ast::ast;
Expand All @@ -28,14 +30,18 @@ use hash_storage::{
},
};
use hash_target::{
abi::{self, Abi, Integer, ScalarKind},
abi::{
Abi, Integer, ScalarKind, {self},
},
data_layout::HasDataLayout,
primitives::BigIntTy,
size::Size,
};
use hash_utils::{
bitflags::bitflags,
index_vec::{self, index_vec, IndexVec},
index_vec::{
index_vec, IndexVec, {self},
},
lazy_static,
};

Expand Down
3 changes: 1 addition & 2 deletions compiler/hash-lexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ use std::cell::Cell;
use error::{LexerDiagnostics, LexerError, LexerErrorKind, LexerResult, NumericLitKind};
use hash_reporting::diagnostic::AccessToDiagnosticsMut;
use hash_source::{
self,
identifier::{Identifier, IDENTS},
location::{ByteRange, Span, SpannedSource},
SourceId,
SourceId, {self},
};
use hash_target::primitives::{FloatTy, IntTy};
use hash_token::{
Expand Down
Loading

0 comments on commit e9c48a6

Please sign in to comment.