cl

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbgFlagInstruction dbgFlags = 1 << iota
	DbgFlagGoSSA

	DbgFlagAll = DbgFlagInstruction | DbgFlagGoSSA
)
View Source
const (
	PkgNormal = iota
	PkgLLGo
	PkgPyModule   // py.<module>
	PkgNoInit     // noinit: a package that don't need to be initialized
	PkgDeclOnly   // decl: a package that only have declarations
	PkgLinkIR     // link llvm ir (.ll)
	PkgLinkExtern // link external object (.a/.so/.dll/.dylib/etc.)

)
View Source
const (
	RuntimeInit = llssa.PkgRuntime + ".init"
)

Variables

This section is empty.

Functions

func EnableDbgSyms added in v0.11.0

func EnableDbgSyms(b bool)

func EnableDebug added in v0.11.0

func EnableDebug(b bool)

func EnableExportRename added in v0.11.7

func EnableExportRename(b bool)

EnableExportRename enables or disables //export with different C symbol names. This is enabled when using -target flag for TinyGo compatibility.

func EnableTrace added in v0.11.0

func EnableTrace(b bool)

func NewPackage

func NewPackage(prog llssa.Program, pkg *ssa.Package, files []*ast.File) (ret llssa.Package, err error)

NewPackage compiles a Go package to LLVM IR package.

func NewPackageEx added in v0.8.8

func NewPackageEx(prog llssa.Program, patches Patches, rewrites map[string]string, pkg *ssa.Package, files []*ast.File) (ret llssa.Package, externs []string, err error)

NewPackageEx compiles a Go package to LLVM IR package.

Parameters:

  • prog: target LLVM SSA program context
  • patches: optional package patches applied during compilation
  • rewrites: per-package string initializers rewritten at compile time
  • pkg: SSA package to compile
  • files: parsed AST files that belong to the package

The rewrites map uses short variable names (without package qualifier) and only affects string-typed globals defined in the current package.

func NewPackageExWithEmbed added in v0.12.2

func NewPackageExWithEmbed(prog llssa.Program, patches Patches, rewrites map[string]string, pkg *ssa.Package, files []*ast.File, embedMap goembed.VarMap) (ret llssa.Package, externs []string, err error)

NewPackageExWithEmbed compiles a package using pre-loaded go:embed metadata.

This avoids re-scanning directives when the caller already loaded them.

func ParsePkgSyntax added in v0.9.1

func ParsePkgSyntax(prog llssa.Program, pkg *types.Package, files []*ast.File)

ParsePkgSyntax parses AST of a package to check llgo:type in type declaration.

func PkgKindOf added in v0.4.0

func PkgKindOf(pkg *types.Package) (int, string)

PkgKindOf returns the kind of a package.

func SetDebug

func SetDebug(dbgFlags dbgFlags)

SetDebug sets debug flags.

Types

type Patch added in v0.8.10

type Patch struct {
	Alt   *ssa.Package
	Types *types.Package
}

Patch is a patch of some package.

type Patches added in v0.8.9

type Patches = map[string]Patch

Patches is patches of some packages.

Directories

Path Synopsis
_testdata
cpkgimp command
debug command
fncall command
foo
importpkg command
method command
print command
printf command
printval command
ptrmthd command
uint command
untyped command
utf8 command
vargs command
varinit command
_testdefer
gobuild command
loop command
multiret command
print command
singleret command
_testgo
abimethod command
alias command
allocinloop command
cgobasic command
cgocfiles command
cgodefer command
cgofull command
cgomacro command
cgopython command
chan command
closure command
closure2 command
closureall command
constconv command
defer1 command
defer2 command
defer3 command
defer4 command
defer5 command
deferclosure command
defercomplex command
deferloop command
equal command
errors command
goexit command
goroutine command
ifaceconv command
ifaceprom command
indexerr command
interface command
interface1370 command
invoke command
makeslice command
multiret command
print command
reader command
reflect command
reflectconv command
reflectfn command
reflectmkfn command
returnorder command
rewrite command
runextest command
runtest command
select command
selects command
sigsegv command
strucintf command
struczero command
syncmap command
tpindex command
tpinst command
tplocaltype command
tpnamed command
tprecur command
tprecurfn command
tptypes command
typerecur command
_testlibc
allocacstrs command
argv command
atomic command
complex command
defer command
demangle command
once command
setjmp command
sqlite command
_testlibgo
atomic command
bytes command
complex command
errors command
math command
mathbits command
nettextproto command
os command
strings command
sync command
waitgroup command
_testpy
callpy command
gcd command
list command
matrix command
max command
pi command
pow command
_testrt
abinamed command
abitype command
alloca command
allocstr command
any command
asm command
asmfull command
builtin command
callback command
cast command
closure command
closurebound command
closureconv command
closureiface command
complex command
concat command
constuptr command
cstr command
cvar command
eface command
float2any command
fprintf command
freevars command
funcaddr command
funcdecl command
gblarray command
gotypes command
hello command
index command
intgen command
len command
linkname command
makemap command
map command
mapclosure command
mask command
methodthunk command
named command
namedslice command
nextblock command
panic command
qsort command
qsortfn command
result command
slice2array command
slicelen command
stacksave command
strlen command
struct command
structsize command
sum command
tpabi command
tpfunc command
tpmap command
tpmethod command
tpunsafe command
typalias command
typed command
unreachable command
unsafe command
vamethod command

Jump to

Keyboard shortcuts

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