@@ -502,49 +502,48 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
502
502
let builtin_unreachable = self . context . get_builtin_function ( "__builtin_unreachable" ) ;
503
503
let builtin_unreachable: RValue < ' gcc > = unsafe { std:: mem:: transmute ( builtin_unreachable) } ;
504
504
self . call ( self . type_void ( ) , None , None , builtin_unreachable, & [ ] , None ) ;
505
- }
505
+ }
506
506
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
+ }
519
520
}
520
521
}
521
-
522
- }
523
522
}
524
523
525
524
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
+ }
534
534
}
535
- }
536
- } )
537
- . sum ( ) ;
535
+ } )
536
+ . sum ( ) ;
538
537
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;
543
542
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
548
547
}
549
548
550
549
/// Converts a register class to a GCC constraint code.
0 commit comments