Skip to content

Commit 37413a2

Browse files
committed
Fix indent
1 parent 607cbfd commit 37413a2

File tree

2 files changed

+34
-36
lines changed

2 files changed

+34
-36
lines changed

Diff for: src/asm.rs

+33-34
Original file line numberDiff line numberDiff line change
@@ -502,49 +502,48 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
502502
let builtin_unreachable = self.context.get_builtin_function("__builtin_unreachable");
503503
let builtin_unreachable: RValue<'gcc> = unsafe { std::mem::transmute(builtin_unreachable) };
504504
self.call(self.type_void(), None, None, builtin_unreachable, &[], None);
505-
}
505+
}
506506

507-
// Write results to outputs.
508-
//
509-
// We need to do this because:
510-
// 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases
511-
// (especially with current `rustc_backend_ssa` API).
512-
// 2. Not every output operand has an `out_place`, and it's required by `add_output_operand`.
513-
//
514-
// Instead, we generate a temporary output variable for each output operand, and then this loop,
515-
// generates `out_place = tmp_var;` assignments if out_place exists.
516-
for op in &outputs {
517-
if let Some(place) = op.out_place {
518-
OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place);
507+
// Write results to outputs.
508+
//
509+
// We need to do this because:
510+
// 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases
511+
// (especially with current `rustc_backend_ssa` API).
512+
// 2. Not every output operand has an `out_place`, and it's required by `add_output_operand`.
513+
//
514+
// Instead, we generate a temporary output variable for each output operand, and then this loop,
515+
// generates `out_place = tmp_var;` assignments if out_place exists.
516+
for op in &outputs {
517+
if let Some(place) = op.out_place {
518+
OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place);
519+
}
519520
}
520521
}
521-
522-
}
523522
}
524523

525524
fn estimate_template_length(template: &[InlineAsmTemplatePiece], constants_len: usize, att_dialect: bool) -> usize {
526-
let len: usize = template.iter().map(|piece| {
527-
match *piece {
528-
InlineAsmTemplatePiece::String(ref string) => {
529-
string.len()
530-
}
531-
InlineAsmTemplatePiece::Placeholder { .. } => {
532-
// '%' + 1 char modifier + 1 char index
533-
3
525+
let len: usize = template.iter().map(|piece| {
526+
match *piece {
527+
InlineAsmTemplatePiece::String(ref string) => {
528+
string.len()
529+
}
530+
InlineAsmTemplatePiece::Placeholder { .. } => {
531+
// '%' + 1 char modifier + 1 char index
532+
3
533+
}
534534
}
535-
}
536-
})
537-
.sum();
535+
})
536+
.sum();
538537

539-
// increase it by 5% to account for possible '%' signs that'll be duplicated
540-
// I pulled the number out of blue, but should be fair enough
541-
// as the upper bound
542-
let mut res = (len as f32 * 1.05) as usize + constants_len;
538+
// increase it by 5% to account for possible '%' signs that'll be duplicated
539+
// I pulled the number out of blue, but should be fair enough
540+
// as the upper bound
541+
let mut res = (len as f32 * 1.05) as usize + constants_len;
543542

544-
if att_dialect {
545-
res += INTEL_SYNTAX_INS.len() + ATT_SYNTAX_INS.len();
546-
}
547-
res
543+
if att_dialect {
544+
res += INTEL_SYNTAX_INS.len() + ATT_SYNTAX_INS.len();
545+
}
546+
res
548547
}
549548

550549
/// Converts a register class to a GCC constraint code.

Diff for: test.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ function test_rustc() {
357357

358358
RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot"
359359

360-
361360
if [ $# -eq 0 ]; then
362361
# No argument supplied to the function. Doing nothing.
363362
echo "No argument provided. Keeping all UI tests"
@@ -388,7 +387,7 @@ function test_rustc() {
388387
fi
389388

390389
echo "[TEST] rustc test suite"
391-
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui --rustc-args "$RUSTC_ARGS"
390+
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS"
392391
}
393392

394393
function test_failing_rustc() {

0 commit comments

Comments
 (0)