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

     1  // Code generated by "string2enum -linecomment -type DwarfCC ../../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.DwarfCCNormal-1]
    16  	_ = x[enum.DwarfCCProgram-2]
    17  	_ = x[enum.DwarfCCNoCall-3]
    18  	_ = x[enum.DwarfCCPassByReference-4]
    19  	_ = x[enum.DwarfCCPassByValue-5]
    20  	_ = x[enum.DwarfCCGNUBorlandFastcallI386-65]
    21  	_ = x[enum.DwarfCCBORLANDSafecall-176]
    22  	_ = x[enum.DwarfCCBORLANDStdcall-177]
    23  	_ = x[enum.DwarfCCBORLANDPascal-178]
    24  	_ = x[enum.DwarfCCBORLANDMSFastcall-179]
    25  	_ = x[enum.DwarfCCBORLANDMSReturn-180]
    26  	_ = x[enum.DwarfCCBORLANDThiscall-181]
    27  	_ = x[enum.DwarfCCBORLANDFastcall-182]
    28  	_ = x[enum.DwarfCCLLVMVectorcall-192]
    29  }
    30  
    31  const (
    32  	_DwarfCC_name_0 = "DW_CC_normalDW_CC_programDW_CC_nocallDW_CC_pass_by_referenceDW_CC_pass_by_value"
    33  	_DwarfCC_name_1 = "DW_CC_GNU_borland_fastcall_i386"
    34  	_DwarfCC_name_2 = "DW_CC_BORLAND_safecallDW_CC_BORLAND_stdcallDW_CC_BORLAND_pascalDW_CC_BORLAND_msfastcallDW_CC_BORLAND_msreturnDW_CC_BORLAND_thiscallDW_CC_BORLAND_fastcall"
    35  	_DwarfCC_name_3 = "DW_CC_LLVM_vectorcall"
    36  )
    37  
    38  var (
    39  	_DwarfCC_index_0 = [...]uint8{0, 12, 25, 37, 60, 79}
    40  	_DwarfCC_index_2 = [...]uint8{0, 22, 43, 63, 87, 109, 131, 153}
    41  )
    42  
    43  // DwarfCCFromString returns the DwarfCC enum corresponding to s.
    44  func DwarfCCFromString(s string) enum.DwarfCC {
    45  	if len(s) == 0 {
    46  		return 0
    47  	}
    48  	for i := range _DwarfCC_index_0[:len(_DwarfCC_index_0)-1] {
    49  		if s == _DwarfCC_name_0[_DwarfCC_index_0[i]:_DwarfCC_index_0[i+1]] {
    50  			return enum.DwarfCC(i + 1)
    51  		}
    52  	}
    53  	if s == _DwarfCC_name_1 {
    54  		return enum.DwarfCC(65)
    55  	}
    56  	for i := range _DwarfCC_index_2[:len(_DwarfCC_index_2)-1] {
    57  		if s == _DwarfCC_name_2[_DwarfCC_index_2[i]:_DwarfCC_index_2[i+1]] {
    58  			return enum.DwarfCC(i + 176)
    59  		}
    60  	}
    61  	if s == _DwarfCC_name_3 {
    62  		return enum.DwarfCC(192)
    63  	}
    64  	panic(fmt.Errorf("unable to locate DwarfCC enum corresponding to %q", s))
    65  }
    66  
    67  func _(s string) {
    68  	// Check for duplicate string values in type "DwarfCC".
    69  	switch s {
    70  	// 1
    71  	case "DW_CC_normal":
    72  	// 2
    73  	case "DW_CC_program":
    74  	// 3
    75  	case "DW_CC_nocall":
    76  	// 4
    77  	case "DW_CC_pass_by_reference":
    78  	// 5
    79  	case "DW_CC_pass_by_value":
    80  	// 65
    81  	case "DW_CC_GNU_borland_fastcall_i386":
    82  	// 176
    83  	case "DW_CC_BORLAND_safecall":
    84  	// 177
    85  	case "DW_CC_BORLAND_stdcall":
    86  	// 178
    87  	case "DW_CC_BORLAND_pascal":
    88  	// 179
    89  	case "DW_CC_BORLAND_msfastcall":
    90  	// 180
    91  	case "DW_CC_BORLAND_msreturn":
    92  	// 181
    93  	case "DW_CC_BORLAND_thiscall":
    94  	// 182
    95  	case "DW_CC_BORLAND_fastcall":
    96  	// 192
    97  	case "DW_CC_LLVM_vectorcall":
    98  	}
    99  }