github.com/llir/llvm@v0.3.6/ir/enum/atomicordering_string.go (about)

     1  // Code generated by "stringer -linecomment -type AtomicOrdering"; DO NOT EDIT.
     2  
     3  package enum
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[AtomicOrderingNone-0]
    12  	_ = x[AtomicOrderingUnordered-1]
    13  	_ = x[AtomicOrderingMonotonic-2]
    14  	_ = x[AtomicOrderingAcquire-4]
    15  	_ = x[AtomicOrderingRelease-5]
    16  	_ = x[AtomicOrderingAcquireRelease-6]
    17  	_ = x[AtomicOrderingSequentiallyConsistent-7]
    18  }
    19  
    20  const (
    21  	_AtomicOrdering_name_0 = "noneunorderedmonotonic"
    22  	_AtomicOrdering_name_1 = "acquirereleaseacq_relseq_cst"
    23  )
    24  
    25  var (
    26  	_AtomicOrdering_index_0 = [...]uint8{0, 4, 13, 22}
    27  	_AtomicOrdering_index_1 = [...]uint8{0, 7, 14, 21, 28}
    28  )
    29  
    30  func (i AtomicOrdering) String() string {
    31  	switch {
    32  	case i <= 2:
    33  		return _AtomicOrdering_name_0[_AtomicOrdering_index_0[i]:_AtomicOrdering_index_0[i+1]]
    34  	case 4 <= i && i <= 7:
    35  		i -= 4
    36  		return _AtomicOrdering_name_1[_AtomicOrdering_index_1[i]:_AtomicOrdering_index_1[i+1]]
    37  	default:
    38  		return "AtomicOrdering(" + strconv.FormatInt(int64(i), 10) + ")"
    39  	}
    40  }