Sync from rust fda509e817
This commit is contained in:
commit
8d11939589
21
src/base.rs
21
src/base.rs
@ -677,21 +677,22 @@ fn codegen_stmt<'tcx>(
|
|||||||
CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer),
|
CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer),
|
||||||
ref operand,
|
ref operand,
|
||||||
to_ty,
|
to_ty,
|
||||||
)
|
|
||||||
| Rvalue::Cast(
|
|
||||||
CastKind::PointerCoercion(PointerCoercion::MutToConstPointer),
|
|
||||||
ref operand,
|
|
||||||
to_ty,
|
|
||||||
)
|
|
||||||
| Rvalue::Cast(
|
|
||||||
CastKind::PointerCoercion(PointerCoercion::ArrayToPointer),
|
|
||||||
ref operand,
|
|
||||||
to_ty,
|
|
||||||
) => {
|
) => {
|
||||||
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
|
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
|
||||||
let operand = codegen_operand(fx, operand);
|
let operand = codegen_operand(fx, operand);
|
||||||
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
|
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
|
||||||
}
|
}
|
||||||
|
Rvalue::Cast(
|
||||||
|
CastKind::PointerCoercion(
|
||||||
|
PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer,
|
||||||
|
),
|
||||||
|
..,
|
||||||
|
) => {
|
||||||
|
bug!(
|
||||||
|
"{:?} is for borrowck, and should never appear in codegen",
|
||||||
|
to_place_and_rval.1
|
||||||
|
);
|
||||||
|
}
|
||||||
Rvalue::Cast(
|
Rvalue::Cast(
|
||||||
CastKind::IntToInt
|
CastKind::IntToInt
|
||||||
| CastKind::FloatToFloat
|
| CastKind::FloatToFloat
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
use std::sync::{Arc, Condvar, Mutex};
|
use std::sync::{Arc, Condvar, Mutex};
|
||||||
|
|
||||||
use jobserver::HelperThread;
|
use jobserver::HelperThread;
|
||||||
|
use rustc_errors::DiagCtxtHandle;
|
||||||
use rustc_session::Session;
|
use rustc_session::Session;
|
||||||
|
|
||||||
// FIXME don't panic when a worker thread panics
|
// FIXME don't panic when a worker thread panics
|
||||||
@ -46,7 +47,7 @@ pub(super) fn new(sess: &Session, pending_jobs: usize) -> Self {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn acquire(&self, dcx: &rustc_errors::DiagCtxt) -> ConcurrencyLimiterToken {
|
pub(super) fn acquire(&self, dcx: DiagCtxtHandle<'_>) -> ConcurrencyLimiterToken {
|
||||||
let mut state = self.state.lock().unwrap();
|
let mut state = self.state.lock().unwrap();
|
||||||
loop {
|
loop {
|
||||||
state.assert_invariants();
|
state.assert_invariants();
|
||||||
|
@ -276,9 +276,9 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Arc<dyn TargetIs
|
|||||||
flags_builder.set("enable_verifier", enable_verifier).unwrap();
|
flags_builder.set("enable_verifier", enable_verifier).unwrap();
|
||||||
flags_builder.set("regalloc_checker", enable_verifier).unwrap();
|
flags_builder.set("regalloc_checker", enable_verifier).unwrap();
|
||||||
|
|
||||||
let preserve_frame_pointer = sess.target.options.frame_pointer
|
let mut frame_ptr = sess.target.options.frame_pointer.clone();
|
||||||
!= rustc_target::spec::FramePointer::MayOmit
|
frame_ptr.ratchet(sess.opts.cg.force_frame_pointers);
|
||||||
|| matches!(sess.opts.cg.force_frame_pointers, Some(true));
|
let preserve_frame_pointer = frame_ptr != rustc_target::spec::FramePointer::MayOmit;
|
||||||
flags_builder
|
flags_builder
|
||||||
.set("preserve_frame_pointers", if preserve_frame_pointer { "true" } else { "false" })
|
.set("preserve_frame_pointers", if preserve_frame_pointer { "true" } else { "false" })
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user