From 37413a2cea694f4a447f2268afc11fca1afe026a Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sun, 18 Jun 2023 19:42:20 -0400 Subject: [PATCH] Fix indent --- src/asm.rs | 69 +++++++++++++++++++++++++++--------------------------- test.sh | 3 +-- 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/asm.rs b/src/asm.rs index be7ae603ca61..4c3b7f5036cc 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -502,49 +502,48 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> { let builtin_unreachable = self.context.get_builtin_function("__builtin_unreachable"); let builtin_unreachable: RValue<'gcc> = unsafe { std::mem::transmute(builtin_unreachable) }; self.call(self.type_void(), None, None, builtin_unreachable, &[], None); - } + } - // Write results to outputs. - // - // We need to do this because: - // 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases - // (especially with current `rustc_backend_ssa` API). - // 2. Not every output operand has an `out_place`, and it's required by `add_output_operand`. - // - // Instead, we generate a temporary output variable for each output operand, and then this loop, - // generates `out_place = tmp_var;` assignments if out_place exists. - for op in &outputs { - if let Some(place) = op.out_place { - OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place); + // Write results to outputs. + // + // We need to do this because: + // 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases + // (especially with current `rustc_backend_ssa` API). + // 2. Not every output operand has an `out_place`, and it's required by `add_output_operand`. + // + // Instead, we generate a temporary output variable for each output operand, and then this loop, + // generates `out_place = tmp_var;` assignments if out_place exists. + for op in &outputs { + if let Some(place) = op.out_place { + OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place); + } } } - -} } fn estimate_template_length(template: &[InlineAsmTemplatePiece], constants_len: usize, att_dialect: bool) -> usize { -let len: usize = template.iter().map(|piece| { - match *piece { - InlineAsmTemplatePiece::String(ref string) => { - string.len() - } - InlineAsmTemplatePiece::Placeholder { .. } => { - // '%' + 1 char modifier + 1 char index - 3 + let len: usize = template.iter().map(|piece| { + match *piece { + InlineAsmTemplatePiece::String(ref string) => { + string.len() + } + InlineAsmTemplatePiece::Placeholder { .. } => { + // '%' + 1 char modifier + 1 char index + 3 + } } + }) + .sum(); + + // increase it by 5% to account for possible '%' signs that'll be duplicated + // I pulled the number out of blue, but should be fair enough + // as the upper bound + let mut res = (len as f32 * 1.05) as usize + constants_len; + + if att_dialect { + res += INTEL_SYNTAX_INS.len() + ATT_SYNTAX_INS.len(); } -}) -.sum(); - -// increase it by 5% to account for possible '%' signs that'll be duplicated -// I pulled the number out of blue, but should be fair enough -// as the upper bound -let mut res = (len as f32 * 1.05) as usize + constants_len; - -if att_dialect { - res += INTEL_SYNTAX_INS.len() + ATT_SYNTAX_INS.len(); -} -res + res } /// Converts a register class to a GCC constraint code. diff --git a/test.sh b/test.sh index d12fe718a968..592997b8ab9d 100755 --- a/test.sh +++ b/test.sh @@ -357,7 +357,6 @@ function test_rustc() { RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot" - if [ $# -eq 0 ]; then # No argument supplied to the function. Doing nothing. echo "No argument provided. Keeping all UI tests" @@ -388,7 +387,7 @@ function test_rustc() { fi echo "[TEST] rustc test suite" - COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui --rustc-args "$RUSTC_ARGS" + COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS" } function test_failing_rustc() {