Source file src/cmd/compile/internal/inline/inlheur/scoreadjusttyp_string.go

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

View as plain text