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

     1  // Code generated by "string2enum -linecomment -type FPred ../../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.FPredFalse-0]
    16  	_ = x[enum.FPredOEQ-1]
    17  	_ = x[enum.FPredOGE-2]
    18  	_ = x[enum.FPredOGT-3]
    19  	_ = x[enum.FPredOLE-4]
    20  	_ = x[enum.FPredOLT-5]
    21  	_ = x[enum.FPredONE-6]
    22  	_ = x[enum.FPredORD-7]
    23  	_ = x[enum.FPredTrue-8]
    24  	_ = x[enum.FPredUEQ-9]
    25  	_ = x[enum.FPredUGE-10]
    26  	_ = x[enum.FPredUGT-11]
    27  	_ = x[enum.FPredULE-12]
    28  	_ = x[enum.FPredULT-13]
    29  	_ = x[enum.FPredUNE-14]
    30  	_ = x[enum.FPredUNO-15]
    31  }
    32  
    33  const _FPred_name = "falseoeqogeogtoleoltoneordtrueuequgeugtuleultuneuno"
    34  
    35  var _FPred_index = [...]uint8{0, 5, 8, 11, 14, 17, 20, 23, 26, 30, 33, 36, 39, 42, 45, 48, 51}
    36  
    37  // FPredFromString returns the FPred enum corresponding to s.
    38  func FPredFromString(s string) enum.FPred {
    39  	if len(s) == 0 {
    40  		return 0
    41  	}
    42  	for i := range _FPred_index[:len(_FPred_index)-1] {
    43  		if s == _FPred_name[_FPred_index[i]:_FPred_index[i+1]] {
    44  			return enum.FPred(i)
    45  		}
    46  	}
    47  	panic(fmt.Errorf("unable to locate FPred enum corresponding to %q", s))
    48  }
    49  
    50  func _(s string) {
    51  	// Check for duplicate string values in type "FPred".
    52  	switch s {
    53  	// 0
    54  	case "false":
    55  	// 1
    56  	case "oeq":
    57  	// 2
    58  	case "oge":
    59  	// 3
    60  	case "ogt":
    61  	// 4
    62  	case "ole":
    63  	// 5
    64  	case "olt":
    65  	// 6
    66  	case "one":
    67  	// 7
    68  	case "ord":
    69  	// 8
    70  	case "true":
    71  	// 9
    72  	case "ueq":
    73  	// 10
    74  	case "uge":
    75  	// 11
    76  	case "ugt":
    77  	// 12
    78  	case "ule":
    79  	// 13
    80  	case "ult":
    81  	// 14
    82  	case "une":
    83  	// 15
    84  	case "uno":
    85  	}
    86  }