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

     1  // Code generated by "string2enum -linecomment -type DwarfVirtuality ../../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.DwarfVirtualityNone-0]
    16  	_ = x[enum.DwarfVirtualityVirtual-1]
    17  	_ = x[enum.DwarfVirtualityPureVirtual-2]
    18  }
    19  
    20  const _DwarfVirtuality_name = "DW_VIRTUALITY_noneDW_VIRTUALITY_virtualDW_VIRTUALITY_pure_virtual"
    21  
    22  var _DwarfVirtuality_index = [...]uint8{0, 18, 39, 65}
    23  
    24  // DwarfVirtualityFromString returns the DwarfVirtuality enum corresponding to s.
    25  func DwarfVirtualityFromString(s string) enum.DwarfVirtuality {
    26  	if len(s) == 0 {
    27  		return 0
    28  	}
    29  	for i := range _DwarfVirtuality_index[:len(_DwarfVirtuality_index)-1] {
    30  		if s == _DwarfVirtuality_name[_DwarfVirtuality_index[i]:_DwarfVirtuality_index[i+1]] {
    31  			return enum.DwarfVirtuality(i)
    32  		}
    33  	}
    34  	panic(fmt.Errorf("unable to locate DwarfVirtuality enum corresponding to %q", s))
    35  }
    36  
    37  func _(s string) {
    38  	// Check for duplicate string values in type "DwarfVirtuality".
    39  	switch s {
    40  	// 0
    41  	case "DW_VIRTUALITY_none":
    42  	// 1
    43  	case "DW_VIRTUALITY_virtual":
    44  	// 2
    45  	case "DW_VIRTUALITY_pure_virtual":
    46  	}
    47  }