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

     1  // Code generated by "string2enum -linecomment -type ParamAttr ../../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.ParamAttrImmArg-0]
    16  	_ = x[enum.ParamAttrInReg-1]
    17  	_ = x[enum.ParamAttrNest-2]
    18  	_ = x[enum.ParamAttrNoAlias-3]
    19  	_ = x[enum.ParamAttrNoCapture-4]
    20  	_ = x[enum.ParamAttrNoFree-5]
    21  	_ = x[enum.ParamAttrNonNull-6]
    22  	_ = x[enum.ParamAttrNoUndef-7]
    23  	_ = x[enum.ParamAttrReadNone-8]
    24  	_ = x[enum.ParamAttrReadOnly-9]
    25  	_ = x[enum.ParamAttrReturned-10]
    26  	_ = x[enum.ParamAttrSignExt-11]
    27  	_ = x[enum.ParamAttrSwiftAsync-12]
    28  	_ = x[enum.ParamAttrSwiftError-13]
    29  	_ = x[enum.ParamAttrSwiftSelf-14]
    30  	_ = x[enum.ParamAttrWriteOnly-15]
    31  	_ = x[enum.ParamAttrZeroExt-16]
    32  }
    33  
    34  const _ParamAttr_name = "immarginregnestnoaliasnocapturenofreenonnullnoundefreadnonereadonlyreturnedsignextswiftasyncswifterrorswiftselfwriteonlyzeroext"
    35  
    36  var _ParamAttr_index = [...]uint8{0, 6, 11, 15, 22, 31, 37, 44, 51, 59, 67, 75, 82, 92, 102, 111, 120, 127}
    37  
    38  // ParamAttrFromString returns the ParamAttr enum corresponding to s.
    39  func ParamAttrFromString(s string) enum.ParamAttr {
    40  	if len(s) == 0 {
    41  		return 0
    42  	}
    43  	for i := range _ParamAttr_index[:len(_ParamAttr_index)-1] {
    44  		if s == _ParamAttr_name[_ParamAttr_index[i]:_ParamAttr_index[i+1]] {
    45  			return enum.ParamAttr(i)
    46  		}
    47  	}
    48  	panic(fmt.Errorf("unable to locate ParamAttr enum corresponding to %q", s))
    49  }
    50  
    51  func _(s string) {
    52  	// Check for duplicate string values in type "ParamAttr".
    53  	switch s {
    54  	// 0
    55  	case "immarg":
    56  	// 1
    57  	case "inreg":
    58  	// 2
    59  	case "nest":
    60  	// 3
    61  	case "noalias":
    62  	// 4
    63  	case "nocapture":
    64  	// 5
    65  	case "nofree":
    66  	// 6
    67  	case "nonnull":
    68  	// 7
    69  	case "noundef":
    70  	// 8
    71  	case "readnone":
    72  	// 9
    73  	case "readonly":
    74  	// 10
    75  	case "returned":
    76  	// 11
    77  	case "signext":
    78  	// 12
    79  	case "swiftasync":
    80  	// 13
    81  	case "swifterror":
    82  	// 14
    83  	case "swiftself":
    84  	// 15
    85  	case "writeonly":
    86  	// 16
    87  	case "zeroext":
    88  	}
    89  }