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

     1  // Code generated by "string2enum -linecomment -type TLSModel ../../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.TLSModelNone-0]
    16  	_ = x[enum.TLSModelGeneric-1]
    17  	_ = x[enum.TLSModelInitialExec-2]
    18  	_ = x[enum.TLSModelLocalDynamic-3]
    19  	_ = x[enum.TLSModelLocalExec-4]
    20  }
    21  
    22  const _TLSModel_name = "nonegenericinitialexeclocaldynamiclocalexec"
    23  
    24  var _TLSModel_index = [...]uint8{0, 4, 11, 22, 34, 43}
    25  
    26  // TLSModelFromString returns the TLSModel enum corresponding to s.
    27  func TLSModelFromString(s string) enum.TLSModel {
    28  	if len(s) == 0 {
    29  		return 0
    30  	}
    31  	for i := range _TLSModel_index[:len(_TLSModel_index)-1] {
    32  		if s == _TLSModel_name[_TLSModel_index[i]:_TLSModel_index[i+1]] {
    33  			return enum.TLSModel(i)
    34  		}
    35  	}
    36  	panic(fmt.Errorf("unable to locate TLSModel enum corresponding to %q", s))
    37  }
    38  
    39  func _(s string) {
    40  	// Check for duplicate string values in type "TLSModel".
    41  	switch s {
    42  	// 0
    43  	case "none":
    44  	// 1
    45  	case "generic":
    46  	// 2
    47  	case "initialexec":
    48  	// 3
    49  	case "localdynamic":
    50  	// 4
    51  	case "localexec":
    52  	}
    53  }