ir

package
v0.0.0-...-fdb9632 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VoidType *Void

	Int1Type  *Int1
	Int16Type *Int16
	Int8Type  *Int8
	Int32Type *Int32
	Int64Type *Int64
)

Functions

func NextTemp

func NextTemp() string

Types

type AllocaInst

type AllocaInst struct {
	// contains filtered or unexported fields
}

AllocaInst ... ---------------------

func CreateAlloca

func CreateAlloca(ty Type, numElems int, align int, name string) *AllocaInst

func (AllocaInst) AllocatedTy

func (a AllocaInst) AllocatedTy() Type

func (AllocaInst) HasName

func (a AllocaInst) HasName() bool

func (AllocaInst) IsBinaryOp

func (a AllocaInst) IsBinaryOp() bool

func (AllocaInst) IsBitBinOp

func (a AllocaInst) IsBitBinOp() bool

func (AllocaInst) IsMemOp

func (a AllocaInst) IsMemOp() bool

func (AllocaInst) IsOtherOp

func (a AllocaInst) IsOtherOp() bool

func (AllocaInst) IsTerm

func (a AllocaInst) IsTerm() bool

func (AllocaInst) Name

func (a AllocaInst) Name() string

func (AllocaInst) NumOperands

func (a AllocaInst) NumOperands() int

func (AllocaInst) NumUses

func (a AllocaInst) NumUses() int

func (AllocaInst) Opcode

func (a AllocaInst) Opcode() Opcode

func (AllocaInst) Operand

func (a AllocaInst) Operand(int) Value

func (AllocaInst) OperandList

func (a AllocaInst) OperandList() *list.List

func (AllocaInst) SetName

func (a AllocaInst) SetName(name string)

func (AllocaInst) String

func (a AllocaInst) String() string

func (AllocaInst) Type

func (a AllocaInst) Type() Type

type Argument

type Argument struct {
	// contains filtered or unexported fields
}

Argument ... ---------------------

func CreateArgument

func CreateArgument(ty *FunctionType, parent *Function, name string) *Argument

func (Argument) HasName

func (a Argument) HasName() bool

func (Argument) Name

func (a Argument) Name() string

func (Argument) Parent

func (a Argument) Parent() *Function

func (Argument) SetName

func (a Argument) SetName(name string)

func (Argument) String

func (a Argument) String() string

func (Argument) Type

func (a Argument) Type() Type

type BasicBlock

type BasicBlock struct {
	// contains filtered or unexported fields
}

BasicBlock ... -------------------------

func CreateBasicBlock

func CreateBasicBlock(name string, parent *Function) *BasicBlock

func NewBasicBlock

func NewBasicBlock(name string) *BasicBlock

func (BasicBlock) HasName

func (b BasicBlock) HasName() bool

func (BasicBlock) Instr

func (b BasicBlock) Instr() list.List

func (BasicBlock) Name

func (b BasicBlock) Name() string

func (BasicBlock) Parent

func (b BasicBlock) Parent() *Function

func (BasicBlock) SetName

func (b BasicBlock) SetName(name string)

func (BasicBlock) String

func (b BasicBlock) String() string

func (BasicBlock) Type

func (b BasicBlock) Type() Type

type BinaryOp

type BinaryOp struct {
	// contains filtered or unexported fields
}

BinaryOp ... --------------------

func CreateAdd

func CreateAdd(ty Type, left, right Value, name string) *BinaryOp

func CreateSub

func CreateSub(ty Type, left, right Value, name string) *BinaryOp

func CreateXOR

func CreateXOR(ty Type, left, right Value, name string) *BinaryOp

func (BinaryOp) HasName

func (b BinaryOp) HasName() bool

func (BinaryOp) IsBinaryOp

func (b BinaryOp) IsBinaryOp() bool

func (BinaryOp) IsBitBinOp

func (b BinaryOp) IsBitBinOp() bool

func (BinaryOp) IsMemOp

func (b BinaryOp) IsMemOp() bool

func (BinaryOp) IsOtherOp

func (b BinaryOp) IsOtherOp() bool

func (BinaryOp) IsTerm

func (b BinaryOp) IsTerm() bool

func (BinaryOp) Name

func (b BinaryOp) Name() string

func (BinaryOp) NumOperands

func (b BinaryOp) NumOperands() int

func (BinaryOp) NumUses

func (b BinaryOp) NumUses() int

func (BinaryOp) Opcode

func (b BinaryOp) Opcode() Opcode

func (BinaryOp) Operand

func (b BinaryOp) Operand(idx int) Value

func (BinaryOp) OperandList

func (b BinaryOp) OperandList() *list.List

func (BinaryOp) SetName

func (b BinaryOp) SetName(name string)

func (BinaryOp) String

func (b BinaryOp) String() string

func (BinaryOp) Type

func (b BinaryOp) Type() Type

type BitVector

type BitVector byte

BitVector -----------------------------

type BranchInst

type BranchInst struct {
	// contains filtered or unexported fields
}

BranchInst ... ---------------------

func CreateBr

func CreateBr(dst *BasicBlock) *BranchInst

func CreateCondBrInst

func CreateCondBrInst(cond Value, ifTrue, ifFalse *BasicBlock) *BranchInst

func (BranchInst) Cond

func (b BranchInst) Cond() Value

func (BranchInst) HasName

func (b BranchInst) HasName() bool

func (BranchInst) IsBinaryOp

func (b BranchInst) IsBinaryOp() bool

func (BranchInst) IsBitBinOp

func (b BranchInst) IsBitBinOp() bool

func (BranchInst) IsConditional

func (b BranchInst) IsConditional() bool

func (BranchInst) IsMemOp

func (b BranchInst) IsMemOp() bool

func (BranchInst) IsOtherOp

func (b BranchInst) IsOtherOp() bool

func (BranchInst) IsTerm

func (b BranchInst) IsTerm() bool

func (BranchInst) Name

func (b BranchInst) Name() string

func (BranchInst) NumOperands

func (b BranchInst) NumOperands() int

func (BranchInst) NumSuccessors

func (b BranchInst) NumSuccessors() int

func (BranchInst) NumUses

func (b BranchInst) NumUses() int

func (BranchInst) Opcode

func (b BranchInst) Opcode() Opcode

func (BranchInst) Operand

func (b BranchInst) Operand(idx int) Value

func (BranchInst) OperandList

func (b BranchInst) OperandList() *list.List

func (BranchInst) SetCond

func (b BranchInst) SetCond(cond Value)

func (BranchInst) SetName

func (b BranchInst) SetName(string)

func (BranchInst) SetSuccessor

func (b BranchInst) SetSuccessor(*BasicBlock)

func (BranchInst) String

func (b BranchInst) String() string

func (BranchInst) Type

func (b BranchInst) Type() Type

type Builder

type Builder struct {
	BB  *BasicBlock       // the current BasicBlock where instructions are inserted
	CFG *ControlFlowGraph // A graph modelling control-flow for the current function
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) CreateAdd

func (b *Builder) CreateAdd(lhs, rhs Value, name string) Value

func (*Builder) CreateAlloca

func (b *Builder) CreateAlloca(ty Type, name string) *AllocaInst

func (*Builder) CreateBr

func (b *Builder) CreateBr(dst *BasicBlock) *BranchInst

func (*Builder) CreateCall

func (b *Builder) CreateCall(fty *FunctionType, callee Value, args []Value, name string) *CallInstr

func (*Builder) CreateCmp

func (b *Builder) CreateCmp(pred Opcode, lhs, rhs Value, name string) Value

func (*Builder) CreateCondBr

func (b *Builder) CreateCondBr(cond Value, ifTrue, ifFalse *BasicBlock) *BranchInst

func (*Builder) CreateLoad

func (b *Builder) CreateLoad(ty Type, ptr Value, name string) *LoadInst

func (*Builder) CreateNeg

func (b *Builder) CreateNeg(v Value, name string) Value

func (*Builder) CreateNot

func (b *Builder) CreateNot(v Value, name string) Value

func (*Builder) CreatePHI

func (b *Builder) CreatePHI(ty Type, numIncomingValues uint, name string) *PHINode

func (*Builder) CreateRet

func (b *Builder) CreateRet(v Value) *ReturnInst

func (*Builder) CreateRetVoid

func (b *Builder) CreateRetVoid() *ReturnInst

func (*Builder) CreateStore

func (b *Builder) CreateStore(Val, Dst Value) *StoreInst

func (*Builder) CreateSub

func (b *Builder) CreateSub(lhs, rhs Value, name string) Value

func (*Builder) CreateXOR

func (b *Builder) CreateXOR(lhs, rhs Value, name string) Value

func (*Builder) GetInsertBlock

func (b *Builder) GetInsertBlock() *BasicBlock

GetInsertBlock returns the current BasicBlock where instructions are inserted

func (*Builder) SetInsertPoint

func (b *Builder) SetInsertPoint(BB *BasicBlock)

SetInsertPoint updates the current BasicBlock to BB

type CallInstr

type CallInstr struct {
	// contains filtered or unexported fields
}

CallInstr ... --------------------

func CreateCall

func CreateCall(fty *FunctionType, callee Value, args []Value, name string) *CallInstr

func (CallInstr) HasName

func (c CallInstr) HasName() bool

func (CallInstr) IsBinaryOp

func (c CallInstr) IsBinaryOp() bool

func (CallInstr) IsBitBinOp

func (c CallInstr) IsBitBinOp() bool

func (CallInstr) IsMemOp

func (c CallInstr) IsMemOp() bool

func (CallInstr) IsOtherOp

func (c CallInstr) IsOtherOp() bool

func (CallInstr) IsTerm

func (c CallInstr) IsTerm() bool

func (CallInstr) Name

func (c CallInstr) Name() string

func (CallInstr) NumOperands

func (c CallInstr) NumOperands() int

func (CallInstr) NumUses

func (c CallInstr) NumUses() int

func (CallInstr) Opcode

func (c CallInstr) Opcode() Opcode

func (CallInstr) Operand

func (c CallInstr) Operand(i int) Value

func (CallInstr) OperandList

func (c CallInstr) OperandList() *list.List

func (CallInstr) SetName

func (c CallInstr) SetName(name string)

func (CallInstr) String

func (c CallInstr) String() string

func (CallInstr) Type

func (c CallInstr) Type() Type

type Constant

type Constant interface {
	User
}

Constant ... ----------------

type ConstantInt

type ConstantInt struct {
	// contains filtered or unexported fields
}

ConstantInt ... --------------------

func NewConstantInt

func NewConstantInt(ty Type, value uint64, signed bool, name string) *ConstantInt

func (ConstantInt) HasName

func (c ConstantInt) HasName() bool

func (ConstantInt) Name

func (c ConstantInt) Name() string

func (ConstantInt) NumOperands

func (c ConstantInt) NumOperands() int

func (ConstantInt) NumUses

func (c ConstantInt) NumUses() int

func (ConstantInt) Operand

func (c ConstantInt) Operand(int) Value

func (ConstantInt) OperandList

func (c ConstantInt) OperandList() *list.List

func (ConstantInt) SetName

func (c ConstantInt) SetName(name string)

func (ConstantInt) String

func (c ConstantInt) String() string

func (ConstantInt) Type

func (c ConstantInt) Type() Type

type ControlFlowGraph

type ControlFlowGraph struct {
	Entry, Exit *BasicBlock
	Nodes       SetOfBBs
	Succ        map[string][]string
	Pred        map[string][]string
}

ControlFlowGraph ----------------------------------------------------------------

func NewCFG

func NewCFG() *ControlFlowGraph

func (*ControlFlowGraph) AddPred

func (cfg *ControlFlowGraph) AddPred(BlkName string, Predecessors ...*BasicBlock)

func (*ControlFlowGraph) AddSucc

func (cfg *ControlFlowGraph) AddSucc(BlkName string, Successors ...*BasicBlock)

func (*ControlFlowGraph) IsBrNode

func (cfg *ControlFlowGraph) IsBrNode(blk string) bool

func (*ControlFlowGraph) IsJoinNode

func (cfg *ControlFlowGraph) IsJoinNode(blk string) bool

func (*ControlFlowGraph) PostOrder

func (cfg *ControlFlowGraph) PostOrder() []string

func (*ControlFlowGraph) ReversePostOrder

func (cfg *ControlFlowGraph) ReversePostOrder() []string

func (*ControlFlowGraph) String

func (cfg *ControlFlowGraph) String() string

type Function

type Function struct {
	// contains filtered or unexported fields
}

Function ... -----------------------------

func CreateFunction

func CreateFunction(ty *FunctionType, link LinkageKind, name string, module *Module) *Function

func (Function) CFG

func (f Function) CFG() *ControlFlowGraph

func (Function) HasExternalLinkage

func (f Function) HasExternalLinkage() bool

func (Function) HasInternalLinkage

func (f Function) HasInternalLinkage() bool

func (Function) HasName

func (f Function) HasName() bool

func (Function) Name

func (f Function) Name() string

func (Function) NumOperands

func (f Function) NumOperands() int

func (Function) NumUses

func (f Function) NumUses() int

func (Function) Operand

func (f Function) Operand(int) Value

func (Function) OperandList

func (f Function) OperandList() *list.List

func (Function) Parent

func (f Function) Parent() *Module

func (Function) SetName

func (f Function) SetName(name string)

func (Function) String

func (f Function) String() string

func (Function) SymbolTable

func (f Function) SymbolTable()

func (Function) Type

func (f Function) Type() Type

type FunctionType

type FunctionType struct {
	// contains filtered or unexported fields
}

FunctionType ... ---------------------

func CreateFunctionType

func CreateFunctionType(args []Type, retTy Type, varArgs bool) *FunctionType

func (FunctionType) ArgType

func (f FunctionType) ArgType(i uint) Type

func (FunctionType) IsFuncTy

func (FunctionType) IsFuncTy() bool

func (FunctionType) IsIntegerTy

func (FunctionType) IsIntegerTy() bool

func (FunctionType) IsPtrTy

func (FunctionType) IsPtrTy() bool

func (FunctionType) IsVarArg

func (f FunctionType) IsVarArg() bool

func (FunctionType) IsVoidTy

func (FunctionType) IsVoidTy() bool

func (FunctionType) NumArgs

func (f FunctionType) NumArgs() int

func (FunctionType) ReturnType

func (f FunctionType) ReturnType() Type

func (FunctionType) String

func (f FunctionType) String() string

type GlobalValue

type GlobalValue interface {
	Value
	Constant
	HasInternalLinkage() bool
	HasExternalLinkage() bool
	Parent() *Module
}

GlobalValue denotes the base type of Global Variables and Functions ----------------------

type ICmpInstr

type ICmpInstr struct {
	// contains filtered or unexported fields
}

ICmpInstr ... --------------------------

func CreateICmp

func CreateICmp(ty Type, cond Opcode, x, y Value, name string) *ICmpInstr

func (ICmpInstr) HasName

func (c ICmpInstr) HasName() bool

func (ICmpInstr) IsBinaryOp

func (c ICmpInstr) IsBinaryOp() bool

func (ICmpInstr) IsBitBinOp

func (c ICmpInstr) IsBitBinOp() bool

func (ICmpInstr) IsMemOp

func (c ICmpInstr) IsMemOp() bool

func (ICmpInstr) IsOtherOp

func (c ICmpInstr) IsOtherOp() bool

func (ICmpInstr) IsTerm

func (c ICmpInstr) IsTerm() bool

func (ICmpInstr) Name

func (c ICmpInstr) Name() string

func (ICmpInstr) NumOperands

func (c ICmpInstr) NumOperands() int

func (ICmpInstr) NumUses

func (c ICmpInstr) NumUses() int

func (ICmpInstr) Opcode

func (c ICmpInstr) Opcode() Opcode

func (ICmpInstr) Operand

func (c ICmpInstr) Operand(idx int) Value

func (ICmpInstr) OperandList

func (c ICmpInstr) OperandList() *list.List

func (ICmpInstr) SetName

func (c ICmpInstr) SetName(name string)

func (ICmpInstr) String

func (c ICmpInstr) String() string

func (ICmpInstr) Type

func (c ICmpInstr) Type() Type

type Instruction

type Instruction interface {
	User
	Opcode() Opcode

	IsTerm() bool
	IsBinaryOp() bool
	IsMemOp() bool
	IsOtherOp() bool
	IsBitBinOp() bool

	String() string
}

type Int1

type Int1 struct {
	// contains filtered or unexported fields
}

Int1 ... ----------------------

func (Int1) BitWidth

func (i Int1) BitWidth() uint

func (Int1) IsFuncTy

func (Int1) IsFuncTy() bool

func (Int1) IsIntegerTy

func (Int1) IsIntegerTy() bool

func (Int1) IsPtrTy

func (Int1) IsPtrTy() bool

func (Int1) IsVoidTy

func (Int1) IsVoidTy() bool

func (Int1) String

func (Int1) String() string

type Int16

type Int16 struct {
	// contains filtered or unexported fields
}

Int16 ... ----------------------

func (Int16) BitWidth

func (i Int16) BitWidth() uint

func (Int16) IsFuncTy

func (Int16) IsFuncTy() bool

func (Int16) IsIntegerTy

func (Int16) IsIntegerTy() bool

func (Int16) IsPtrTy

func (Int16) IsPtrTy() bool

func (Int16) IsVoidTy

func (Int16) IsVoidTy() bool

func (Int16) String

func (Int16) String() string

type Int32

type Int32 struct {
	// contains filtered or unexported fields
}

Int32 ... ----------------------

func (Int32) BitWidth

func (i Int32) BitWidth() uint

func (Int32) IsFuncTy

func (Int32) IsFuncTy() bool

func (Int32) IsIntegerTy

func (Int32) IsIntegerTy() bool

func (Int32) IsPtrTy

func (Int32) IsPtrTy() bool

func (Int32) IsVoidTy

func (Int32) IsVoidTy() bool

func (Int32) String

func (Int32) String() string

type Int64

type Int64 struct {
	// contains filtered or unexported fields
}

Int64 ... ----------------------

func (Int64) BitWidth

func (i Int64) BitWidth() uint

func (Int64) IsFuncTy

func (Int64) IsFuncTy() bool

func (Int64) IsIntegerTy

func (Int64) IsIntegerTy() bool

func (Int64) IsPtrTy

func (Int64) IsPtrTy() bool

func (Int64) IsVoidTy

func (Int64) IsVoidTy() bool

func (Int64) String

func (Int64) String() string

type Int8

type Int8 struct {
	// contains filtered or unexported fields
}

Int8 ... ----------------------

func (Int8) BitWidth

func (i Int8) BitWidth() uint

func (Int8) IsFuncTy

func (Int8) IsFuncTy() bool

func (Int8) IsIntegerTy

func (Int8) IsIntegerTy() bool

func (Int8) IsPtrTy

func (Int8) IsPtrTy() bool

func (Int8) IsVoidTy

func (Int8) IsVoidTy() bool

func (Int8) String

func (Int8) String() string

type IntegerType

type IntegerType interface {
	Type
	BitWidth() uint
}

IntegerType ... ----------------------

func GetIntegerType

func GetIntegerType(numBits uint) IntegerType

type LabelType

type LabelType struct {
	// contains filtered or unexported fields
}

LabelType ... ---------------------

func (LabelType) IsFuncTy

func (LabelType) IsFuncTy() bool

func (LabelType) IsIntegerTy

func (LabelType) IsIntegerTy() bool

func (LabelType) IsPtrTy

func (LabelType) IsPtrTy() bool

func (LabelType) IsVoidTy

func (LabelType) IsVoidTy() bool

func (LabelType) String

func (l LabelType) String() string

type LinkageKind

type LinkageKind int
const (
	Internal LinkageKind = iota
	External
)

type LoadInst

type LoadInst struct {
	// contains filtered or unexported fields
}

LoadInst ... ----------------

func CreateLoad

func CreateLoad(typ Type, src Value, name string) *LoadInst

func (LoadInst) HasName

func (l LoadInst) HasName() bool

func (LoadInst) IsBinaryOp

func (l LoadInst) IsBinaryOp() bool

func (LoadInst) IsBitBinOp

func (l LoadInst) IsBitBinOp() bool

func (LoadInst) IsMemOp

func (l LoadInst) IsMemOp() bool

func (LoadInst) IsOtherOp

func (l LoadInst) IsOtherOp() bool

func (LoadInst) IsTerm

func (l LoadInst) IsTerm() bool

func (LoadInst) Name

func (l LoadInst) Name() string

func (LoadInst) NumOperands

func (l LoadInst) NumOperands() int

func (LoadInst) NumUses

func (l LoadInst) NumUses() int

func (LoadInst) Opcode

func (l LoadInst) Opcode() Opcode

func (LoadInst) Operand

func (l LoadInst) Operand(idx int) Value

func (LoadInst) OperandList

func (l LoadInst) OperandList() *list.List

func (LoadInst) SetName

func (l LoadInst) SetName(name string)

func (LoadInst) String

func (l LoadInst) String() string

func (LoadInst) Type

func (l LoadInst) Type() Type

type Module

type Module struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(name string) *Module

func (*Module) GetFunction

func (m *Module) GetFunction(name string) (F *Function)

func (*Module) GetFunctionList

func (m *Module) GetFunctionList() []*Function

func (*Module) GetOrInsertFunction

func (m *Module) GetOrInsertFunction(name string, ty *FunctionType, link LinkageKind) *Function

type Opcode

type Opcode int
const (
	Invalid Opcode = iota

	Add
	Sub
	Mul
	Div

	Alloca
	Load
	Store

	Xor
	Or
	And
	Shl
	LShr
	AShr

	Call
	Phi

	Eq
	Ne
	UGt
	UGe
	ULt
	ULe
	SGt
	SGe
	SLt
	SLe

	Br
	Ret
)

func (Opcode) String

func (op Opcode) String() string

type PHINode

type PHINode struct {
	// contains filtered or unexported fields
}

PHINode ... ---------------------

func CreatePHINode

func CreatePHINode(ty Type, numIncomingPaths uint, name string) *PHINode

func (*PHINode) AddIncoming

func (phi *PHINode) AddIncoming(v Value, blk *BasicBlock)

func (*PHINode) HasName

func (phi *PHINode) HasName() bool

func (*PHINode) IsBinaryOp

func (phi *PHINode) IsBinaryOp() bool

func (*PHINode) IsBitBinOp

func (phi *PHINode) IsBitBinOp() bool

func (*PHINode) IsMemOp

func (phi *PHINode) IsMemOp() bool

func (*PHINode) IsOtherOp

func (phi *PHINode) IsOtherOp() bool

func (*PHINode) IsTerm

func (phi *PHINode) IsTerm() bool

func (*PHINode) Name

func (phi *PHINode) Name() string

func (*PHINode) NumOperands

func (phi *PHINode) NumOperands() int

func (*PHINode) NumUses

func (phi *PHINode) NumUses() int

func (*PHINode) Opcode

func (phi *PHINode) Opcode() Opcode

func (*PHINode) Operand

func (phi *PHINode) Operand(idx int) Value

func (*PHINode) OperandList

func (phi *PHINode) OperandList() *list.List

func (*PHINode) SetName

func (phi *PHINode) SetName(name string)

func (*PHINode) String

func (phi *PHINode) String() string

func (*PHINode) Type

func (phi *PHINode) Type() Type

type PHINodeIncoming

type PHINodeIncoming struct {
	V   Value
	Blk *BasicBlock
}

func (PHINodeIncoming) String

func (p PHINodeIncoming) String() string

type PointerType

type PointerType struct {
	// contains filtered or unexported fields
}

PointerType ... --------------------

func CreatePointerType

func CreatePointerType(ty Type) *PointerType

func (PointerType) ElemType

func (p PointerType) ElemType() Type

func (PointerType) IsFuncTy

func (PointerType) IsFuncTy() bool

func (PointerType) IsIntegerTy

func (PointerType) IsIntegerTy() bool

func (PointerType) IsPtrTy

func (PointerType) IsPtrTy() bool

func (PointerType) IsVoidTy

func (PointerType) IsVoidTy() bool

func (PointerType) String

func (PointerType) String() string

type ReturnInst

type ReturnInst struct {
	// contains filtered or unexported fields
}

ReturnInst ... ---------------------

func CreateRet

func CreateRet(ty Type, value Value) *ReturnInst

func CreateRetVoid

func CreateRetVoid() *ReturnInst

func (ReturnInst) HasName

func (r ReturnInst) HasName() bool

func (ReturnInst) IsBinaryOp

func (r ReturnInst) IsBinaryOp() bool

func (ReturnInst) IsBitBinOp

func (r ReturnInst) IsBitBinOp() bool

func (ReturnInst) IsMemOp

func (r ReturnInst) IsMemOp() bool

func (ReturnInst) IsOtherOp

func (r ReturnInst) IsOtherOp() bool

func (ReturnInst) IsTerm

func (r ReturnInst) IsTerm() bool

func (ReturnInst) Name

func (r ReturnInst) Name() string

func (ReturnInst) NumOperands

func (r ReturnInst) NumOperands() int

func (ReturnInst) NumUses

func (r ReturnInst) NumUses() int

func (ReturnInst) Opcode

func (r ReturnInst) Opcode() Opcode

func (ReturnInst) Operand

func (r ReturnInst) Operand(idx int) Value

func (ReturnInst) OperandList

func (r ReturnInst) OperandList() *list.List

func (ReturnInst) SetName

func (r ReturnInst) SetName(s string)

func (ReturnInst) String

func (r ReturnInst) String() string

func (ReturnInst) Type

func (r ReturnInst) Type() Type

type SetOfBBs

type SetOfBBs map[string]*BasicBlock

SetOfBBs -----------------------------------------------------------------------

func (SetOfBBs) Add

func (s SetOfBBs) Add(blocks ...*BasicBlock)

func (SetOfBBs) Contains

func (s SetOfBBs) Contains(blk string) bool

func (SetOfBBs) Empty

func (s SetOfBBs) Empty() bool

func (SetOfBBs) Equal

func (s SetOfBBs) Equal(other SetOfBBs) bool

func (SetOfBBs) Intersection

func (s SetOfBBs) Intersection(other SetOfBBs) SetOfBBs

func (SetOfBBs) Len

func (s SetOfBBs) Len() int

func (SetOfBBs) Pop

func (s SetOfBBs) Pop() *BasicBlock

func (SetOfBBs) Remove

func (s SetOfBBs) Remove(blk string) SetOfBBs

func (SetOfBBs) String

func (s SetOfBBs) String() string

func (SetOfBBs) Union

func (s SetOfBBs) Union(other SetOfBBs) SetOfBBs

type StoreInst

type StoreInst struct {
	// contains filtered or unexported fields
}

StoreInst ... -------------------

func CreateStore

func CreateStore(value, dst Value) *StoreInst

func (StoreInst) HasName

func (s StoreInst) HasName() bool

func (StoreInst) IsBinaryOp

func (s StoreInst) IsBinaryOp() bool

func (StoreInst) IsBitBinOp

func (s StoreInst) IsBitBinOp() bool

func (StoreInst) IsMemOp

func (s StoreInst) IsMemOp() bool

func (StoreInst) IsOtherOp

func (s StoreInst) IsOtherOp() bool

func (StoreInst) IsTerm

func (s StoreInst) IsTerm() bool

func (StoreInst) Name

func (s StoreInst) Name() string

func (StoreInst) NumOperands

func (s StoreInst) NumOperands() int

func (StoreInst) NumUses

func (s StoreInst) NumUses() int

func (StoreInst) Opcode

func (s StoreInst) Opcode() Opcode

func (StoreInst) Operand

func (s StoreInst) Operand(idx int) Value

func (StoreInst) OperandList

func (s StoreInst) OperandList() *list.List

func (StoreInst) SetName

func (s StoreInst) SetName(string)

func (StoreInst) String

func (s StoreInst) String() string

func (StoreInst) Type

func (s StoreInst) Type() Type

type Type

type Type interface {
	String() string

	IsIntegerTy() bool
	IsPtrTy() bool
	IsFuncTy() bool
	IsVoidTy() bool
	// contains filtered or unexported methods
}

type User

type User interface {
	Value
	NumOperands() int
	Operand(int) Value
	OperandList() *list.List
}

type Value

type Value interface {
	Type() Type
	Name() string
	SetName(string)
	HasName() bool
	String() string
	NumUses() int
}

func GetAllOnesValue

func GetAllOnesValue(ty Type) Value

func GetNullValue

func GetNullValue(ty Type) Value

type ValueSymbolTable

type ValueSymbolTable map[string]Value

type Void

type Void struct{}

Void ... ---------------

func (Void) IsFuncTy

func (Void) IsFuncTy() bool

func (Void) IsIntegerTy

func (Void) IsIntegerTy() bool

func (Void) IsPtrTy

func (Void) IsPtrTy() bool

func (Void) IsVoidTy

func (Void) IsVoidTy() bool

func (Void) String

func (Void) String() string

Jump to

Keyboard shortcuts

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