compiler

package
v0.0.0-...-af24b05 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 52

Documentation

Overview

Package compiler generates sys descriptions of syscalls, types and resources from textual descriptions.

Package compiler generates sys descriptions of syscalls, types and resources from textual descriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectUnused

func CollectUnused(desc *ast.Description, target *targets.Target, eh ast.ErrorHandler) ([]ast.Node, error)

func ExtractConsts

func ExtractConsts(desc *ast.Description, target *targets.Target, eh ast.ErrorHandler) map[string]*ConstInfo

func FabricateSyscallConsts

func FabricateSyscallConsts(target *targets.Target, constInfo map[string]*ConstInfo, cf *ConstFile)

FabricateSyscallConsts adds syscall number constants to consts map. Used for test OS to not bother specifying consts for all syscalls.

func FileList

func FileList(desc *ast.Description, OS string, eh ast.ErrorHandler) map[string]Meta

func Fuzz

func Fuzz(data []byte) int

Types

type Const

type Const struct {
	Name string
	Pos  ast.Pos
}

type ConstFile

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

ConstFile serializes/deserializes .const files.

func DeserializeConstFile

func DeserializeConstFile(glob string, eh ast.ErrorHandler) *ConstFile

func NewConstFile

func NewConstFile() *ConstFile

func (*ConstFile) AddArch

func (cf *ConstFile) AddArch(arch string, consts map[string]uint64, undeclared map[string]bool) error

func (*ConstFile) Arch

func (cf *ConstFile) Arch(arch string) map[string]uint64

func (*ConstFile) ExistsAny

func (cf *ConstFile) ExistsAny(constName string) bool

func (*ConstFile) Serialize

func (cf *ConstFile) Serialize() []byte

type ConstInfo

type ConstInfo struct {
	Consts   []*Const
	Includes []string
	Incdirs  []string
	Defines  map[string]string
}

type Meta

type Meta struct {
	NoExtract bool
	Arches    map[string]bool
}

func (*Meta) SupportsArch

func (meta *Meta) SupportsArch(arch string) bool

type Prog

type Prog struct {
	Resources []*prog.ResourceDesc
	Syscalls  []*prog.Syscall
	Types     []prog.Type
	// Set of unsupported syscalls/flags.
	Unsupported map[string]bool
	// contains filtered or unexported fields
}

Prog is description compilation result.

func Compile

func Compile(desc *ast.Description, consts map[string]uint64, target *targets.Target, eh ast.ErrorHandler) *Prog

Compile compiles sys description.

Jump to

Keyboard shortcuts

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