symg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbgSymbol  dbgFlags = 1 << iota
	DbgFlagAll          = DbgSymbol
)

Variables

This section is empty.

Functions

func Do

func Do(conf *Config) (symbolTable []*llcppg.SymbolInfo, err error)

func GetCommonSymbols

func GetCommonSymbols(syms []*nm.Symbol, headerSymbols map[string]*SymbolInfo) []*llcppg.SymbolInfo

todo(zzy):only public for test,when llgo test support private package test,this function should be private GetCommonSymbols finds the intersection of symbols from the library symbol table and the symbols parsed from header files. It returns a list of symbols that can be externally linked.

func ParseHeaderFile

func ParseHeaderFile(combileFile string, curPkgFiles []string, prefixes []string, cflags []string, symMap map[string]string, isCpp bool) (map[string]*SymbolInfo, error)

func SetDebug

func SetDebug(flags dbgFlags)

Types

type Config

type Config struct {
	Libs         string
	CFlags       string
	Includes     []string
	Mix          bool
	TrimPrefixes []string
	SymMap       map[string]string
	IsCpp        bool
	// contains filtered or unexported fields
}

type LibMode added in v0.6.0

type LibMode = symbol.Mode

type Libs added in v0.6.0

type Libs struct {
	Paths []string
	Names []string
}

func ParseLibs added in v0.6.0

func ParseLibs(libs string) *Libs

func (*Libs) Files added in v0.6.0

func (l *Libs) Files(findPaths []string, mode LibMode) ([]string, []string, error)

searches for each library name in the provided paths and default paths, appending the appropriate file extension (.dylib for macOS, .so for Linux).

Example: For "-L/opt/homebrew/lib -llua -lm": - It will search for liblua.dylib (on macOS) or liblua.so (on Linux) - System libs like -lm are ignored and included in notFound

So error is returned if no libraries found at all.

type SymbolInfo

type SymbolInfo struct {
	GoName    string
	ProtoName string
}

type SymbolProcessor

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

func NewSymbolProcessor

func NewSymbolProcessor(curPkgFiles []string, prefixes []string, symMap map[string]string) *SymbolProcessor

func (*SymbolProcessor) AddSuffix

func (p *SymbolProcessor) AddSuffix(name string) string

func (*SymbolProcessor) GenMethodName

func (p *SymbolProcessor) GenMethodName(class, name string, isDestructor bool, isPointer bool) string

Jump to

Keyboard shortcuts

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