Fix indent
This commit is contained in:
parent
607cbfda14
commit
37413a2cea
69
src/asm.rs
69
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 = self.context.get_builtin_function("__builtin_unreachable");
|
||||||
let builtin_unreachable: RValue<'gcc> = unsafe { std::mem::transmute(builtin_unreachable) };
|
let builtin_unreachable: RValue<'gcc> = unsafe { std::mem::transmute(builtin_unreachable) };
|
||||||
self.call(self.type_void(), None, None, builtin_unreachable, &[], None);
|
self.call(self.type_void(), None, None, builtin_unreachable, &[], None);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write results to outputs.
|
// Write results to outputs.
|
||||||
//
|
//
|
||||||
// We need to do this because:
|
// We need to do this because:
|
||||||
// 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases
|
// 1. Turning `PlaceRef` into `RValue` is error-prone and has nasty edge cases
|
||||||
// (especially with current `rustc_backend_ssa` API).
|
// (especially with current `rustc_backend_ssa` API).
|
||||||
// 2. Not every output operand has an `out_place`, and it's required by `add_output_operand`.
|
// 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,
|
// 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.
|
// generates `out_place = tmp_var;` assignments if out_place exists.
|
||||||
for op in &outputs {
|
for op in &outputs {
|
||||||
if let Some(place) = op.out_place {
|
if let Some(place) = op.out_place {
|
||||||
OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place);
|
OperandValue::Immediate(op.tmp_var.to_rvalue()).store(self, place);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn estimate_template_length(template: &[InlineAsmTemplatePiece], constants_len: usize, att_dialect: bool) -> usize {
|
fn estimate_template_length(template: &[InlineAsmTemplatePiece], constants_len: usize, att_dialect: bool) -> usize {
|
||||||
let len: usize = template.iter().map(|piece| {
|
let len: usize = template.iter().map(|piece| {
|
||||||
match *piece {
|
match *piece {
|
||||||
InlineAsmTemplatePiece::String(ref string) => {
|
InlineAsmTemplatePiece::String(ref string) => {
|
||||||
string.len()
|
string.len()
|
||||||
}
|
}
|
||||||
InlineAsmTemplatePiece::Placeholder { .. } => {
|
InlineAsmTemplatePiece::Placeholder { .. } => {
|
||||||
// '%' + 1 char modifier + 1 char index
|
// '%' + 1 char modifier + 1 char index
|
||||||
3
|
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();
|
||||||
}
|
}
|
||||||
})
|
res
|
||||||
.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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a register class to a GCC constraint code.
|
/// Converts a register class to a GCC constraint code.
|
||||||
|
3
test.sh
3
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"
|
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
|
if [ $# -eq 0 ]; then
|
||||||
# No argument supplied to the function. Doing nothing.
|
# No argument supplied to the function. Doing nothing.
|
||||||
echo "No argument provided. Keeping all UI tests"
|
echo "No argument provided. Keeping all UI tests"
|
||||||
@ -388,7 +387,7 @@ function test_rustc() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[TEST] rustc test suite"
|
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() {
|
function test_failing_rustc() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user