github.com/go-asm/go@v1.21.1-0.20240213172139-40c5ead50c48/cmd/compile/inline/inlheur/scoreadjusttyp_string.go (about) 1 // Code generated by "stringer -bitset -type scoreAdjustTyp"; DO NOT EDIT. 2 3 package inlheur 4 5 import ( 6 "bytes" 7 "strconv" 8 ) 9 10 func _() { 11 // An "invalid array index" compiler error signifies that the constant values have changed. 12 // Re-run the stringer command to generate them again. 13 var x [1]struct{} 14 _ = x[panicPathAdj-1] 15 _ = x[initFuncAdj-2] 16 _ = x[inLoopAdj-4] 17 _ = x[passConstToIfAdj-8] 18 _ = x[passConstToNestedIfAdj-16] 19 _ = x[passConcreteToItfCallAdj-32] 20 _ = x[passConcreteToNestedItfCallAdj-64] 21 _ = x[passFuncToIndCallAdj-128] 22 _ = x[passFuncToNestedIndCallAdj-256] 23 _ = x[passInlinableFuncToIndCallAdj-512] 24 _ = x[passInlinableFuncToNestedIndCallAdj-1024] 25 _ = x[returnFeedsConstToIfAdj-2048] 26 _ = x[returnFeedsFuncToIndCallAdj-4096] 27 _ = x[returnFeedsInlinableFuncToIndCallAdj-8192] 28 _ = x[returnFeedsConcreteToInterfaceCallAdj-16384] 29 } 30 31 var _scoreAdjustTyp_value = [...]uint64{ 32 0x1, /* panicPathAdj */ 33 0x2, /* initFuncAdj */ 34 0x4, /* inLoopAdj */ 35 0x8, /* passConstToIfAdj */ 36 0x10, /* passConstToNestedIfAdj */ 37 0x20, /* passConcreteToItfCallAdj */ 38 0x40, /* passConcreteToNestedItfCallAdj */ 39 0x80, /* passFuncToIndCallAdj */ 40 0x100, /* passFuncToNestedIndCallAdj */ 41 0x200, /* passInlinableFuncToIndCallAdj */ 42 0x400, /* passInlinableFuncToNestedIndCallAdj */ 43 0x800, /* returnFeedsConstToIfAdj */ 44 0x1000, /* returnFeedsFuncToIndCallAdj */ 45 0x2000, /* returnFeedsInlinableFuncToIndCallAdj */ 46 0x4000, /* returnFeedsConcreteToInterfaceCallAdj */ 47 } 48 49 const _scoreAdjustTyp_name = "panicPathAdjinitFuncAdjinLoopAdjpassConstToIfAdjpassConstToNestedIfAdjpassConcreteToItfCallAdjpassConcreteToNestedItfCallAdjpassFuncToIndCallAdjpassFuncToNestedIndCallAdjpassInlinableFuncToIndCallAdjpassInlinableFuncToNestedIndCallAdjreturnFeedsConstToIfAdjreturnFeedsFuncToIndCallAdjreturnFeedsInlinableFuncToIndCallAdjreturnFeedsConcreteToInterfaceCallAdj" 50 51 var _scoreAdjustTyp_index = [...]uint16{0, 12, 23, 32, 48, 70, 94, 124, 144, 170, 199, 234, 257, 284, 320, 357} 52 53 func (i scoreAdjustTyp) String() string { 54 var b bytes.Buffer 55 56 remain := uint64(i) 57 seen := false 58 59 for k, v := range _scoreAdjustTyp_value { 60 x := _scoreAdjustTyp_name[_scoreAdjustTyp_index[k]:_scoreAdjustTyp_index[k+1]] 61 if v == 0 { 62 if i == 0 { 63 b.WriteString(x) 64 return b.String() 65 } 66 continue 67 } 68 if (v & remain) == v { 69 remain &^= v 70 x := _scoreAdjustTyp_name[_scoreAdjustTyp_index[k]:_scoreAdjustTyp_index[k+1]] 71 if seen { 72 b.WriteString("|") 73 } 74 seen = true 75 b.WriteString(x) 76 } 77 } 78 if remain == 0 { 79 return b.String() 80 } 81 return "scoreAdjustTyp(0x" + strconv.FormatInt(int64(i), 16) + ")" 82 }