Documentation ¶
Index ¶
- func ToCType(from types.Type) ctypes.Type
- type AddExpr
- type AssignStmt
- type BlackLine
- type CIRStringer
- type CallExpr
- type EqlExpr
- type Expr
- type ExprStmt
- type FuncDecl
- type GetaddrExpr
- type Ident
- type IfStmt
- type JumpStmt
- type Label
- type LoadExpr
- type MulExpr
- type NotExpr
- type PhiEdge
- type PhiStmt
- type QuoExpr
- type RawExpr
- type ReturnStmt
- type Scope
- func (s *Scope) AddAssignStmt(l, r Expr) *AssignStmt
- func (s *Scope) AddBlackLine() *BlackLine
- func (s *Scope) AddExprStmt(x Expr) Stmt
- func (s *Scope) AddFuncDecl(name string, result ctypes.Type, params []VarDecl) *FuncDecl
- func (s *Scope) AddIfStmt(cond Expr, succs [2]int) *IfStmt
- func (s *Scope) AddJumpStmt(name string) *JumpStmt
- func (s *Scope) AddLabel(name string) *Label
- func (s *Scope) AddLocalVarDecl(name string, t ctypes.Type) *VarDecl
- func (s *Scope) AddPhiStmt(incoming Expr, dest Expr, edges []PhiEdge) *PhiStmt
- func (s *Scope) AddReturnStmt(v []Expr) *ReturnStmt
- func (s *Scope) AddScope() *Scope
- func (s *Scope) AddStoreStmt(addr, value Expr) *StoreStmt
- func (s *Scope) AddStructDecl(name string, m []Var) *StructDecl
- func (s *Scope) AddTempVarDecl(name string, t ctypes.Type) *VarDeclStmt
- func (s *Scope) AddTupleDecl(t ctypes.Tuple) *StructDecl
- func (s *Scope) CIRString() string
- func (s *Scope) Lookup(name string) (*Scope, Expr)
- func (s *Scope) Type() ctypes.Type
- type SelectExpr
- type Stmt
- type StoreStmt
- type StructDecl
- type SubExpr
- type Var
- type VarDecl
- type VarDeclStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddExpr ¶
************************************* AddExpr: *************************************
func NewAddExpr ¶
type AssignStmt ¶
************************************* AssignStmt: *************************************
func NewAssignStmt ¶
func NewAssignStmt(l, r Expr) *AssignStmt
func (*AssignStmt) CIRString ¶
func (s *AssignStmt) CIRString() string
type BlackLine ¶
type BlackLine struct { }
************************************* BlackLine: *************************************
func NewBlackLine ¶
func NewBlackLine() *BlackLine
type CIRStringer ¶
type CIRStringer interface {
CIRString() string
}
************************************* CIRStringer: *************************************
type CallExpr ¶
************************************* CallExpr: *************************************
func NewCallExpr ¶
type EqlExpr ¶
************************************* EqlExpr: *************************************
func NewEqlExpr ¶
type Expr ¶
type Expr interface { CIRStringer Type() ctypes.Type }
************************************* Expr: *************************************
type ExprStmt ¶
type ExprStmt struct {
X Expr
}
************************************* ExprStmt: *************************************
func NewExprStmt ¶
type FuncDecl ¶
************************************* FuncDecl: 函数声明 *************************************
type GetaddrExpr ¶
type GetaddrExpr struct {
X Expr
}
************************************* GetaddrExpr: *************************************
func NewGetaddrExpr ¶
func NewGetaddrExpr(x Expr) *GetaddrExpr
func (*GetaddrExpr) CIRString ¶
func (e *GetaddrExpr) CIRString() string
func (*GetaddrExpr) Type ¶
func (e *GetaddrExpr) Type() ctypes.Type
type Ident ¶
type Ident struct {
Name string
}
************************************* Ident: *************************************
type JumpStmt ¶
type JumpStmt struct {
Name string
}
************************************* JumpStmt: *************************************
func NewJumpStmt ¶
type Label ¶
type Label struct {
Name string
}
************************************* Label: *************************************
type LoadExpr ¶
type LoadExpr struct {
// contains filtered or unexported fields
}
************************************* LoadExpr: *************************************
func NewLoadExpr ¶
type MulExpr ¶
************************************* MulExpr: *************************************
func NewMulExpr ¶
type NotExpr ¶
type NotExpr struct {
X Expr
}
************************************* NotExpr: *************************************
func NewNotExpr ¶
type QuoExpr ¶
************************************* QuoExpr: *************************************
func NewQuoExpr ¶
type RawExpr ¶
type RawExpr struct {
// contains filtered or unexported fields
}
************************************* RawExpr: *************************************
type ReturnStmt ¶
type ReturnStmt struct {
Vars []Expr
}
************************************* ReturnStmt: *************************************
func NewReturnStmt ¶
func NewReturnStmt(v []Expr) *ReturnStmt
func (*ReturnStmt) CIRString ¶
func (s *ReturnStmt) CIRString() string
type Scope ¶
type Scope struct { //父域指针,Scope.NewScope()设置该值 Parent *Scope //在该域中定义的结构体 Structs []*StructDecl //在该域中定义的函数 Funcs []*FuncDecl //域中包含的语句 Stmts []Stmt //在该域中定义的变量(含局部变量和临时变量,局部变量位于域头部结构体之后,临时变量可出现于域内任意位置) Vars []*VarDecl // contains filtered or unexported fields }
************************************* Scope: CIR的域结构 Scope可近似理解为由大括号对{}括起来的语句块 *************************************
func (*Scope) AddAssignStmt ¶
func (s *Scope) AddAssignStmt(l, r Expr) *AssignStmt
func (*Scope) AddBlackLine ¶
func (*Scope) AddExprStmt ¶
func (*Scope) AddFuncDecl ¶
func (*Scope) AddJumpStmt ¶
func (*Scope) AddLocalVarDecl ¶
func (*Scope) AddPhiStmt ¶
func (*Scope) AddReturnStmt ¶
func (s *Scope) AddReturnStmt(v []Expr) *ReturnStmt
func (*Scope) AddStoreStmt ¶
func (*Scope) AddStructDecl ¶
func (s *Scope) AddStructDecl(name string, m []Var) *StructDecl
func (*Scope) AddTempVarDecl ¶
func (s *Scope) AddTempVarDecl(name string, t ctypes.Type) *VarDeclStmt
func (*Scope) AddTupleDecl ¶
func (s *Scope) AddTupleDecl(t ctypes.Tuple) *StructDecl
type SelectExpr ¶
type SelectExpr struct {
// contains filtered or unexported fields
}
************************************* SelectExpr: *************************************
func NewSelectExpr ¶
func NewSelectExpr(x, y Expr) *SelectExpr
func (*SelectExpr) CIRString ¶
func (s *SelectExpr) CIRString() string
func (*SelectExpr) Type ¶
func (s *SelectExpr) Type() ctypes.Type
type Stmt ¶
type Stmt interface { CIRStringer // contains filtered or unexported methods }
************************************* Stmt: *************************************
type StoreStmt ¶
type StoreStmt struct {
// contains filtered or unexported fields
}
************************************* StoreStmt: *************************************
func NewStoreStmt ¶
type StructDecl ¶
************************************* StructDecl: 结构体声明 *************************************
func NewStructDecl ¶
func NewStructDecl(name string, m []Var) *StructDecl
func (*StructDecl) CIRString ¶
func (s *StructDecl) CIRString() string
type SubExpr ¶
************************************* SubExpr: *************************************
func NewSubExpr ¶
type Var ¶
type Var struct { Name string AssociatedSSAObj interface{} // contains filtered or unexported fields }
************************************* Var: *************************************
type VarDecl ¶
************************************* VarDecl: 变量声明 *************************************
type VarDeclStmt ¶
type VarDeclStmt struct {
VarDecl
}
************************************* VarDeclStmt: *************************************
func NewVarDeclStmt ¶
func NewVarDeclStmt(name string, t ctypes.Type) *VarDeclStmt
func (*VarDeclStmt) CIRString ¶
func (s *VarDeclStmt) CIRString() string