github.com/llir/llvm@v0.3.6/asm/enum/returnattr_string2enum.go (about)

     1  // Code generated by "string2enum -linecomment -type ReturnAttr ../../ir/enum"; DO NOT EDIT.
     2  
     3  package enum
     4  
     5  import (
     6  	"fmt"
     7  
     8  	"github.com/llir/llvm/ir/enum"
     9  )
    10  
    11  func _() {
    12  	// An "invalid array index" compiler error signifies that the constant values have changed.
    13  	// Re-run the string2enum command to generate them again.
    14  	var x [1]struct{}
    15  	_ = x[enum.ReturnAttrInReg-0]
    16  	_ = x[enum.ReturnAttrNoAlias-1]
    17  	_ = x[enum.ReturnAttrNonNull-2]
    18  	_ = x[enum.ReturnAttrNoUndef-3]
    19  	_ = x[enum.ReturnAttrSignExt-4]
    20  	_ = x[enum.ReturnAttrZeroExt-5]
    21  }
    22  
    23  const _ReturnAttr_name = "inregnoaliasnonnullnoundefsignextzeroext"
    24  
    25  var _ReturnAttr_index = [...]uint8{0, 5, 12, 19, 26, 33, 40}
    26  
    27  // ReturnAttrFromString returns the ReturnAttr enum corresponding to s.
    28  func ReturnAttrFromString(s string) enum.ReturnAttr {
    29  	if len(s) == 0 {
    30  		return 0
    31  	}
    32  	for i := range _ReturnAttr_index[:len(_ReturnAttr_index)-1] {
    33  		if s == _ReturnAttr_name[_ReturnAttr_index[i]:_ReturnAttr_index[i+1]] {
    34  			return enum.ReturnAttr(i)
    35  		}
    36  	}
    37  	panic(fmt.Errorf("unable to locate ReturnAttr enum corresponding to %q", s))
    38  }
    39  
    40  func _(s string) {
    41  	// Check for duplicate string values in type "ReturnAttr".
    42  	switch s {
    43  	// 0
    44  	case "inreg":
    45  	// 1
    46  	case "noalias":
    47  	// 2
    48  	case "nonnull":
    49  	// 3
    50  	case "noundef":
    51  	// 4
    52  	case "signext":
    53  	// 5
    54  	case "zeroext":
    55  	}
    56  }