op

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockOpStrings

func BlockOpStrings() []string

BlockOpStrings returns a slice of all String values of the enum

func OpStrings

func OpStrings() []string

OpStrings returns a slice of all String values of the enum

func SetArch

func SetArch(a Arch)

Types

type Arch

type Arch interface {
	IsTwoOperand() bool
}

type BlockOp

type BlockOp int
const (
	BadBlock BlockOp = iota
	Jump
	If
	Return
	Panic

	IfEqual
	IfNotEqual
	IfLess
	IfLessEqual
	IfGreater
	IfGreaterEqual
)

func BlockOpString

func BlockOpString(s string) (BlockOp, error)

BlockOpString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func BlockOpValues

func BlockOpValues() []BlockOp

BlockOpValues returns all values of the enum

func (BlockOp) Compare

func (op BlockOp) Compare() Op

func (BlockOp) IsABlockOp

func (i BlockOp) IsABlockOp() bool

IsABlockOp returns "true" if the value is listed in the enum definition. "false" otherwise

func (BlockOp) String

func (i BlockOp) String() string

type Def

type Def struct {
	Op      Op
	Asm     string
	Sink    bool
	Compare bool
	Const   bool
	ClobArg bool
	Copy    bool
	Commute bool
}

type Op

type Op int
const (
	Invalid Op = iota
	Builtin
	Call
	CallBuiltin
	ChangeInterface
	ChangeType
	Const
	Convert
	Copy
	Extract
	Field
	FieldAddr
	FreeVar
	Func
	Global
	Index
	IndexAddr
	InlineAsm
	Local
	Lookup
	MakeInterface
	MakeSlice
	Next
	New
	Parameter
	Phi
	PhiCopy
	Range
	Reg
	Slice
	SliceToArrayPointer
	Store
	SwapIn
	SwapOut
	TypeAssert
	Add
	Sub
	Mul
	Div
	Rem
	And
	Or
	Xor
	ShiftLeft
	ShiftRight
	AndNot
	Equal
	NotEqual
	Less
	LessEqual
	Greater
	GreaterEqual
	Not
	Negate
	Load
	Invert

	Jump2
	If2
	Return2
	Panic2

	IfEqual2
	IfNotEqual2
	IfLess2
	IfLessEqual2
	IfGreater2
	IfGreaterEqual2

	NumOps
)

func OpString

func OpString(s string) (Op, error)

OpString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func OpValues

func OpValues() []Op

OpValues returns all values of the enum

func (Op) Asm

func (op Op) Asm() string

func (Op) ClobbersArg

func (op Op) ClobbersArg() bool

func (Op) Def

func (op Op) Def() *Def

func (Op) IsAOp

func (i Op) IsAOp() bool

IsAOp returns "true" if the value is listed in the enum definition. "false" otherwise

func (Op) IsCall added in v0.1.3

func (op Op) IsCall() bool

func (Op) IsCommutative

func (op Op) IsCommutative() bool

func (Op) IsCompare

func (op Op) IsCompare() bool

func (Op) IsConst

func (op Op) IsConst() bool

func (Op) IsCopy

func (op Op) IsCopy() bool

func (Op) IsSink

func (op Op) IsSink() bool

func (Op) Opposite

func (op Op) Opposite() Op

func (Op) String

func (i Op) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL