Merge pull request #687 from RalfJung/rustup

rustup
This commit is contained in:
Ralf Jung 2019-04-12 13:39:19 +02:00 committed by GitHub
commit 164a89fa12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 12 deletions

View File

@ -1 +1 @@
3de0106789468b211bcc3a25c09c0cf07119186d
2226c09699a96520238e162777f44504f4a0a1a7

View File

@ -62,11 +62,11 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
let this = self.eval_context_mut();
let attrs = this.tcx.get_attrs(def_id);
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
Some(name) => name.as_str().get(),
None => this.tcx.item_name(def_id).as_str().get(),
Some(name) => name.as_str(),
None => this.tcx.item_name(def_id).as_str(),
};
// Strip linker suffixes (seen on 32-bit macOS).
let link_name = link_name.trim_end_matches("$UNIX2003");
let link_name = link_name.get().trim_end_matches("$UNIX2003");
let tcx = &{this.tcx.tcx};
// First: functions that could diverge.

View File

@ -27,8 +27,8 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
// (as opposed to through a place), we have to remember to erase any tag
// that might still hang around!
let intrinsic_name = this.tcx.item_name(instance.def_id()).as_str().get();
match intrinsic_name {
let intrinsic_name = this.tcx.item_name(instance.def_id()).as_str();
match intrinsic_name.get() {
"arith_offset" => {
let offset = this.read_scalar(args[1])?.to_isize(this)?;
let ptr = this.read_scalar(args[0])?.not_undef()?;
@ -187,7 +187,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
"sinf32" | "fabsf32" | "cosf32" | "sqrtf32" | "expf32" | "exp2f32" | "logf32" |
"log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" => {
let f = this.read_scalar(args[0])?.to_f32()?;
let f = match intrinsic_name {
let f = match intrinsic_name.get() {
"sinf32" => f.sin(),
"fabsf32" => f.abs(),
"cosf32" => f.cos(),
@ -208,7 +208,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
"sinf64" | "fabsf64" | "cosf64" | "sqrtf64" | "expf64" | "exp2f64" | "logf64" |
"log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" => {
let f = this.read_scalar(args[0])?.to_f64()?;
let f = match intrinsic_name {
let f = match intrinsic_name.get() {
"sinf64" => f.sin(),
"fabsf64" => f.abs(),
"cosf64" => f.cos(),
@ -229,7 +229,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
"fadd_fast" | "fsub_fast" | "fmul_fast" | "fdiv_fast" | "frem_fast" => {
let a = this.read_immediate(args[0])?;
let b = this.read_immediate(args[1])?;
let op = match intrinsic_name {
let op = match intrinsic_name.get() {
"fadd_fast" => mir::BinOp::Add,
"fsub_fast" => mir::BinOp::Sub,
"fmul_fast" => mir::BinOp::Mul,

View File

@ -470,11 +470,11 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
) -> EvalResult<'tcx, Cow<'tcx, Allocation<Borrow, Self::AllocExtra>>> {
let attrs = tcx.get_attrs(def_id);
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
Some(name) => name.as_str().get(),
None => tcx.item_name(def_id).as_str().get(),
Some(name) => name.as_str(),
None => tcx.item_name(def_id).as_str(),
};
let alloc = match link_name {
let alloc = match link_name.get() {
"__cxa_thread_atexit_impl" => {
// This should be all-zero, pointer-sized.
let size = tcx.data_layout.pointer_size;