Skip to content

Commit 0e50c9e

Browse files
committed
Update example output in pretty_clif.rs
1 parent b6cf0a6 commit 0e50c9e

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

src/pretty_clif.rs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,51 @@
77
//! test compile
88
//! target x86_64
99
//!
10-
//! function u0:0(i64, i64, i64) system_v {
11-
//! ; symbol _ZN119_$LT$example..IsNotEmpty$u20$as$u20$mini_core..FnOnce$LT$$LP$$RF$$u27$a$u20$$RF$$u27$b$u20$$u5b$u16$u5d$$C$$RP$$GT$$GT$9call_once17he85059d5e6a760a0E
12-
//! ; instance Instance { def: Item(DefId(0/0:29 ~ example[8787]::{{impl}}[0]::call_once[0])), substs: [ReErased, ReErased] }
13-
//! ; sig ([IsNotEmpty, (&&[u16],)]; c_variadic: false)->(u8, u8)
10+
//! function u0:22(i64) -> i8, i8 system_v {
11+
//! ; symbol _ZN97_$LT$example..IsNotEmpty$u20$as$u20$mini_core..FnOnce$LT$$LP$$RF$$RF$$u5b$u16$u5d$$C$$RP$$GT$$GT$9call_once17hd517c453d67c0915E
12+
//! ; instance Instance { def: Item(WithOptConstParam { did: DefId(0:42 ~ example[4e51]::{impl#0}::call_once), const_param_did: None }), substs: [ReErased, ReErased] }
13+
//! ; abi FnAbi { args: [ArgAbi { layout: TyAndLayout { ty: IsNotEmpty, layout: Layout { size: Size(0 bytes), align: AbiAndPrefAlign { abi: Align(1 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [], memory_index: [] }, largest_niche: None, variants: Single { index: 0 } } }, mode: Ignore }, ArgAbi { layout: TyAndLayout { ty: &&[u16], layout: Layout { size: Size(8 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Scalar(Initialized { value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), fields: Primitive, largest_niche: Some(Niche { offset: Size(0 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } } }, mode: Direct(ArgAttributes { regular: NonNull | NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: Some(Align(8 bytes)) }) }], ret: ArgAbi { layout: TyAndLayout { ty: (u8, u8), layout: Layout { size: Size(2 bytes), align: AbiAndPrefAlign { abi: Align(1 bytes), pref: Align(8 bytes) }, abi: ScalarPair(Initialized { value: Int(I8, false), valid_range: 0..=255 }, Initialized { value: Int(I8, false), valid_range: 0..=255 }), fields: Arbitrary { offsets: [Size(0 bytes), Size(1 bytes)], memory_index: [0, 1] }, largest_niche: None, variants: Single { index: 0 } } }, mode: Pair(ArgAttributes { regular: NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: None }, ArgAttributes { regular: NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: None }) }, c_variadic: false, fixed_count: 1, conv: Rust, can_unwind: false }
1414
//!
15-
//! ; ssa {_2: NOT_SSA, _4: NOT_SSA, _0: NOT_SSA, _3: (empty), _1: NOT_SSA}
16-
//! ; msg loc.idx param pass mode ssa flags ty
17-
//! ; ret _0 = v0 ByRef NOT_SSA (u8, u8)
18-
//! ; arg _1 = v1 ByRef NOT_SSA IsNotEmpty
19-
//! ; arg _2.0 = v2 ByVal(types::I64) NOT_SSA &&[u16]
15+
//! ; kind loc.idx param pass mode ty
16+
//! ; ssa _0 (u8, u8) 2b 1, 8 var=(0, 1)
17+
//! ; ret _0 - Pair(ArgAttributes { regular: NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: None }, ArgAttributes { regular: NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: None }) (u8, u8)
18+
//! ; arg _1 - Ignore IsNotEmpty
19+
//! ; arg _2.0 = v0 Direct(ArgAttributes { regular: NonNull | NoUndef, arg_ext: None, pointee_size: Size(0 bytes), pointee_align: Some(Align(8 bytes)) }) &&[u16]
2020
//!
21-
//! ss0 = explicit_slot 0 ; _1: IsNotEmpty size=0 align=1,8
22-
//! ss1 = explicit_slot 8 ; _2: (&&[u16],) size=8 align=8,8
23-
//! ss2 = explicit_slot 8 ; _4: (&&[u16],) size=8 align=8,8
24-
//! sig0 = (i64, i64, i64) system_v
25-
//! sig1 = (i64, i64, i64) system_v
26-
//! fn0 = colocated u0:6 sig1 ; Instance { def: Item(DefId(0/0:31 ~ example[8787]::{{impl}}[1]::call_mut[0])), substs: [ReErased, ReErased] }
21+
//! ; kind local ty size align (abi,pref)
22+
//! ; zst _1 IsNotEmpty 0b 1, 8 align=8,offset=
23+
//! ; stack _2 (&&[u16],) 8b 8, 8 storage=ss0
24+
//! ; ssa _3 &mut IsNotEmpty 8b 8, 8 var=2
2725
//!
28-
//! block0(v0: i64, v1: i64, v2: i64):
29-
//! v3 = stack_addr.i64 ss0
30-
//! v4 = stack_addr.i64 ss1
31-
//! store v2, v4
32-
//! v5 = stack_addr.i64 ss2
26+
//! ss0 = explicit_slot 16
27+
//! sig0 = (i64, i64) -> i8, i8 system_v
28+
//! fn0 = colocated u0:23 sig0 ; Instance { def: Item(WithOptConstParam { did: DefId(0:46 ~ example[4e51]::{impl#1}::call_mut), const_param_did: None }), substs: [ReErased, ReErased] }
29+
//!
30+
//! block0(v0: i64):
31+
//! nop
32+
//! ; write_cvalue: Addr(Pointer { base: Stack(ss0), offset: Offset32(0) }, None): &&[u16] <- ByVal(v0): &&[u16]
33+
//! stack_store v0, ss0
3334
//! jump block1
3435
//!
3536
//! block1:
3637
//! nop
3738
//! ; _3 = &mut _1
38-
//! ; _4 = _2
39-
//! v6 = load.i64 v4
40-
//! store v6, v5
39+
//! v1 = iconst.i64 8
40+
//! ; write_cvalue: Var(_3, var2): &mut IsNotEmpty <- ByVal(v1): &mut IsNotEmpty
4141
//! ;
42-
//! ; _0 = const mini_core::FnMut::call_mut(move _3, move _4)
43-
//! v7 = load.i64 v5
44-
//! call fn0(v0, v3, v7)
42+
//! ; _0 = <IsNotEmpty as mini_core::FnMut<(&&[u16],)>>::call_mut(move _3, _2)
43+
//! v2 = stack_load.i64 ss0
44+
//! v3, v4 = call fn0(v1, v2) ; v1 = 8
45+
//! v5 -> v3
46+
//! v6 -> v4
47+
//! ; write_cvalue: VarPair(_0, var0, var1): (u8, u8) <- ByValPair(v3, v4): (u8, u8)
4548
//! jump block2
4649
//!
4750
//! block2:
4851
//! nop
4952
//! ;
5053
//! ; return
51-
//! return
54+
//! return v5, v6
5255
//! }
5356
//! ```
5457

0 commit comments

Comments
 (0)