Skip to content

Commit 17306cc

Browse files
committed
make some things on foreign_items private
1 parent ac89697 commit 17306cc

File tree

12 files changed

+256
-256
lines changed

12 files changed

+256
-256
lines changed

src/shims/foreign_items.rs

Lines changed: 209 additions & 209 deletions
Large diffs are not rendered by default.

src/shims/unix/android/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_span::Symbol;
22
use rustc_target::spec::abi::Abi;
33

44
use crate::*;
5-
use shims::foreign_items::EmulateByNameResult;
5+
use shims::foreign_items::EmulateForeignItemResult;
66

77
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
88

@@ -17,7 +17,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1717
abi: Abi,
1818
args: &[OpTy<'tcx, Provenance>],
1919
dest: &PlaceTy<'tcx, Provenance>,
20-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
20+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2121
let this = self.eval_context_mut();
2222

2323
match link_name.as_str() {
@@ -26,10 +26,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2626
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
2727
this.write_null(dest)?;
2828
}
29-
_ => return Ok(EmulateByNameResult::NotSupported),
29+
_ => return Ok(EmulateForeignItemResult::NotSupported),
3030
}
3131

3232
#[allow(unreachable_code)]
33-
Ok(EmulateByNameResult::NeedsJumping)
33+
Ok(EmulateForeignItemResult::NeedsJumping)
3434
}
3535
}

src/shims/unix/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_target::abi::{Align, Size};
99
use rustc_target::spec::abi::Abi;
1010

1111
use crate::*;
12-
use shims::foreign_items::EmulateByNameResult;
12+
use shims::foreign_items::EmulateForeignItemResult;
1313
use shims::unix::fs::EvalContextExt as _;
1414
use shims::unix::mem::EvalContextExt as _;
1515
use shims::unix::sync::EvalContextExt as _;
@@ -28,7 +28,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2828
abi: Abi,
2929
args: &[OpTy<'tcx, Provenance>],
3030
dest: &PlaceTy<'tcx, Provenance>,
31-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
31+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
3232
let this = self.eval_context_mut();
3333

3434
// See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
@@ -626,11 +626,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
626626
"freebsd" => freebsd::EvalContextExt::emulate_foreign_item_inner(this, link_name, abi, args, dest),
627627
"linux" => linux::EvalContextExt::emulate_foreign_item_inner(this, link_name, abi, args, dest),
628628
"macos" => macos::EvalContextExt::emulate_foreign_item_inner(this, link_name, abi, args, dest),
629-
_ => Ok(EmulateByNameResult::NotSupported),
629+
_ => Ok(EmulateForeignItemResult::NotSupported),
630630
};
631631
}
632632
};
633633

634-
Ok(EmulateByNameResult::NeedsJumping)
634+
Ok(EmulateForeignItemResult::NeedsJumping)
635635
}
636636
}

src/shims/unix/freebsd/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_span::Symbol;
22
use rustc_target::spec::abi::Abi;
33

44
use crate::*;
5-
use shims::foreign_items::EmulateByNameResult;
5+
use shims::foreign_items::EmulateForeignItemResult;
66
use shims::unix::thread::EvalContextExt as _;
77

88
pub fn is_dyn_sym(_name: &str) -> bool {
@@ -17,7 +17,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1717
abi: Abi,
1818
args: &[OpTy<'tcx, Provenance>],
1919
dest: &PlaceTy<'tcx, Provenance>,
20-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
20+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2121
let this = self.eval_context_mut();
2222
match link_name.as_str() {
2323
// Threading
@@ -45,8 +45,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4545
this.write_scalar(errno_place.to_ref(this).to_scalar(), dest)?;
4646
}
4747

48-
_ => return Ok(EmulateByNameResult::NotSupported),
48+
_ => return Ok(EmulateForeignItemResult::NotSupported),
4949
}
50-
Ok(EmulateByNameResult::NeedsJumping)
50+
Ok(EmulateForeignItemResult::NeedsJumping)
5151
}
5252
}

src/shims/unix/linux/foreign_items.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_target::spec::abi::Abi;
44
use crate::machine::SIGRTMAX;
55
use crate::machine::SIGRTMIN;
66
use crate::*;
7-
use shims::foreign_items::EmulateByNameResult;
7+
use shims::foreign_items::EmulateForeignItemResult;
88
use shims::unix::fs::EvalContextExt as _;
99
use shims::unix::linux::fd::EvalContextExt as _;
1010
use shims::unix::linux::mem::EvalContextExt as _;
@@ -24,7 +24,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2424
abi: Abi,
2525
args: &[OpTy<'tcx, Provenance>],
2626
dest: &PlaceTy<'tcx, Provenance>,
27-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
27+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2828
let this = self.eval_context_mut();
2929

3030
// See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
@@ -186,7 +186,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
186186
}
187187
id => {
188188
this.handle_unsupported(format!("can't execute syscall with ID {id}"))?;
189-
return Ok(EmulateByNameResult::AlreadyJumped);
189+
return Ok(EmulateForeignItemResult::AlreadyJumped);
190190
}
191191
}
192192
}
@@ -217,10 +217,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
217217
this.write_null(dest)?;
218218
}
219219

220-
_ => return Ok(EmulateByNameResult::NotSupported),
220+
_ => return Ok(EmulateForeignItemResult::NotSupported),
221221
};
222222

223-
Ok(EmulateByNameResult::NeedsJumping)
223+
Ok(EmulateForeignItemResult::NeedsJumping)
224224
}
225225
}
226226

src/shims/unix/macos/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_span::Symbol;
22
use rustc_target::spec::abi::Abi;
33

44
use crate::*;
5-
use shims::foreign_items::EmulateByNameResult;
5+
use shims::foreign_items::EmulateForeignItemResult;
66
use shims::unix::fs::EvalContextExt as _;
77
use shims::unix::thread::EvalContextExt as _;
88

@@ -18,7 +18,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1818
abi: Abi,
1919
args: &[OpTy<'tcx, Provenance>],
2020
dest: &PlaceTy<'tcx, Provenance>,
21-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
21+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2222
let this = self.eval_context_mut();
2323

2424
// See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
@@ -209,9 +209,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
209209
this.write_scalar(res, dest)?;
210210
}
211211

212-
_ => return Ok(EmulateByNameResult::NotSupported),
212+
_ => return Ok(EmulateForeignItemResult::NotSupported),
213213
};
214214

215-
Ok(EmulateByNameResult::NeedsJumping)
215+
Ok(EmulateForeignItemResult::NeedsJumping)
216216
}
217217
}

src/shims/windows/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_target::abi::Size;
66
use rustc_target::spec::abi::Abi;
77

88
use crate::*;
9-
use shims::foreign_items::EmulateByNameResult;
9+
use shims::foreign_items::EmulateForeignItemResult;
1010
use shims::windows::handle::{EvalContextExt as _, Handle, PseudoHandle};
1111
use shims::windows::sync::EvalContextExt as _;
1212
use shims::windows::thread::EvalContextExt as _;
@@ -23,7 +23,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2323
abi: Abi,
2424
args: &[OpTy<'tcx, Provenance>],
2525
dest: &PlaceTy<'tcx, Provenance>,
26-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
26+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2727
let this = self.eval_context_mut();
2828

2929
// See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
@@ -583,9 +583,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
583583
this.write_null(dest)?;
584584
}
585585

586-
_ => return Ok(EmulateByNameResult::NotSupported),
586+
_ => return Ok(EmulateForeignItemResult::NotSupported),
587587
}
588588

589-
Ok(EmulateByNameResult::NeedsJumping)
589+
Ok(EmulateForeignItemResult::NeedsJumping)
590590
}
591591
}

src/shims/x86/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_target::spec::abi::Abi;
55

66
use crate::*;
77
use helpers::bool_to_simd_element;
8-
use shims::foreign_items::EmulateByNameResult;
8+
use shims::foreign_items::EmulateForeignItemResult;
99

1010
mod sse;
1111
mod sse2;
@@ -22,7 +22,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
2222
abi: Abi,
2323
args: &[OpTy<'tcx, Provenance>],
2424
dest: &PlaceTy<'tcx, Provenance>,
25-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
25+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2626
let this = self.eval_context_mut();
2727
// Prefix should have already been checked.
2828
let unprefixed_name = link_name.as_str().strip_prefix("llvm.x86.").unwrap();
@@ -34,7 +34,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
3434
// https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/addcarry-u32-addcarry-u64.html
3535
"addcarry.32" | "addcarry.64" => {
3636
if unprefixed_name == "addcarry.64" && this.tcx.sess.target.arch != "x86_64" {
37-
return Ok(EmulateByNameResult::NotSupported);
37+
return Ok(EmulateForeignItemResult::NotSupported);
3838
}
3939

4040
let [c_in, a, b] = this.check_shim(abi, Abi::Unadjusted, link_name, args)?;
@@ -60,7 +60,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
6060
// https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/subborrow-u32-subborrow-u64.html
6161
"subborrow.32" | "subborrow.64" => {
6262
if unprefixed_name == "subborrow.64" && this.tcx.sess.target.arch != "x86_64" {
63-
return Ok(EmulateByNameResult::NotSupported);
63+
return Ok(EmulateForeignItemResult::NotSupported);
6464
}
6565

6666
let [b_in, a, b] = this.check_shim(abi, Abi::Unadjusted, link_name, args)?;
@@ -100,9 +100,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
100100
this, link_name, abi, args, dest,
101101
);
102102
}
103-
_ => return Ok(EmulateByNameResult::NotSupported),
103+
_ => return Ok(EmulateForeignItemResult::NotSupported),
104104
}
105-
Ok(EmulateByNameResult::NeedsJumping)
105+
Ok(EmulateForeignItemResult::NeedsJumping)
106106
}
107107
}
108108

src/shims/x86/sse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rand::Rng as _;
77

88
use super::{bin_op_simd_float_all, bin_op_simd_float_first, FloatBinOp, FloatCmpOp};
99
use crate::*;
10-
use shims::foreign_items::EmulateByNameResult;
10+
use shims::foreign_items::EmulateForeignItemResult;
1111

1212
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
1313
pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
@@ -19,7 +19,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
1919
abi: Abi,
2020
args: &[OpTy<'tcx, Provenance>],
2121
dest: &PlaceTy<'tcx, Provenance>,
22-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
22+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2323
let this = self.eval_context_mut();
2424
// Prefix should have already been checked.
2525
let unprefixed_name = link_name.as_str().strip_prefix("llvm.x86.sse.").unwrap();
@@ -228,9 +228,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
228228

229229
this.write_scalar(Scalar::from_u32(res), dest)?;
230230
}
231-
_ => return Ok(EmulateByNameResult::NotSupported),
231+
_ => return Ok(EmulateForeignItemResult::NotSupported),
232232
}
233-
Ok(EmulateByNameResult::NeedsJumping)
233+
Ok(EmulateForeignItemResult::NeedsJumping)
234234
}
235235
}
236236

src/shims/x86/sse2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_target::spec::abi::Abi;
1010

1111
use super::{bin_op_simd_float_all, bin_op_simd_float_first, FloatBinOp, FloatCmpOp};
1212
use crate::*;
13-
use shims::foreign_items::EmulateByNameResult;
13+
use shims::foreign_items::EmulateForeignItemResult;
1414

1515
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
1616
pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
@@ -22,7 +22,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
2222
abi: Abi,
2323
args: &[OpTy<'tcx, Provenance>],
2424
dest: &PlaceTy<'tcx, Provenance>,
25-
) -> InterpResult<'tcx, EmulateByNameResult<'mir, 'tcx>> {
25+
) -> InterpResult<'tcx, EmulateForeignItemResult> {
2626
let this = self.eval_context_mut();
2727
// Prefix should have already been checked.
2828
let unprefixed_name = link_name.as_str().strip_prefix("llvm.x86.sse2.").unwrap();
@@ -797,9 +797,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
797797
let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
798798
this.yield_active_thread();
799799
}
800-
_ => return Ok(EmulateByNameResult::NotSupported),
800+
_ => return Ok(EmulateForeignItemResult::NotSupported),
801801
}
802-
Ok(EmulateByNameResult::NeedsJumping)
802+
Ok(EmulateForeignItemResult::NeedsJumping)
803803
}
804804
}
805805

0 commit comments

Comments
 (0)