github.com/llir/llvm@v0.3.6/ir/constant/expression.go (about)

     1  package constant
     2  
     3  // === [ Expressions ] =========================================================
     4  
     5  // Expression is an LLVM IR constant expression.
     6  //
     7  // An Expression has one of the following underlying types.
     8  //
     9  // Unary expressions
    10  //
    11  // https://llvm.org/docs/LangRef.html#constant-expressions
    12  //
    13  //    *constant.ExprFNeg   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFNeg
    14  //
    15  // Binary expressions
    16  //
    17  // https://llvm.org/docs/LangRef.html#constant-expressions
    18  //
    19  //    *constant.ExprAdd    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprAdd
    20  //    *constant.ExprFAdd   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFAdd
    21  //    *constant.ExprSub    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSub
    22  //    *constant.ExprFSub   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFSub
    23  //    *constant.ExprMul    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprMul
    24  //    *constant.ExprFMul   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFMul
    25  //    *constant.ExprUDiv   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprUDiv
    26  //    *constant.ExprSDiv   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSDiv
    27  //    *constant.ExprFDiv   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFDiv
    28  //    *constant.ExprURem   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprURem
    29  //    *constant.ExprSRem   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSRem
    30  //    *constant.ExprFRem   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFRem
    31  //
    32  // Bitwise expressions
    33  //
    34  // https://llvm.org/docs/LangRef.html#constant-expressions
    35  //
    36  //    *constant.ExprShl    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprShl
    37  //    *constant.ExprLShr   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprLShr
    38  //    *constant.ExprAShr   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprAShr
    39  //    *constant.ExprAnd    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprAnd
    40  //    *constant.ExprOr     // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprOr
    41  //    *constant.ExprXor    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprXor
    42  //
    43  // Vector expressions
    44  //
    45  // https://llvm.org/docs/LangRef.html#constant-expressions
    46  //
    47  //    *constant.ExprExtractElement   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprExtractElement
    48  //    *constant.ExprInsertElement    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprInsertElement
    49  //    *constant.ExprShuffleVector    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprShuffleVector
    50  //
    51  // Aggregate expressions
    52  //
    53  // https://llvm.org/docs/LangRef.html#constant-expressions
    54  //
    55  //    *constant.ExprExtractValue   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprExtractValue
    56  //    *constant.ExprInsertValue    // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprInsertValue
    57  //
    58  // Memory expressions
    59  //
    60  // https://llvm.org/docs/LangRef.html#constant-expressions
    61  //
    62  //    *constant.ExprGetElementPtr   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprGetElementPtr
    63  //
    64  // Conversion expressions
    65  //
    66  // https://llvm.org/docs/LangRef.html#constant-expressions
    67  //
    68  //    *constant.ExprTrunc           // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprTrunc
    69  //    *constant.ExprZExt            // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprZExt
    70  //    *constant.ExprSExt            // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSExt
    71  //    *constant.ExprFPTrunc         // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFPTrunc
    72  //    *constant.ExprFPExt           // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFPExt
    73  //    *constant.ExprFPToUI          // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFPToUI
    74  //    *constant.ExprFPToSI          // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFPToSI
    75  //    *constant.ExprUIToFP          // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprUIToFP
    76  //    *constant.ExprSIToFP          // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSIToFP
    77  //    *constant.ExprPtrToInt        // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprPtrToInt
    78  //    *constant.ExprIntToPtr        // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprIntToPtr
    79  //    *constant.ExprBitCast         // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprBitCast
    80  //    *constant.ExprAddrSpaceCast   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprAddrSpaceCast
    81  //
    82  // Other expressions
    83  //
    84  // https://llvm.org/docs/LangRef.html#constant-expressions
    85  //
    86  //    *constant.ExprICmp     // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprICmp
    87  //    *constant.ExprFCmp     // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprFCmp
    88  //    *constant.ExprSelect   // https://pkg.go.dev/github.com/llir/llvm/ir/constant#ExprSelect
    89  type Expression interface {
    90  	Constant
    91  	// IsExpression ensures that only constants expressions can be assigned to
    92  	// the constant.Expression interface.
    93  	IsExpression()
    94  }