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 7 pull requests #124133

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f09c19a
Introduce perma-unstable `wasm-c-abi` flag
daxpedda Feb 27, 2024
9e2c658
Remove `TargetOptions::default_adjusted_cabi`
daxpedda Dec 13, 2023
bbd359f
Add regression test for issue 120600
WaffleLapkin Apr 6, 2024
1737162
Add a test for `a == b` where `a: !, b: !`
WaffleLapkin Apr 6, 2024
62d956f
Correctly change type when adding adjustments on top of `NeverToAny`
WaffleLapkin Apr 6, 2024
19821ad
Properly handle emojis as literal prefix in macros
estebank Apr 10, 2024
86a5765
Add an opt-in to store incoming edges in `VecGraph` + some docs
WaffleLapkin Apr 15, 2024
7d2cb3d
Make `graph::DepthFirstSearch` accept `G` by value
WaffleLapkin Apr 15, 2024
fa134b5
Add `graph::depth_first_search_as_undirected`
WaffleLapkin Apr 15, 2024
cc12a1b
Fix negating `f16` and `f128` constants
beetrees Apr 18, 2024
ed8f351
Fix ICE when there is a non-Unicode entry in the incremental crate di…
beetrees Apr 18, 2024
3e63398
when suggesting RUST_BACKTRACE=1, add a special note for Miri's env v…
RalfJung Apr 18, 2024
523fe2b
Add tests for predecessor-aware `VecGraph` mode
WaffleLapkin Apr 18, 2024
44a6adc
Rollup merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiser
GuillaumeGomez Apr 18, 2024
47f839e
Rollup merge of #123571 - WaffleLapkin:properly-adjust-never, r=compi…
GuillaumeGomez Apr 18, 2024
3723208
Rollup merge of #123752 - estebank:emoji-prefix, r=wesleywiser
GuillaumeGomez Apr 18, 2024
b8101ab
Rollup merge of #123980 - WaffleLapkin:graph-average-refactor, r=wesl…
GuillaumeGomez Apr 18, 2024
54ccfc8
Rollup merge of #124110 - beetrees:neg-f16-f128, r=compiler-errors
GuillaumeGomez Apr 18, 2024
4c1604b
Rollup merge of #124112 - beetrees:incremental-os-str, r=Nadrieril
GuillaumeGomez Apr 18, 2024
f992e32
Rollup merge of #124116 - RalfJung:miri-rust-backtrace, r=Nilstrieb
GuillaumeGomez Apr 18, 2024
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
8 changes: 7 additions & 1 deletion compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use rustc_span::Span;
use rustc_target::abi::{
self, call::FnAbi, Align, HasDataLayout, Size, TargetDataLayout, WrappingRange,
};
use rustc_target::spec::{HasTargetSpec, Target};
use rustc_target::spec::{HasTargetSpec, HasWasmCAbiOpt, Target, WasmCAbi};

use crate::common::{type_is_pointer, SignType, TypeReflection};
use crate::context::CodegenCx;
Expand Down Expand Up @@ -2352,6 +2352,12 @@ impl<'tcx> HasTargetSpec for Builder<'_, '_, 'tcx> {
}
}

impl<'tcx> HasWasmCAbiOpt for Builder<'_, '_, 'tcx> {
fn wasm_c_abi_opt(&self) -> WasmCAbi {
self.cx.wasm_c_abi_opt()
}
}

pub trait ToGccComp {
fn to_gcc_comparison(&self) -> ComparisonOp;
}
Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_codegen_gcc/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_span::{source_map::respan, Span};
use rustc_target::abi::{
call::FnAbi, HasDataLayout, PointeeInfo, Size, TargetDataLayout, VariantIdx,
};
use rustc_target::spec::{HasTargetSpec, Target, TlsModel};
use rustc_target::spec::{HasTargetSpec, HasWasmCAbiOpt, Target, TlsModel, WasmCAbi};

use crate::callee::get_fn;
use crate::common::SignType;
Expand Down Expand Up @@ -557,6 +557,12 @@ impl<'gcc, 'tcx> HasTargetSpec for CodegenCx<'gcc, 'tcx> {
}
}

impl<'gcc, 'tcx> HasWasmCAbiOpt for CodegenCx<'gcc, 'tcx> {
fn wasm_c_abi_opt(&self) -> WasmCAbi {
self.tcx.sess.opts.unstable_opts.wasm_c_abi
}
}

impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
type LayoutOfResult = TyAndLayout<'tcx>;

Expand Down
22 changes: 11 additions & 11 deletions compiler/rustc_data_structures/src/graph/iterate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ pub fn reverse_post_order<G: DirectedGraph + Successors>(
}

/// A "depth-first search" iterator for a directed graph.
pub struct DepthFirstSearch<'graph, G>
pub struct DepthFirstSearch<G>
where
G: ?Sized + DirectedGraph + Successors,
G: DirectedGraph + Successors,
{
graph: &'graph G,
graph: G,
stack: Vec<G::Node>,
visited: BitSet<G::Node>,
}

impl<'graph, G> DepthFirstSearch<'graph, G>
impl<G> DepthFirstSearch<G>
where
G: ?Sized + DirectedGraph + Successors,
G: DirectedGraph + Successors,
{
pub fn new(graph: &'graph G) -> Self {
Self { graph, stack: vec![], visited: BitSet::new_empty(graph.num_nodes()) }
pub fn new(graph: G) -> Self {
Self { stack: vec![], visited: BitSet::new_empty(graph.num_nodes()), graph }
}

/// Version of `push_start_node` that is convenient for chained
Expand Down Expand Up @@ -125,9 +125,9 @@ where
}
}

impl<G> std::fmt::Debug for DepthFirstSearch<'_, G>
impl<G> std::fmt::Debug for DepthFirstSearch<G>
where
G: ?Sized + DirectedGraph + Successors,
G: DirectedGraph + Successors,
{
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut f = fmt.debug_set();
Expand All @@ -138,9 +138,9 @@ where
}
}

impl<G> Iterator for DepthFirstSearch<'_, G>
impl<G> Iterator for DepthFirstSearch<G>
where
G: ?Sized + DirectedGraph + Successors,
G: DirectedGraph + Successors,
{
type Item = G::Node;

Expand Down
30 changes: 28 additions & 2 deletions compiler/rustc_data_structures/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,35 @@ where
.is_some()
}

pub fn depth_first_search<G>(graph: &G, from: G::Node) -> iterate::DepthFirstSearch<'_, G>
pub fn depth_first_search<G>(graph: G, from: G::Node) -> iterate::DepthFirstSearch<G>
where
G: ?Sized + Successors,
G: Successors,
{
iterate::DepthFirstSearch::new(graph).with_start_node(from)
}

pub fn depth_first_search_as_undirected<G>(
graph: G,
from: G::Node,
) -> iterate::DepthFirstSearch<impl Successors<Node = G::Node>>
where
G: Successors + Predecessors,
{
struct AsUndirected<G>(G);

impl<G: DirectedGraph> DirectedGraph for AsUndirected<G> {
type Node = G::Node;

fn num_nodes(&self) -> usize {
self.0.num_nodes()
}
}

impl<G: Successors + Predecessors> Successors for AsUndirected<G> {
fn successors(&self, node: Self::Node) -> impl Iterator<Item = Self::Node> {
self.0.successors(node).chain(self.0.predecessors(node))
}
}

iterate::DepthFirstSearch::new(AsUndirected(graph)).with_start_node(from)
}
Loading
Loading