Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #90963

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
07f54d9
Use "rustc" for testing Command args
ChrisDenton Aug 13, 2021
d9a1f9a
Windows: Resolve Command program without using the current directory
ChrisDenton Oct 30, 2021
958de5a
warn on must_use use on async fn's
guswynn Oct 6, 2021
8d4fbc9
Add `#[inline]`s to `SortedIndexMultiMap`
JohnTitor Nov 10, 2021
c15b55a
Add Vec::retain_mut
GuillaumeGomez Nov 10, 2021
24acf86
Fix span for non-satisfied trivial trait bounds
Noratrieb Nov 13, 2021
50ec47a
Remove workaround for the forward progress handling in LLVM
andjo403 Nov 14, 2021
d64aea6
Fix `non-constant value` ICE (#90878)
Noratrieb Nov 15, 2021
77b0613
Alphabetize language features
jhpratt Nov 16, 2021
2a82d1c
Suggest where feature should be placed
jhpratt Nov 16, 2021
de05d3e
Print full char literal on error if any are non-printing
5225225 Nov 13, 2021
52199c9
Suggest removing the non-printing characters
5225225 Nov 13, 2021
17b5e2d
Remove debug output from test stderr
5225225 Nov 13, 2021
09e59c2
Inline printable function
5225225 Nov 13, 2021
eee29b0
Increase tidy limit for parser by 1
5225225 Nov 16, 2021
4c32ab8
update miri
RalfJung Nov 16, 2021
83ce771
Update compiler/rustc_passes/src/check_attr.rs
wesleywiser Nov 16, 2021
15c6508
Rollup merge of #87704 - ChrisDenton:win-resolve-exe, r=yaahc
matthiaskrgr Nov 16, 2021
843035d
Rollup merge of #89610 - guswynn:must_use_future, r=wesleywiser
matthiaskrgr Nov 16, 2021
9200527
Rollup merge of #90772 - GuillaumeGomez:vec-retain-mut, r=joshtriplett
matthiaskrgr Nov 16, 2021
d94dc8d
Rollup merge of #90787 - JohnTitor:inline-sorted-index-map, r=oli-obk
matthiaskrgr Nov 16, 2021
1ed1843
Rollup merge of #90861 - 5225225:nonprinting-char, r=davidtwco
matthiaskrgr Nov 16, 2021
823b756
Rollup merge of #90884 - Nilstrieb:fix-span-trivial-trait-bound, r=es…
matthiaskrgr Nov 16, 2021
2b75b61
Rollup merge of #90900 - andjo403:removeLlvm12Check, r=nikic
matthiaskrgr Nov 16, 2021
614c2ba
Rollup merge of #90930 - Nilstrieb:fix-non-const-value-ice, r=estebank
matthiaskrgr Nov 16, 2021
0307b40
Rollup merge of #90935 - jhpratt:alphabetize-features, r=joshtriplett
matthiaskrgr Nov 16, 2021
1815a17
Rollup merge of #90949 - RalfJung:miri, r=RalfJung
matthiaskrgr Nov 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
extended_asm.add_input_operand(None, "r", result.llval);
extended_asm.add_clobber("memory");
extended_asm.set_volatile_flag(true);

// We have copied the value to `result` already.
return;
}
Expand Down Expand Up @@ -363,10 +363,6 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
cond
}

fn sideeffect(&mut self) {
// TODO(antoyo)
}

fn type_test(&mut self, _pointer: Self::Value, _typeid: Self::Value) -> Self::Value {
// Unsupported.
self.context.new_rvalue_from_int(self.int_type, 0)
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ impl CodegenCx<'b, 'tcx> {
ifn!("llvm.trap", fn() -> void);
ifn!("llvm.debugtrap", fn() -> void);
ifn!("llvm.frameaddress", fn(t_i32) -> i8p);
ifn!("llvm.sideeffect", fn() -> void);

ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
Expand Down
9 changes: 0 additions & 9 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,6 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
self.call_intrinsic("llvm.expect.i1", &[cond, self.const_bool(expected)])
}

fn sideeffect(&mut self) {
// This kind of check would make a ton of sense in the caller, but currently the only
// caller of this function is in `rustc_codegen_ssa`, which is agnostic to whether LLVM
// codegen backend being used, and so is unable to check the LLVM version.
if unsafe { llvm::LLVMRustVersionMajor() } < 12 {
self.call_intrinsic("llvm.sideeffect", &[]);
}
}

fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value {
// Test the called operand using llvm.type.test intrinsic. The LowerTypeTests link-time
// optimization pass replaces calls to this intrinsic with code to test type membership.
Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,17 +980,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}

mir::TerminatorKind::Goto { target } => {
if bb == target {
// This is an unconditional branch back to this same basic block. That means we
// have something like a `loop {}` statement. LLVM versions before 12.0
// miscompile this because they assume forward progress. For older versions
// try to handle just this specific case which comes up commonly in practice
// (e.g., in embedded code).
//
// NB: the `sideeffect` currently checks for the LLVM version used internally.
bx.sideeffect();
}

helper.funclet_br(self, &mut bx, target);
}

Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_ssa/src/traits/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
fn abort(&mut self);
fn assume(&mut self, val: Self::Value);
fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
/// Emits a forced side effect.
///
/// Currently has any effect only when LLVM versions prior to 12.0 are used as the backend.
fn sideeffect(&mut self);
/// Trait method used to test whether a given pointer is associated with a type identifier.
fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value;
/// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_data_structures/src/sorted_map/index_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,47 @@ pub struct SortedIndexMultiMap<I: Idx, K, V> {
}

impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
#[inline]
pub fn new() -> Self {
SortedIndexMultiMap { items: IndexVec::new(), idx_sorted_by_item_key: Vec::new() }
}

#[inline]
pub fn len(&self) -> usize {
self.items.len()
}

#[inline]
pub fn is_empty(&self) -> bool {
self.items.is_empty()
}

/// Returns an iterator over the items in the map in insertion order.
#[inline]
pub fn into_iter(self) -> impl DoubleEndedIterator<Item = (K, V)> {
self.items.into_iter()
}

/// Returns an iterator over the items in the map in insertion order along with their indices.
#[inline]
pub fn into_iter_enumerated(self) -> impl DoubleEndedIterator<Item = (I, (K, V))> {
self.items.into_iter_enumerated()
}

/// Returns an iterator over the items in the map in insertion order.
#[inline]
pub fn iter(&self) -> impl '_ + DoubleEndedIterator<Item = (&K, &V)> {
self.items.iter().map(|(ref k, ref v)| (k, v))
}

/// Returns an iterator over the items in the map in insertion order along with their indices.
#[inline]
pub fn iter_enumerated(&self) -> impl '_ + DoubleEndedIterator<Item = (I, (&K, &V))> {
self.items.iter_enumerated().map(|(i, (ref k, ref v))| (i, (k, v)))
}

/// Returns the item in the map with the given index.
#[inline]
pub fn get(&self, idx: I) -> Option<&(K, V)> {
self.items.get(idx)
}
Expand All @@ -75,6 +83,7 @@ impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
///
/// If there are multiple items that are equivalent to `key`, they will be yielded in
/// insertion order.
#[inline]
pub fn get_by_key(&'a self, key: K) -> impl 'a + Iterator<Item = &'a V> {
self.get_by_key_enumerated(key).map(|(_, v)| v)
}
Expand All @@ -84,6 +93,7 @@ impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
///
/// If there are multiple items that are equivalent to `key`, they will be yielded in
/// insertion order.
#[inline]
pub fn get_by_key_enumerated(&'a self, key: K) -> impl '_ + Iterator<Item = (I, &V)> {
let lower_bound = self.idx_sorted_by_item_key.partition_point(|&i| self.items[i].0 < key);
self.idx_sorted_by_item_key[lower_bound..].iter().map_while(move |&i| {
Expand Down
Loading