summaryrefslogtreecommitdiffstats
path: root/src/cmd/compile/internal/inline/inlheur/parampropbits_string.go
blob: bf4d3ca4ad24d65c53afe54171bc5978d847b287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Code generated by "stringer -bitset -type ParamPropBits"; DO NOT EDIT.

package inlheur

import (
	"bytes"
	"strconv"
)

func _() {
	// An "invalid array index" compiler error signifies that the constant values have changed.
	// Re-run the stringer command to generate them again.
	var x [1]struct{}
	_ = x[ParamNoInfo-0]
	_ = x[ParamFeedsInterfaceMethodCall-2]
	_ = x[ParamMayFeedInterfaceMethodCall-4]
	_ = x[ParamFeedsIndirectCall-8]
	_ = x[ParamMayFeedIndirectCall-16]
	_ = x[ParamFeedsIfOrSwitch-32]
	_ = x[ParamMayFeedIfOrSwitch-64]
}

var _ParamPropBits_value = [...]uint64{
	0x0,  /* ParamNoInfo */
	0x2,  /* ParamFeedsInterfaceMethodCall */
	0x4,  /* ParamMayFeedInterfaceMethodCall */
	0x8,  /* ParamFeedsIndirectCall */
	0x10, /* ParamMayFeedIndirectCall */
	0x20, /* ParamFeedsIfOrSwitch */
	0x40, /* ParamMayFeedIfOrSwitch */
}

const _ParamPropBits_name = "ParamNoInfoParamFeedsInterfaceMethodCallParamMayFeedInterfaceMethodCallParamFeedsIndirectCallParamMayFeedIndirectCallParamFeedsIfOrSwitchParamMayFeedIfOrSwitch"

var _ParamPropBits_index = [...]uint8{0, 11, 40, 71, 93, 117, 137, 159}

func (i ParamPropBits) String() string {
	var b bytes.Buffer

	remain := uint64(i)
	seen := false

	for k, v := range _ParamPropBits_value {
		x := _ParamPropBits_name[_ParamPropBits_index[k]:_ParamPropBits_index[k+1]]
		if v == 0 {
			if i == 0 {
				b.WriteString(x)
				return b.String()
			}
			continue
		}
		if (v & remain) == v {
			remain &^= v
			x := _ParamPropBits_name[_ParamPropBits_index[k]:_ParamPropBits_index[k+1]]
			if seen {
				b.WriteString("|")
			}
			seen = true
			b.WriteString(x)
		}
	}
	if remain == 0 {
		return b.String()
	}
	return "ParamPropBits(0x" + strconv.FormatInt(int64(i), 16) + ")"
}