github.com/bir3/gocompiler@v0.9.2202/src/cmd/compile/internal/inline/inlheur/resultpropbits_string.go (about) 1 // Copyright 2023 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated by "stringer -bitset -type ResultPropBits"; DO NOT EDIT. 6 7 package inlheur 8 9 import ( 10 "bytes" 11 "strconv" 12 ) 13 14 func _() { 15 // An "invalid array index" compiler error signifies that the constant values have changed. 16 // Re-run the stringer command to generate them again. 17 var x [1]struct{} 18 _ = x[ResultNoInfo-0] 19 _ = x[ResultIsAllocatedMem-2] 20 _ = x[ResultIsConcreteTypeConvertedToInterface-4] 21 _ = x[ResultAlwaysSameConstant-8] 22 _ = x[ResultAlwaysSameFunc-16] 23 _ = x[ResultAlwaysSameInlinableFunc-32] 24 } 25 26 var _ResultPropBits_value = [...]uint64{ 27 0x0, /* ResultNoInfo */ 28 0x2, /* ResultIsAllocatedMem */ 29 0x4, /* ResultIsConcreteTypeConvertedToInterface */ 30 0x8, /* ResultAlwaysSameConstant */ 31 0x10, /* ResultAlwaysSameFunc */ 32 0x20, /* ResultAlwaysSameInlinableFunc */ 33 } 34 35 const _ResultPropBits_name = "ResultNoInfoResultIsAllocatedMemResultIsConcreteTypeConvertedToInterfaceResultAlwaysSameConstantResultAlwaysSameFuncResultAlwaysSameInlinableFunc" 36 37 var _ResultPropBits_index = [...]uint8{0, 12, 32, 72, 96, 116, 145} 38 39 func (i ResultPropBits) String() string { 40 var b bytes.Buffer 41 42 remain := uint64(i) 43 seen := false 44 45 for k, v := range _ResultPropBits_value { 46 x := _ResultPropBits_name[_ResultPropBits_index[k]:_ResultPropBits_index[k+1]] 47 if v == 0 { 48 if i == 0 { 49 b.WriteString(x) 50 return b.String() 51 } 52 continue 53 } 54 if (v & remain) == v { 55 remain &^= v 56 x := _ResultPropBits_name[_ResultPropBits_index[k]:_ResultPropBits_index[k+1]] 57 if seen { 58 b.WriteString("|") 59 } 60 seen = true 61 b.WriteString(x) 62 } 63 } 64 if remain == 0 { 65 return b.String() 66 } 67 return "ResultPropBits(0x" + strconv.FormatInt(int64(i), 16) + ")" 68 }