Skip to content

Commit

Permalink
compiler: Add rustc_abi to _sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Nov 3, 2024
1 parent 31cbde0 commit ab6994f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4337,6 +4337,7 @@ name = "rustc_sanitizers"
version = "0.0.0"
dependencies = [
"bitflags 2.6.0",
"rustc_abi",
"rustc_data_structures",
"rustc_hir",
"rustc_middle",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_sanitizers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
bitflags = "2.5.0"
tracing = "0.1"
twox-hash = "1.6.3"
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir = { path = "../rustc_hir" }
rustc_middle = { path = "../rustc_middle" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use std::fmt::Write as _;

use rustc_abi::{ExternAbi, Integer};
use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, CASE_INSENSITIVE, ToBaseN};
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
Expand All @@ -18,8 +19,6 @@ use rustc_middle::ty::{
};
use rustc_span::def_id::DefId;
use rustc_span::sym;
use rustc_target::abi::Integer;
use rustc_target::spec::abi::Abi;
use tracing::instrument;

use crate::cfi::typeid::TypeIdOptions;
Expand Down Expand Up @@ -185,7 +184,7 @@ fn encode_fnsig<'tcx>(
let mut encode_ty_options = EncodeTyOptions::from_bits(options.bits())
.unwrap_or_else(|| bug!("encode_fnsig: invalid option(s) `{:?}`", options.bits()));
match fn_sig.abi {
Abi::C { .. } => {
ExternAbi::C { .. } => {
encode_ty_options.insert(EncodeTyOptions::GENERALIZE_REPR_C);
}
_ => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::bug;
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
use rustc_target::abi::call::{Conv, FnAbi, PassMode};
use rustc_target::callconv::{Conv, FnAbi, PassMode};
use tracing::instrument;

mod encode;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_sanitizers/src/cfi/typeid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use bitflags::bitflags;
use rustc_middle::ty::{Instance, Ty, TyCtxt};
use rustc_target::abi::call::FnAbi;
use rustc_target::callconv::FnAbi;

bitflags! {
/// Options for typeid_for_fnabi.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use std::hash::Hasher;

use rustc_middle::ty::{Instance, InstanceKind, ReifyReason, Ty, TyCtxt};
use rustc_target::abi::call::FnAbi;
use rustc_target::callconv::FnAbi;
use twox_hash::XxHash64;

pub use crate::cfi::typeid::{TypeIdOptions, itanium_cxx_abi};
Expand Down

0 comments on commit ab6994f

Please sign in to comment.