Skip to content

Commit b4ad63c

Browse files
authored
Merge pull request rust-lang#122 from bjorn3/rustup
Rustup to rustc 1.60.0-nightly (a00e130 2022-01-29)
2 parents 72d89b0 + 477d102 commit b4ad63c

File tree

8 files changed

+27
-39
lines changed

8 files changed

+27
-39
lines changed

config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
3838
fi
3939
fi
4040

41-
export RUSTFLAGS="$linker -Cpanic=abort -Zsymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
41+
export RUSTFLAGS="$linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
4242

4343
# FIXME(antoyo): remove once the atomic shim is gone
4444
if [[ `uname` == 'Darwin' ]]; then

patches/0022-core-Disable-not-compiling-tests.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ index 0000000..46fd999
2222
+[package]
2323
+name = "core"
2424
+version = "0.0.0"
25-
+edition = "2018"
25+
+edition = "2021"
2626
+
2727
+[lib]
2828
+name = "coretests"

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2021-12-30"
2+
channel = "nightly-2022-01-30"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/asm.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ use rustc_codegen_ssa::mir::operand::OperandValue;
44
use rustc_codegen_ssa::mir::place::PlaceRef;
55
use rustc_codegen_ssa::traits::{AsmBuilderMethods, AsmMethods, BaseTypeMethods, BuilderMethods, GlobalAsmOperandRef, InlineAsmOperandRef};
66

7-
use rustc_hir::LlvmInlineAsmInner;
87
use rustc_middle::{bug, ty::Instance};
9-
use rustc_span::{Span, Symbol};
8+
use rustc_span::Span;
109
use rustc_target::asm::*;
1110

1211
use std::borrow::Cow;
@@ -106,17 +105,6 @@ enum ConstraintOrRegister {
106105

107106

108107
impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
109-
fn codegen_llvm_inline_asm(&mut self, _ia: &LlvmInlineAsmInner, _outputs: Vec<PlaceRef<'tcx, RValue<'gcc>>>, _inputs: Vec<RValue<'gcc>>, span: Span) -> bool {
110-
self.sess().struct_span_err(span, "GCC backend does not support `llvm_asm!`")
111-
.help("consider using the `asm!` macro instead")
112-
.emit();
113-
114-
// We return `true` even if we've failed to generate the asm
115-
// because we want to suppress the "malformed inline assembly" error
116-
// generated by the frontend.
117-
true
118-
}
119-
120108
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span], _instance: Instance<'_>, _dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>) {
121109
if options.contains(InlineAsmOptions::MAY_UNWIND) {
122110
self.sess()
@@ -184,7 +172,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
184172
let is_target_supported = reg.reg_class().supported_types(asm_arch).iter()
185173
.any(|&(_, feature)| {
186174
if let Some(feature) = feature {
187-
self.tcx.sess.target_features.contains(&Symbol::intern(feature))
175+
self.tcx.sess.target_features.contains(&feature)
188176
} else {
189177
true // Register class is unconditionally supported
190178
}
@@ -572,6 +560,7 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
572560
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => unimplemented!(),
573561
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => unimplemented!(),
574562
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => unimplemented!(),
563+
InlineAsmRegClass::Msp430(_) => unimplemented!(),
575564
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg16) => unimplemented!(),
576565
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg32) => unimplemented!(),
577566
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg64) => unimplemented!(),
@@ -634,6 +623,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
634623
InlineAsmRegClass::Hexagon(HexagonInlineAsmRegClass::reg) => cx.type_i32(),
635624
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(),
636625
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => cx.type_f32(),
626+
InlineAsmRegClass::Msp430(_) => unimplemented!(),
637627
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg16) => cx.type_i16(),
638628
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg32) => cx.type_i32(),
639629
InlineAsmRegClass::Nvptx(NvptxInlineAsmRegClass::reg64) => cx.type_i64(),
@@ -741,6 +731,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option
741731
InlineAsmRegClass::Bpf(_) => unimplemented!(),
742732
InlineAsmRegClass::Hexagon(_) => unimplemented!(),
743733
InlineAsmRegClass::Mips(_) => unimplemented!(),
734+
InlineAsmRegClass::Msp430(_) => unimplemented!(),
744735
InlineAsmRegClass::Nvptx(_) => unimplemented!(),
745736
InlineAsmRegClass::PowerPC(_) => unimplemented!(),
746737
InlineAsmRegClass::RiscV(RiscVInlineAsmRegClass::reg)

src/builder.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,11 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11101110
aggregate_value
11111111
}
11121112

1113-
fn landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>, _num_clauses: usize) -> RValue<'gcc> {
1113+
fn set_personality_fn(&mut self, _personality: RValue<'gcc>) {
1114+
// TODO(antoyo)
1115+
}
1116+
1117+
fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>) -> RValue<'gcc> {
11141118
let field1 = self.context.new_field(None, self.u8_type, "landing_pad_field_1");
11151119
let field2 = self.context.new_field(None, self.i32_type, "landing_pad_field_1");
11161120
let struct_type = self.context.new_struct_type(None, "landing_pad", &[field1, field2]);
@@ -1121,38 +1125,31 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11211125
// rustc_codegen_ssa now calls the unwinding builder methods even on panic=abort.
11221126
}
11231127

1124-
fn set_cleanup(&mut self, _landing_pad: RValue<'gcc>) {
1125-
// TODO(antoyo)
1126-
}
1127-
1128-
fn resume(&mut self, _exn: RValue<'gcc>) -> RValue<'gcc> {
1128+
fn resume(&mut self, _exn: RValue<'gcc>) {
11291129
unimplemented!();
11301130
}
11311131

11321132
fn cleanup_pad(&mut self, _parent: Option<RValue<'gcc>>, _args: &[RValue<'gcc>]) -> Funclet {
11331133
unimplemented!();
11341134
}
11351135

1136-
fn cleanup_ret(&mut self, _funclet: &Funclet, _unwind: Option<Block<'gcc>>) -> RValue<'gcc> {
1136+
fn cleanup_ret(&mut self, _funclet: &Funclet, _unwind: Option<Block<'gcc>>) {
11371137
unimplemented!();
11381138
}
11391139

11401140
fn catch_pad(&mut self, _parent: RValue<'gcc>, _args: &[RValue<'gcc>]) -> Funclet {
11411141
unimplemented!();
11421142
}
11431143

1144-
fn catch_switch(&mut self, _parent: Option<RValue<'gcc>>, _unwind: Option<Block<'gcc>>, _num_handlers: usize) -> RValue<'gcc> {
1144+
fn catch_switch(
1145+
&mut self,
1146+
_parent: Option<RValue<'gcc>>,
1147+
_unwind: Option<Block<'gcc>>,
1148+
_handlers: &[Block<'gcc>],
1149+
) -> RValue<'gcc> {
11451150
unimplemented!();
11461151
}
11471152

1148-
fn add_handler(&mut self, _catch_switch: RValue<'gcc>, _handler: Block<'gcc>) {
1149-
unimplemented!();
1150-
}
1151-
1152-
fn set_personality_fn(&mut self, _personality: RValue<'gcc>) {
1153-
// TODO(antoyo)
1154-
}
1155-
11561153
// Atomic Operations
11571154
fn atomic_cmpxchg(&mut self, dst: RValue<'gcc>, cmp: RValue<'gcc>, src: RValue<'gcc>, order: AtomicOrdering, failure_order: AtomicOrdering, weak: bool) -> RValue<'gcc> {
11581155
let expected = self.current_func().new_local(None, cmp.get_type(), "expected");
@@ -1257,8 +1254,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
12571254
self.cx
12581255
}
12591256

1260-
fn do_not_inline(&mut self, _llret: RValue<'gcc>) {
1261-
unimplemented!();
1257+
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: RValue<'gcc>) {
1258+
// TODO
12621259
}
12631260

12641261
fn set_span(&mut self, _span: Span) {}

src/type_.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
121121
if self.is_int_type_or_bool(typ) {
122122
TypeKind::Integer
123123
}
124-
else if typ == self.float_type {
124+
else if typ.is_compatible_with(self.float_type) {
125125
TypeKind::Float
126126
}
127-
else if typ == self.double_type {
127+
else if typ.is_compatible_with(self.double_type) {
128128
TypeKind::Double
129129
}
130130
else if typ.dyncast_vector().is_some() {

src/type_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLa
5757
(layout.ty.kind(), &layout.variants)
5858
{
5959
if def.is_enum() && !def.variants.is_empty() {
60-
write!(&mut name, "::{}", def.variants[index].ident).unwrap();
60+
write!(&mut name, "::{}", def.variants[index].name).unwrap();
6161
}
6262
}
6363
if let (&ty::Generator(_, _, _), &Variants::Single { index }) =

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ EOF
195195
git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
196196
rm src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs || true # TODO(antoyo): Enable back this test if I ever implement the llvm_asm! macro.
197197

198-
RUSTC_ARGS="-Zpanic-abort-tests -Zsymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot -Cpanic=abort"
198+
RUSTC_ARGS="-Zpanic-abort-tests -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot -Cpanic=abort"
199199

200200
echo "[TEST] rustc test suite"
201201
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args "$RUSTC_ARGS"

0 commit comments

Comments
 (0)