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

     1  // Code generated by "string2enum -linecomment -type DLLStorageClass ../../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.DLLStorageClassNone-0]
    16  	_ = x[enum.DLLStorageClassDLLExport-1]
    17  	_ = x[enum.DLLStorageClassDLLImport-2]
    18  }
    19  
    20  const _DLLStorageClass_name = "nonedllexportdllimport"
    21  
    22  var _DLLStorageClass_index = [...]uint8{0, 4, 13, 22}
    23  
    24  // DLLStorageClassFromString returns the DLLStorageClass enum corresponding to s.
    25  func DLLStorageClassFromString(s string) enum.DLLStorageClass {
    26  	if len(s) == 0 {
    27  		return 0
    28  	}
    29  	for i := range _DLLStorageClass_index[:len(_DLLStorageClass_index)-1] {
    30  		if s == _DLLStorageClass_name[_DLLStorageClass_index[i]:_DLLStorageClass_index[i+1]] {
    31  			return enum.DLLStorageClass(i)
    32  		}
    33  	}
    34  	panic(fmt.Errorf("unable to locate DLLStorageClass enum corresponding to %q", s))
    35  }
    36  
    37  func _(s string) {
    38  	// Check for duplicate string values in type "DLLStorageClass".
    39  	switch s {
    40  	// 0
    41  	case "none":
    42  	// 1
    43  	case "dllexport":
    44  	// 2
    45  	case "dllimport":
    46  	}
    47  }