llvm

package module
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

llvm-c

GoDoc GitHub release LLGo XGo

LLGo bindings for LLVM's official C API (llvm-c), providing a stable, ABI-safe interface to LLVM's IR builder, module, and JIT infrastructure.

Documentation

Index

Constants

View Source
const (
	AttributeReturnIndex = 0
	// ISO C restricts enumerator values to range of 'int'
	// (4294967295 is too large)
	// LLVMAttributeFunctionIndex = ~0U,
	AttributeFunctionIndex = -1
)

Attribute index are either LLVMAttributeReturnIndex, LLVMAttributeFunctionIndex or a parameter number from 1 to N.

View Source
const (
	FastMathAllowReassoc    = 1
	FastMathNoNaNs          = 2
	FastMathNoInfs          = 4
	FastMathNoSignedZeros   = 8
	FastMathAllowReciprocal = 16
	FastMathAllowContract   = 32
	FastMathApproxFunc      = 64
	FastMathNone            = 0
	FastMathAll             = 127
)
View Source
const (
	GEPFlagInBounds = 1
	GEPFlagNUSW     = 2
	GEPFlagNUW      = 4
)
View Source
const (
	MDStringMetadataKind                     = 0
	ConstantAsMetadataMetadataKind           = 1
	LocalAsMetadataMetadataKind              = 2
	DistinctMDOperandPlaceholderMetadataKind = 3
	MDTupleMetadataKind                      = 4
	DILocationMetadataKind                   = 5
	DIExpressionMetadataKind                 = 6
	DIGlobalVariableExpressionMetadataKind   = 7
	GenericDINodeMetadataKind                = 8
	DISubrangeMetadataKind                   = 9
	DIEnumeratorMetadataKind                 = 10
	DIBasicTypeMetadataKind                  = 11
	DIDerivedTypeMetadataKind                = 12
	DICompositeTypeMetadataKind              = 13
	DISubroutineTypeMetadataKind             = 14
	DIFileMetadataKind                       = 15
	DICompileUnitMetadataKind                = 16
	DISubprogramMetadataKind                 = 17
	DILexicalBlockMetadataKind               = 18
	DILexicalBlockFileMetadataKind           = 19
	DINamespaceMetadataKind                  = 20
	DIModuleMetadataKind                     = 21
	DITemplateTypeParameterMetadataKind      = 22
	DITemplateValueParameterMetadataKind     = 23
	DIGlobalVariableMetadataKind             = 24
	DILocalVariableMetadataKind              = 25
	DILabelMetadataKind                      = 26
	DIObjCPropertyMetadataKind               = 27
	DIImportedEntityMetadataKind             = 28
	DIMacroMetadataKind                      = 29
	DIMacroFileMetadataKind                  = 30
	DICommonBlockMetadataKind                = 31
	DIStringTypeMetadataKind                 = 32
	DIGenericSubrangeMetadataKind            = 33
	DIArgListMetadataKind                    = 34
	DIAssignIDMetadataKind                   = 35
	DISubrangeTypeMetadataKind               = 36
	DIFixedPointTypeMetadataKind             = 37
)

NOTE: New entries should always be appended instead of matching the order in Metadata.def.

View Source
const (
	Disassembler_VariantKind_ARM_HI16 = 1
	// :lower16:
	Disassembler_VariantKind_ARM_LO16 = 2
)

The ARM target VariantKinds.

View Source
const (
	Disassembler_VariantKind_ARM64_PAGE = 1
	// @pageoff
	Disassembler_VariantKind_ARM64_PAGEOFF = 2
	// @gotpage
	Disassembler_VariantKind_ARM64_GOTPAGE = 3
	// @gotpageoff
	Disassembler_VariantKind_ARM64_GOTPAGEOFF = 4
	// @tvlppage
	Disassembler_VariantKind_ARM64_TLVP = 5
	// @tvlppageoff
	Disassembler_VariantKind_ARM64_TLVOFF = 6
)

The ARM64 target VariantKinds.

View Source
const (
	BLAKE3_VERSION_STRING = "1.8.2"
	BLAKE3_KEY_LEN        = 32
	BLAKE3_OUT_LEN        = 32
	BLAKE3_BLOCK_LEN      = 64
	BLAKE3_CHUNK_LEN      = 1024
	BLAKE3_MAX_DEPTH      = 54
)
View Source
const DEFAULT_TARGET_TRIPLE = "arm64-apple-darwin24.6.0"
View Source
const Disassembler_Option_AsmPrinterVariant = 4

The option use the other assembler printer variant

View Source
const Disassembler_Option_Color = 32

The option to print in color

View Source
const Disassembler_Option_PrintImmHex = 2

The option to print immediates as hex.

View Source
const Disassembler_Option_PrintLatency = 16

The option to print latency information alongside instructions

View Source
const Disassembler_Option_SetInstrComments = 8

The option to set comment on instructions

View Source
const Disassembler_Option_UseMarkup = 1

The option to produce marked up assembly.

View Source
const Disassembler_ReferenceType_DeMangled_Name = 9

The output reference is to a C++ symbol name.

View Source
const Disassembler_ReferenceType_InOut_None = 0

No input reference type or no output reference type.

View Source
const Disassembler_ReferenceType_In_ARM64_ADDXri = 4294967298

The input reference is from an ARM64::ADDXri instruction.

View Source
const Disassembler_ReferenceType_In_ARM64_ADR = 4294967301

The input reference is from an ARM64::ADR instruction.

View Source
const Disassembler_ReferenceType_In_ARM64_ADRP = 4294967297

The input reference is from an ARM64::ADRP instruction.

View Source
const Disassembler_ReferenceType_In_ARM64_LDRXl = 4294967300

The input reference is from an ARM64::LDRXl instruction.

View Source
const Disassembler_ReferenceType_In_ARM64_LDRXui = 4294967299

The input reference is from an ARM64::LDRXui instruction.

View Source
const Disassembler_ReferenceType_In_Branch = 1

The input reference is from a branch instruction.

View Source
const Disassembler_ReferenceType_In_PCrel_Load = 2

The input reference is from a PC relative load instruction.

View Source
const Disassembler_ReferenceType_Out_LitPool_CstrAddr = 3

The output reference is to a cstring address in a literal pool.

View Source
const Disassembler_ReferenceType_Out_LitPool_SymAddr = 2

The output reference is to a symbol address in a literal pool.

View Source
const Disassembler_ReferenceType_Out_Objc_CFString_Ref = 4

The output reference is to a Objective-C CoreFoundation string.

View Source
const Disassembler_ReferenceType_Out_Objc_Class_Ref = 8

The output reference is to a Objective-C class ref.

View Source
const Disassembler_ReferenceType_Out_Objc_Message = 5

The output reference is to a Objective-C message.

View Source
const Disassembler_ReferenceType_Out_Objc_Message_Ref = 6

The output reference is to a Objective-C message ref.

View Source
const Disassembler_ReferenceType_Out_Objc_Selector_Ref = 7

The output reference is to a Objective-C selector ref.

View Source
const Disassembler_ReferenceType_Out_SymbolStub = 1

The output reference is to as symbol stub.

View Source
const Disassembler_VariantKind_None = 0

The operand VariantKinds for symbolic disassembly.

View Source
const ENABLE_DEBUGLOC_TRACKING_COVERAGE = 0
View Source
const ENABLE_DEBUGLOC_TRACKING_ORIGIN = 0
View Source
const ENABLE_DIA_SDK = 0
View Source
const ENABLE_IO_SANDBOX = 0
View Source
const ENABLE_ONDISK_CAS = 1
View Source
const ENABLE_TELEMETRY = 1
View Source
const ENABLE_THREADS = 1
View Source
const ENABLE_ZLIB = 1
View Source
const ENABLE_ZSTD = 1
View Source
const ErrorSuccess = 0
View Source
const FORCE_ENABLE_STATS = 0
View Source
const HAS_ATOMICS = 1
View Source
const HAVE_SYSEXITS_H = 1
View Source
const HOST_TRIPLE = "arm64-apple-darwin24.6.0"
View Source
const LLGoPackage = "link: -L$(llvm-config --libdir) -lLLVM; -lLLVM"
View Source
const LTO_API_VERSION = 30
View Source
const ON_UNIX = 1
View Source
const REMARKS_API_VERSION = 1

0 -> 1: Bitstream remarks support.

View Source
const UNREACHABLE_OPTIMIZE = 1
View Source
const USE_INTEL_JITEVENTS = 0
View Source
const USE_OPROFILE = 0
View Source
const USE_PERF = 0
View Source
const VERSION_MAJOR = 22
View Source
const VERSION_MINOR = 1
View Source
const VERSION_PATCH = 8
View Source
const VERSION_STRING = "22.1.8"

Variables

This section is empty.

Functions

func AddClause

func AddClause(LandingPad ValueRef, ClauseVal ValueRef)

Add a catch or filter clause to the landingpad instruction

func AddSymbol

func AddSymbol(symbolName *c.Char, symbolValue unsafe.Pointer)

This functions permanently adds the symbol \p symbolName with the value \p symbolValue. These symbols are searched before any libraries.

@see sys::DynamicLibrary::AddSymbol()

func AliasSetAliasee

func AliasSetAliasee(Alias ValueRef, Aliasee ValueRef)

Set the target value of an alias.

func Blake3Version added in v0.3.2

func Blake3Version() *c.Char

func CreateMessage

func CreateMessage(Message *c.Char) *c.Char

func DISubprogramReplaceType

func DISubprogramReplaceType(Subprogram MetadataRef, SubroutineType MetadataRef)

Replace the subprogram subroutine type. \param Subprogram The subprogram object. \param SubroutineType The new subroutine type.

@see DISubprogram::replaceType()

func DebugMetadataVersion

func DebugMetadataVersion() c.Uint

The current debug metadata version number.

func DisposeErrorMessage

func DisposeErrorMessage(ErrMsg *c.Char)

Dispose of the given error message.

func DisposeMessage

func DisposeMessage(Message *c.Char)

func EnablePrettyStackTrace

func EnablePrettyStackTrace()

Enable LLVM's built-in stack trace code. This intercepts the OS's crash signals and prints which component of LLVM you were in at the time if the crash.

func GetDefaultTargetTriple

func GetDefaultTargetTriple() *c.Char

Get a triple for the host machine as a string. The result needs to be disposed with LLVMDisposeMessage.

func GetEnumAttributeKindForName

func GetEnumAttributeKindForName(Name *c.Char, SLen c.SizeT) c.Uint

Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists.

See http://llvm.org/docs/LangRef.html#parameter-attributes and http://llvm.org/docs/LangRef.html#function-attributes for the list of available attributes.

NB: Attribute names and/or id are subject to change without going through the C API deprecation cycle.

func GetHostCPUFeatures

func GetHostCPUFeatures() *c.Char

Get the host CPU's features as a string. The result needs to be disposed with LLVMDisposeMessage.

func GetHostCPUName

func GetHostCPUName() *c.Char

Get the host CPU as a string. The result needs to be disposed with LLVMDisposeMessage.

func GetLastEnumAttributeKind

func GetLastEnumAttributeKind() c.Uint

func GetMDKindID

func GetMDKindID(Name *c.Char, SLen c.Uint) c.Uint

func GetUndefMaskElem

func GetUndefMaskElem() c.Int

\returns a constant that specifies that the result of a \c ShuffleVectorInst is undefined.

func GetVersion

func GetVersion(Major *c.Uint, Minor *c.Uint, Patch *c.Uint)

Return the major, minor, and patch version of LLVM

The version components are returned via the function's three output parameters or skipped if a NULL pointer was supplied.

func InitializeAArch64AsmParser

func InitializeAArch64AsmParser()

func InitializeAArch64AsmPrinter

func InitializeAArch64AsmPrinter()

func InitializeAArch64Disassembler

func InitializeAArch64Disassembler()

func InitializeAArch64Target

func InitializeAArch64Target()

func InitializeAArch64TargetInfo

func InitializeAArch64TargetInfo()

func InitializeAArch64TargetMC

func InitializeAArch64TargetMC()

func InitializeAMDGPUAsmParser

func InitializeAMDGPUAsmParser()

func InitializeAMDGPUAsmPrinter

func InitializeAMDGPUAsmPrinter()

func InitializeAMDGPUDisassembler

func InitializeAMDGPUDisassembler()

func InitializeAMDGPUTarget

func InitializeAMDGPUTarget()

func InitializeAMDGPUTargetInfo

func InitializeAMDGPUTargetInfo()

func InitializeAMDGPUTargetMC

func InitializeAMDGPUTargetMC()

func InitializeARMAsmParser

func InitializeARMAsmParser()

func InitializeARMAsmPrinter

func InitializeARMAsmPrinter()

func InitializeARMDisassembler

func InitializeARMDisassembler()

func InitializeARMTarget

func InitializeARMTarget()

func InitializeARMTargetInfo

func InitializeARMTargetInfo()

func InitializeARMTargetMC

func InitializeARMTargetMC()

func InitializeAVRAsmParser

func InitializeAVRAsmParser()

func InitializeAVRAsmPrinter

func InitializeAVRAsmPrinter()

func InitializeAVRDisassembler

func InitializeAVRDisassembler()

func InitializeAVRTarget

func InitializeAVRTarget()

func InitializeAVRTargetInfo

func InitializeAVRTargetInfo()

func InitializeAVRTargetMC

func InitializeAVRTargetMC()

func InitializeBPFAsmParser

func InitializeBPFAsmParser()

func InitializeBPFAsmPrinter

func InitializeBPFAsmPrinter()

func InitializeBPFDisassembler

func InitializeBPFDisassembler()

func InitializeBPFTarget

func InitializeBPFTarget()

func InitializeBPFTargetInfo

func InitializeBPFTargetInfo()

func InitializeBPFTargetMC

func InitializeBPFTargetMC()

func InitializeHexagonAsmParser

func InitializeHexagonAsmParser()

func InitializeHexagonAsmPrinter

func InitializeHexagonAsmPrinter()

func InitializeHexagonDisassembler

func InitializeHexagonDisassembler()

func InitializeHexagonTarget

func InitializeHexagonTarget()

func InitializeHexagonTargetInfo

func InitializeHexagonTargetInfo()

func InitializeHexagonTargetMC

func InitializeHexagonTargetMC()

func InitializeLanaiAsmParser

func InitializeLanaiAsmParser()

func InitializeLanaiAsmPrinter

func InitializeLanaiAsmPrinter()

func InitializeLanaiDisassembler

func InitializeLanaiDisassembler()

func InitializeLanaiTarget

func InitializeLanaiTarget()

func InitializeLanaiTargetInfo

func InitializeLanaiTargetInfo()

func InitializeLanaiTargetMC

func InitializeLanaiTargetMC()

func InitializeLoongArchAsmParser

func InitializeLoongArchAsmParser()

func InitializeLoongArchAsmPrinter

func InitializeLoongArchAsmPrinter()

func InitializeLoongArchDisassembler

func InitializeLoongArchDisassembler()

func InitializeLoongArchTarget

func InitializeLoongArchTarget()

func InitializeLoongArchTargetInfo

func InitializeLoongArchTargetInfo()

func InitializeLoongArchTargetMC

func InitializeLoongArchTargetMC()

func InitializeMSP430AsmParser

func InitializeMSP430AsmParser()

func InitializeMSP430AsmPrinter

func InitializeMSP430AsmPrinter()

func InitializeMSP430Disassembler

func InitializeMSP430Disassembler()

func InitializeMSP430Target

func InitializeMSP430Target()

func InitializeMSP430TargetInfo

func InitializeMSP430TargetInfo()

func InitializeMSP430TargetMC

func InitializeMSP430TargetMC()

func InitializeMipsAsmParser

func InitializeMipsAsmParser()

func InitializeMipsAsmPrinter

func InitializeMipsAsmPrinter()

func InitializeMipsDisassembler

func InitializeMipsDisassembler()

func InitializeMipsTarget

func InitializeMipsTarget()

func InitializeMipsTargetInfo

func InitializeMipsTargetInfo()

func InitializeMipsTargetMC

func InitializeMipsTargetMC()

func InitializeNVPTXAsmPrinter

func InitializeNVPTXAsmPrinter()

func InitializeNVPTXTarget

func InitializeNVPTXTarget()

func InitializeNVPTXTargetInfo

func InitializeNVPTXTargetInfo()

func InitializeNVPTXTargetMC

func InitializeNVPTXTargetMC()

func InitializePowerPCAsmParser

func InitializePowerPCAsmParser()

func InitializePowerPCAsmPrinter

func InitializePowerPCAsmPrinter()

func InitializePowerPCDisassembler

func InitializePowerPCDisassembler()

func InitializePowerPCTarget

func InitializePowerPCTarget()

func InitializePowerPCTargetInfo

func InitializePowerPCTargetInfo()

func InitializePowerPCTargetMC

func InitializePowerPCTargetMC()

func InitializeRISCVAsmParser

func InitializeRISCVAsmParser()

func InitializeRISCVAsmPrinter

func InitializeRISCVAsmPrinter()

func InitializeRISCVDisassembler

func InitializeRISCVDisassembler()

func InitializeRISCVTarget

func InitializeRISCVTarget()

func InitializeRISCVTargetInfo

func InitializeRISCVTargetInfo()

func InitializeRISCVTargetMC

func InitializeRISCVTargetMC()

func InitializeSPIRVAsmPrinter

func InitializeSPIRVAsmPrinter()

func InitializeSPIRVTarget

func InitializeSPIRVTarget()

func InitializeSPIRVTargetInfo

func InitializeSPIRVTargetInfo()

func InitializeSPIRVTargetMC

func InitializeSPIRVTargetMC()

func InitializeSparcAsmParser

func InitializeSparcAsmParser()

func InitializeSparcAsmPrinter

func InitializeSparcAsmPrinter()

func InitializeSparcDisassembler

func InitializeSparcDisassembler()

func InitializeSparcTarget

func InitializeSparcTarget()

func InitializeSparcTargetInfo

func InitializeSparcTargetInfo()

func InitializeSparcTargetMC

func InitializeSparcTargetMC()

func InitializeSystemZAsmParser

func InitializeSystemZAsmParser()

func InitializeSystemZAsmPrinter

func InitializeSystemZAsmPrinter()

func InitializeSystemZDisassembler

func InitializeSystemZDisassembler()

func InitializeSystemZTarget

func InitializeSystemZTarget()

func InitializeSystemZTargetInfo

func InitializeSystemZTargetInfo()

func InitializeSystemZTargetMC

func InitializeSystemZTargetMC()

func InitializeVEAsmParser

func InitializeVEAsmParser()

func InitializeVEAsmPrinter

func InitializeVEAsmPrinter()

func InitializeVEDisassembler

func InitializeVEDisassembler()

func InitializeVETarget

func InitializeVETarget()

func InitializeVETargetInfo

func InitializeVETargetInfo()

func InitializeVETargetMC

func InitializeVETargetMC()

func InitializeWebAssemblyAsmParser

func InitializeWebAssemblyAsmParser()

func InitializeWebAssemblyAsmPrinter

func InitializeWebAssemblyAsmPrinter()

func InitializeWebAssemblyDisassembler

func InitializeWebAssemblyDisassembler()

func InitializeWebAssemblyTarget

func InitializeWebAssemblyTarget()

func InitializeWebAssemblyTargetInfo

func InitializeWebAssemblyTargetInfo()

func InitializeWebAssemblyTargetMC

func InitializeWebAssemblyTargetMC()

func InitializeX86AsmParser

func InitializeX86AsmParser()

func InitializeX86AsmPrinter

func InitializeX86AsmPrinter()

func InitializeX86Disassembler

func InitializeX86Disassembler()

func InitializeX86Target

func InitializeX86Target()

func InitializeX86TargetInfo

func InitializeX86TargetInfo()

func InitializeX86TargetMC

func InitializeX86TargetMC()

func InitializeXCoreAsmPrinter

func InitializeXCoreAsmPrinter()

func InitializeXCoreDisassembler

func InitializeXCoreDisassembler()

func InitializeXCoreTarget

func InitializeXCoreTarget()

func InitializeXCoreTargetInfo

func InitializeXCoreTargetInfo()

func InitializeXCoreTargetMC

func InitializeXCoreTargetMC()

func InstallFatalErrorHandler

func InstallFatalErrorHandler(Handler FatalErrorHandler)

Install a fatal error handler. By default, if LLVM detects a fatal error, it will call exit(1). This may not be appropriate in many contexts. For example, doing exit(1) will bypass many crash reporting/tracing system tools. This function allows you to install a callback that will be invoked prior to the call to exit(1).

func IntrinsicCopyOverloadedName deprecated

func IntrinsicCopyOverloadedName(ID c.Uint, ParamTypes *TypeRef, ParamCount c.SizeT, NameLength *c.SizeT) *c.Char

Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.

func IntrinsicGetName

func IntrinsicGetName(ID c.Uint, NameLength *c.SizeT) *c.Char

Retrieves the name of an intrinsic.

@see llvm::Intrinsic::getName()

func LinkInInterpreter

func LinkInInterpreter()

Empty function used to force the linker to link the LLVM interpreter. Has no effect when called on a pre-built library (dylib interface).

func LinkInMCJIT

func LinkInMCJIT()

Empty function used to force the linker to link MCJIT. Has no effect when called on a pre-built library (dylib interface).

func LookupIntrinsicID

func LookupIntrinsicID(Name *c.Char, NameLen c.SizeT) c.Uint

Obtain the intrinsic ID number which matches the given function name.

@see llvm::Intrinsic::lookupIntrinsicID()

func LtoApiVersion

func LtoApiVersion() c.Uint

Returns the runtime API version.

\since LTO_API_VERSION=12

func LtoGetErrorMessage

func LtoGetErrorMessage() *c.Char

Returns the last error string or NULL if last operation was successful.

\since prior to LTO_API_VERSION=3

func LtoGetVersion

func LtoGetVersion() *c.Char

Returns a printable string.

\since prior to LTO_API_VERSION=3

func LtoInitializeDisassembler

func LtoInitializeDisassembler()

Initializes LLVM disassemblers. FIXME: This doesn't really belong here.

\since LTO_API_VERSION=5

func LtoRuntimeLibSymbolsList

func LtoRuntimeLibSymbolsList(size *c.SizeT) **c.Char

Returns the list of libcall symbols that can be generated by LTO that might not be visible from the symbol table of bitcode files.

\since prior to LTO_API_VERSION=25

func LtoSetDebugOptions

func LtoSetDebugOptions(options **c.Char, number c.Int)

Parses options immediately, making them available as early as possible. For example during executing codegen::InitTargetOptionsFromCodeGenFlags. Since parsing shud only happen once, only one of lto_codegen_debug_options or lto_set_debug_options should be called.

This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.

\since LTO_API_VERSION=28

func MetadataReplaceAllUsesWith

func MetadataReplaceAllUsesWith(TempTargetMetadata MetadataRef, Replacement MetadataRef)

Replace all uses of temporary metadata. \param TempTargetMetadata The temporary metadata node. \param Replacement The replacement metadata node.

func MoveBasicBlockAfter

func MoveBasicBlockAfter(BB BasicBlockRef, MovePos BasicBlockRef)

Move a basic block to after another one.

@see llvm::BasicBlock::moveAfter()

func MoveBasicBlockBefore

func MoveBasicBlockBefore(BB BasicBlockRef, MovePos BasicBlockRef)

Move a basic block to before another one.

@see llvm::BasicBlock::moveBefore()

func NormalizeTargetTriple

func NormalizeTargetTriple(triple *c.Char) *c.Char

Normalize a target triple. The result needs to be disposed with LLVMDisposeMessage.

func OrcDisposeSymbols added in v0.3.0

func OrcDisposeSymbols(Symbols *OrcSymbolStringPoolEntryRef)

Disposes of the passed LLVMOrcSymbolStringPoolEntryRef* .

Does not release the symbols themselves.

func OrcResourceTrackerTransferTo

func OrcResourceTrackerTransferTo(SrcRT OrcResourceTrackerRef, DstRT OrcResourceTrackerRef)

Transfers tracking of all resources associated with resource tracker SrcRT to resource tracker DstRT.

func ParseCommandLineOptions

func ParseCommandLineOptions(argc c.Int, argv **c.Char, Overview *c.Char)

This function parses the given arguments using the LLVM command line parser. Note that the only stable thing about this function is its signature; you cannot rely on any particular set of command line arguments being interpreted the same way across LLVM versions.

@see llvm::cl::ParseCommandLineOptions()

func RemarkVersion

func RemarkVersion() c.Uint32T

Returns the version of the remarks library.

\since REMARKS_API_VERSION=0

func ReplaceAllUsesWith

func ReplaceAllUsesWith(OldVal ValueRef, NewVal ValueRef)

Replace all uses of a value with another one.

@see llvm::Value::replaceAllUsesWith()

func ResetFatalErrorHandler

func ResetFatalErrorHandler()

Reset the fatal error handler. This resets LLVM's fatal error handling behavior to the default.

func SearchForAddressOfSymbol

func SearchForAddressOfSymbol(symbolName *c.Char) unsafe.Pointer

This function will search through all previously loaded dynamic libraries for the symbol \p symbolName. If it is found, the address of that symbol is returned. If not, null is returned.

@see sys::DynamicLibrary::SearchForAddressOfSymbol()

func SetCondition

func SetCondition(Branch ValueRef, Cond ValueRef)

Set the condition of a branch instruction.

This only works on llvm::BranchInst instructions.

@see llvm::BranchInst::setCondition

func SetGlobalIFuncResolver

func SetGlobalIFuncResolver(IFunc ValueRef, Resolver ValueRef)

Sets the resolver function associated with this indirect function.

@see llvm::GlobalIFunc::setResolver()

func SetInitializer

func SetInitializer(GlobalVar ValueRef, ConstantVal ValueRef)

func SetParentCatchSwitch

func SetParentCatchSwitch(CatchPad ValueRef, CatchSwitch ValueRef)

Set the parent catchswitch instruction of a catchpad instruction.

This only works on llvm::CatchPadInst instructions.

@see llvm::CatchPadInst::setCatchSwitch()

func SetPersonalityFn

func SetPersonalityFn(Fn ValueRef, PersonalityFn ValueRef)

Set the personality function attached to the function.

@see llvm::Function::setPersonalityFn()

func SetPrefixData

func SetPrefixData(Fn ValueRef, prefixData ValueRef)

Sets the prefix data for the function. Only valid on functions. See https://llvm.org/docs/LangRef.html#prefix-data

func SetPrologueData

func SetPrologueData(Fn ValueRef, prologueData ValueRef)

Sets the prologue data for the function. Only valid on functions. See https://llvm.org/docs/LangRef.html#prologue-data

func Shutdown

func Shutdown()

Deallocate and destroy all ManagedStatic variables. @see llvm::llvm_shutdown @see ManagedStatic

func StopMultithreaded deprecated

func StopMultithreaded()

Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THREADS.

func ThinltoDebugOptions

func ThinltoDebugOptions(options **c.Char, number c.Int)

Parse -mllvm style debug options.

\since LTO_API_VERSION=18

Types

type AtomicOrdering

type AtomicOrdering c.Uint
const (
	AtomicOrderingNotAtomic      AtomicOrdering = 0
	AtomicOrderingUnordered      AtomicOrdering = 1
	AtomicOrderingMonotonic      AtomicOrdering = 2
	AtomicOrderingAcquire        AtomicOrdering = 4
	AtomicOrderingRelease        AtomicOrdering = 5
	AtomicOrderingAcquireRelease AtomicOrdering = 6
	// < provides Acquire semantics
	// for loads and Release
	// semantics for stores.
	// Additionally, it guarantees
	// that a total ordering exists
	// between all
	// SequentiallyConsistent
	// operations.
	AtomicOrderingSequentiallyConsistent AtomicOrdering = 7
)

type AtomicRMWBinOp

type AtomicRMWBinOp c.Uint
const (
	AtomicRMWBinOpXchg     AtomicRMWBinOp = 0
	AtomicRMWBinOpAdd      AtomicRMWBinOp = 1
	AtomicRMWBinOpSub      AtomicRMWBinOp = 2
	AtomicRMWBinOpAnd      AtomicRMWBinOp = 3
	AtomicRMWBinOpNand     AtomicRMWBinOp = 4
	AtomicRMWBinOpOr       AtomicRMWBinOp = 5
	AtomicRMWBinOpXor      AtomicRMWBinOp = 6
	AtomicRMWBinOpMax      AtomicRMWBinOp = 7
	AtomicRMWBinOpMin      AtomicRMWBinOp = 8
	AtomicRMWBinOpUMax     AtomicRMWBinOp = 9
	AtomicRMWBinOpUMin     AtomicRMWBinOp = 10
	AtomicRMWBinOpFAdd     AtomicRMWBinOp = 11
	AtomicRMWBinOpFSub     AtomicRMWBinOp = 12
	AtomicRMWBinOpFMax     AtomicRMWBinOp = 13
	AtomicRMWBinOpFMin     AtomicRMWBinOp = 14
	AtomicRMWBinOpUIncWrap AtomicRMWBinOp = 15
	AtomicRMWBinOpUDecWrap AtomicRMWBinOp = 16
	AtomicRMWBinOpUSubCond AtomicRMWBinOp = 17
	AtomicRMWBinOpUSubSat  AtomicRMWBinOp = 18
	AtomicRMWBinOpFMaximum AtomicRMWBinOp = 19
	AtomicRMWBinOpFMinimum AtomicRMWBinOp = 20
)

type AttributeIndex

type AttributeIndex = c.Uint

type AttributeRef

type AttributeRef = *OpaqueAttributeRef

Used to represent an attributes.

@see llvm::Attribute

func (AttributeRef) EnumAttributeKind added in v0.3.0

func (self AttributeRef) EnumAttributeKind() c.Uint

Get the unique id corresponding to the enum attribute passed as argument.

llgo:link AttributeRef.EnumAttributeKind C.LLVMGetEnumAttributeKind

func (AttributeRef) EnumAttributeValue added in v0.3.0

func (self AttributeRef) EnumAttributeValue() c.Uint64T

Get the enum attribute's value. 0 is returned if none exists.

llgo:link AttributeRef.EnumAttributeValue C.LLVMGetEnumAttributeValue

func (AttributeRef) IsEnum added in v0.3.1

func (self AttributeRef) IsEnum() Bool

Check for the different types of attributes.

llgo:link AttributeRef.IsEnum C.LLVMIsEnumAttribute

func (AttributeRef) IsString added in v0.3.1

func (self AttributeRef) IsString() Bool

llgo:link AttributeRef.IsString C.LLVMIsStringAttribute

func (AttributeRef) IsType added in v0.3.1

func (self AttributeRef) IsType() Bool

llgo:link AttributeRef.IsType C.LLVMIsTypeAttribute

func (AttributeRef) StringAttributeKind added in v0.3.0

func (self AttributeRef) StringAttributeKind(Length *c.Uint) *c.Char

Get the string attribute's kind.

llgo:link AttributeRef.StringAttributeKind C.LLVMGetStringAttributeKind

func (AttributeRef) StringAttributeValue added in v0.3.0

func (self AttributeRef) StringAttributeValue(Length *c.Uint) *c.Char

Get the string attribute's value.

llgo:link AttributeRef.StringAttributeValue C.LLVMGetStringAttributeValue

func (AttributeRef) TypeAttributeValue added in v0.3.0

func (self AttributeRef) TypeAttributeValue() TypeRef

Get the type attribute's value.

llgo:link AttributeRef.TypeAttributeValue C.LLVMGetTypeAttributeValue

type BasicBlockRef

type BasicBlockRef = *OpaqueBasicBlock

Represents a basic block of instructions in LLVM IR.

This models llvm::BasicBlock.

func (BasicBlockRef) AsValue added in v0.3.1

func (self BasicBlockRef) AsValue() ValueRef

Convert a basic block instance to a value type.

llgo:link BasicBlockRef.AsValue C.LLVMBasicBlockAsValue

func (BasicBlockRef) Delete added in v0.3.1

func (self BasicBlockRef) Delete()

Remove a basic block from a function and delete it.

This deletes the basic block from its containing function and deletes the basic block itself.

@see llvm::BasicBlock::eraseFromParent()

llgo:link BasicBlockRef.Delete C.LLVMDeleteBasicBlock

func (BasicBlockRef) FirstInstruction added in v0.3.0

func (self BasicBlockRef) FirstInstruction() ValueRef

Obtain the first instruction in a basic block.

The returned LLVMValueRef corresponds to a llvm::Instruction instance.

llgo:link BasicBlockRef.FirstInstruction C.LLVMGetFirstInstruction

func (BasicBlockRef) Insert added in v0.3.1

func (self BasicBlockRef) Insert(Name *c.Char) BasicBlockRef

Insert a basic block in a function using the global context.

@see llvm::BasicBlock::Create()

llgo:link BasicBlockRef.Insert C.LLVMInsertBasicBlock

func (BasicBlockRef) LastInstruction added in v0.3.0

func (self BasicBlockRef) LastInstruction() ValueRef

Obtain the last instruction in a basic block.

The returned LLVMValueRef corresponds to an LLVM:Instruction.

llgo:link BasicBlockRef.LastInstruction C.LLVMGetLastInstruction

func (BasicBlockRef) Name added in v0.3.1

func (self BasicBlockRef) Name() *c.Char

Obtain the string name of a basic block.

llgo:link BasicBlockRef.Name C.LLVMGetBasicBlockName

func (BasicBlockRef) Next added in v0.3.1

func (self BasicBlockRef) Next() BasicBlockRef

Advance a basic block iterator.

llgo:link BasicBlockRef.Next C.LLVMGetNextBasicBlock

func (BasicBlockRef) Parent added in v0.3.1

func (self BasicBlockRef) Parent() ValueRef

Obtain the function to which a basic block belongs.

@see llvm::BasicBlock::getParent()

llgo:link BasicBlockRef.Parent C.LLVMGetBasicBlockParent

func (BasicBlockRef) Previous added in v0.3.1

func (self BasicBlockRef) Previous() BasicBlockRef

Go backwards in a basic block iterator.

llgo:link BasicBlockRef.Previous C.LLVMGetPreviousBasicBlock

func (BasicBlockRef) RemoveBasicBlockFromParent added in v0.3.0

func (self BasicBlockRef) RemoveBasicBlockFromParent()

Remove a basic block from a function.

This deletes the basic block from its containing function but keep the basic block alive.

@see llvm::BasicBlock::removeFromParent()

llgo:link BasicBlockRef.RemoveBasicBlockFromParent C.LLVMRemoveBasicBlockFromParent

func (BasicBlockRef) Terminator added in v0.3.1

func (self BasicBlockRef) Terminator() ValueRef

Obtain the terminator instruction for a basic block.

If the basic block does not have a terminator (it is not well-formed if it doesn't), then NULL is returned.

The returned LLVMValueRef corresponds to an llvm::Instruction.

@see llvm::BasicBlock::getTerminator()

llgo:link BasicBlockRef.Terminator C.LLVMGetBasicBlockTerminator

type BinaryRef

type BinaryRef = *OpaqueBinary

@see llvm::object::Binary

func (BinaryRef) CopyMemoryBuffer added in v0.3.1

func (self BinaryRef) CopyMemoryBuffer() MemoryBufferRef

Retrieves a copy of the memory buffer associated with this object file.

The returned buffer is merely a shallow copy and does not own the actual backing buffer of the binary. Nevertheless, it is the responsibility of the caller to free it with \c LLVMDisposeMemoryBuffer.

@see llvm::object::getMemoryBufferRef

llgo:link BinaryRef.CopyMemoryBuffer C.LLVMBinaryCopyMemoryBuffer

func (BinaryRef) Dispose added in v0.3.1

func (self BinaryRef) Dispose()

Dispose of a binary file.

The binary file does not own its backing buffer. It is the responsibility of the caller to free it with \c LLVMDisposeMemoryBuffer.

llgo:link BinaryRef.Dispose C.LLVMDisposeBinary

func (BinaryRef) MachOUniversalBinaryCopyObjectForArch added in v0.3.0

func (self BinaryRef) MachOUniversalBinaryCopyObjectForArch(Arch *c.Char, ArchLen c.SizeT, ErrorMessage **c.Char) BinaryRef

For a Mach-O universal binary file, retrieves the object file corresponding to the given architecture if it is present as a slice.

If NULL is returned, the \p ErrorMessage parameter is populated with the error's description. It is then the caller's responsibility to free this message by calling \c LLVMDisposeMessage.

It is the responsiblity of the caller to free the returned object file by calling \c LLVMDisposeBinary.

llgo:link BinaryRef.MachOUniversalBinaryCopyObjectForArch C.LLVMMachOUniversalBinaryCopyObjectForArch

func (BinaryRef) ObjectFileCopySectionIterator added in v0.3.0

func (self BinaryRef) ObjectFileCopySectionIterator() SectionIteratorRef

Retrieve a copy of the section iterator for this object file.

If there are no sections, the result is NULL.

The returned iterator is merely a shallow copy. Nevertheless, it is the responsibility of the caller to free it with \c LLVMDisposeSectionIterator.

@see llvm::object::sections()

llgo:link BinaryRef.ObjectFileCopySectionIterator C.LLVMObjectFileCopySectionIterator

func (BinaryRef) ObjectFileCopySymbolIterator added in v0.3.0

func (self BinaryRef) ObjectFileCopySymbolIterator() SymbolIteratorRef

Retrieve a copy of the symbol iterator for this object file.

If there are no symbols, the result is NULL.

The returned iterator is merely a shallow copy. Nevertheless, it is the responsibility of the caller to free it with \c LLVMDisposeSymbolIterator.

@see llvm::object::symbols()

llgo:link BinaryRef.ObjectFileCopySymbolIterator C.LLVMObjectFileCopySymbolIterator

func (BinaryRef) ObjectFileIsSectionIteratorAtEnd added in v0.3.0

func (self BinaryRef) ObjectFileIsSectionIteratorAtEnd(SI SectionIteratorRef) Bool

Returns whether the given section iterator is at the end.

@see llvm::object::section_end

llgo:link BinaryRef.ObjectFileIsSectionIteratorAtEnd C.LLVMObjectFileIsSectionIteratorAtEnd

func (BinaryRef) ObjectFileIsSymbolIteratorAtEnd added in v0.3.0

func (self BinaryRef) ObjectFileIsSymbolIteratorAtEnd(SI SymbolIteratorRef) Bool

Returns whether the given symbol iterator is at the end.

@see llvm::object::symbol_end

llgo:link BinaryRef.ObjectFileIsSymbolIteratorAtEnd C.LLVMObjectFileIsSymbolIteratorAtEnd

func (BinaryRef) Type added in v0.3.1

func (self BinaryRef) Type() BinaryType

Retrieve the specific type of a binary.

@see llvm::object::Binary::getType

llgo:link BinaryRef.Type C.LLVMBinaryGetType

type BinaryType

type BinaryType c.Uint
const (
	BinaryTypeArchive              BinaryType = 0
	BinaryTypeMachOUniversalBinary BinaryType = 1
	BinaryTypeCOFFImportFile       BinaryType = 2
	BinaryTypeIR                   BinaryType = 3
	BinaryTypeWinRes               BinaryType = 4
	BinaryTypeCOFF                 BinaryType = 5
	BinaryTypeELF32L               BinaryType = 6
	BinaryTypeELF32B               BinaryType = 7
	BinaryTypeELF64L               BinaryType = 8
	BinaryTypeELF64B               BinaryType = 9
	BinaryTypeMachO32L             BinaryType = 10
	BinaryTypeMachO32B             BinaryType = 11
	BinaryTypeMachO64L             BinaryType = 12
	BinaryTypeMachO64B             BinaryType = 13
	BinaryTypeWasm                 BinaryType = 14
	BinaryTypeOffload              BinaryType = 15
	BinaryTypeDXcontainer          BinaryType = 16
)

type Blake3ChunkState added in v0.3.2

type Blake3ChunkState struct {
	Cv               [8]c.Uint32T
	ChunkCounter     c.Uint64T
	Buf              [64]c.Uint8T
	BufLen           c.Uint8T
	BlocksCompressed c.Uint8T
	Flags            c.Uint8T
}

This struct is a private implementation detail. It has to be here because it's part of llvm_blake3_hasher below.

type Blake3Hasher added in v0.3.2

type Blake3Hasher struct {
	Key        [8]c.Uint32T
	Chunk      Blake3ChunkState
	CvStackLen c.Uint8T
	CvStack    [1760]c.Uint8T
}

func (*Blake3Hasher) Finalize added in v0.3.2

func (self *Blake3Hasher) Finalize(out *c.Uint8T, out_len c.SizeT)

llgo:link (*Blake3Hasher).Finalize C.llvm_blake3_hasher_finalize

func (*Blake3Hasher) FinalizeSeek added in v0.3.2

func (self *Blake3Hasher) FinalizeSeek(seek c.Uint64T, out *c.Uint8T, out_len c.SizeT)

llgo:link (*Blake3Hasher).FinalizeSeek C.llvm_blake3_hasher_finalize_seek

func (*Blake3Hasher) Init added in v0.3.2

func (self *Blake3Hasher) Init()

llgo:link (*Blake3Hasher).Init C.llvm_blake3_hasher_init

func (*Blake3Hasher) InitDeriveKey added in v0.3.2

func (self *Blake3Hasher) InitDeriveKey(context *c.Char)

llgo:link (*Blake3Hasher).InitDeriveKey C.llvm_blake3_hasher_init_derive_key

func (*Blake3Hasher) InitDeriveKeyRaw added in v0.3.2

func (self *Blake3Hasher) InitDeriveKeyRaw(context unsafe.Pointer, context_len c.SizeT)

llgo:link (*Blake3Hasher).InitDeriveKeyRaw C.llvm_blake3_hasher_init_derive_key_raw

func (*Blake3Hasher) InitKeyed added in v0.3.2

func (self *Blake3Hasher) InitKeyed(key *c.Uint8T)

llgo:link (*Blake3Hasher).InitKeyed C.llvm_blake3_hasher_init_keyed

func (*Blake3Hasher) Reset added in v0.3.2

func (self *Blake3Hasher) Reset()

llgo:link (*Blake3Hasher).Reset C.llvm_blake3_hasher_reset

func (*Blake3Hasher) Update added in v0.3.2

func (self *Blake3Hasher) Update(input unsafe.Pointer, input_len c.SizeT)

llgo:link (*Blake3Hasher).Update C.llvm_blake3_hasher_update

type Bool

type Bool = c.Int

func CreateExecutionEngineForModule added in v0.3.0

func CreateExecutionEngineForModule(OutEE *ExecutionEngineRef, M ModuleRef, OutError **c.Char) Bool

func CreateInterpreterForModule added in v0.3.0

func CreateInterpreterForModule(OutInterp *ExecutionEngineRef, M ModuleRef, OutError **c.Char) Bool

func CreateJITCompilerForModule added in v0.3.0

func CreateJITCompilerForModule(OutJIT *ExecutionEngineRef, M ModuleRef, OptLevel c.Uint, OutError **c.Char) Bool

func CreateMCJITCompilerForModule added in v0.3.0

func CreateMCJITCompilerForModule(OutJIT *ExecutionEngineRef, M ModuleRef, Options *MCJITCompilerOptions, SizeOfOptions c.SizeT, OutError **c.Char) Bool

Create an MCJIT execution engine for a module, with the given options. It is the responsibility of the caller to ensure that all fields in Options up to the given SizeOfOptions are initialized. It is correct to pass a smaller value of SizeOfOptions that omits some fields. The canonical way of using this is:

LLVMMCJITCompilerOptions options; LLVMInitializeMCJITCompilerOptions(&options, sizeof(options)); ... fill in those options you care about LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options),

&error);

Note that this is also correct, though possibly suboptimal:

LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);

func CreateMemoryBufferWithContentsOfFile

func CreateMemoryBufferWithContentsOfFile(Path *c.Char, OutMemBuf *MemoryBufferRef, OutMessage **c.Char) Bool

func CreateMemoryBufferWithSTDIN added in v0.3.0

func CreateMemoryBufferWithSTDIN(OutMemBuf *MemoryBufferRef, OutMessage **c.Char) Bool

func GetTargetFromTriple

func GetTargetFromTriple(Triple *c.Char, T *TargetRef, ErrorMessage **c.Char) Bool

Finds the target corresponding to the given triple and stores it in \p T. Returns 0 on success. Optionally returns any error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.

func IntrinsicIsOverloaded

func IntrinsicIsOverloaded(ID c.Uint) Bool

Obtain if the intrinsic identified by the given ID is overloaded.

@see llvm::Intrinsic::isOverloaded()

func IsMultithreaded

func IsMultithreaded() Bool

Check whether LLVM is executing in thread-safe mode or not. @see llvm::llvm_is_multithreaded

func LinkModules2

func LinkModules2(Dest ModuleRef, Src ModuleRef) Bool

Links the source module into the destination module. The source module is destroyed. The return value is true if an error occurred, false otherwise. Use the diagnostic handler to get any diagnostic message.

func LoadLibraryPermanently

func LoadLibraryPermanently(Filename *c.Char) Bool

This function permanently loads the dynamic library at the given path. It is safe to call this function multiple times for the same library.

@see sys::DynamicLibrary::LoadLibraryPermanently()

func StartMultithreaded deprecated

func StartMultithreaded() Bool

Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THREADS. This function always returns LLVMIsMultithreaded().

type BuilderRef

type BuilderRef = *OpaqueBuilder

Represents an LLVM basic block builder.

This models llvm::IRBuilder.

func CreateBuilder

func CreateBuilder() BuilderRef

Set the builder position before Instr but after any attached debug records, or if Instr is null set the position to the end of Block.

func (BuilderRef) AddMetadataToInst added in v0.3.0

func (self BuilderRef) AddMetadataToInst(Inst ValueRef)

Adds the metadata registered with the given builder to the given instruction.

@see llvm::IRBuilder::AddMetadataToInst()

llgo:link BuilderRef.AddMetadataToInst C.LLVMAddMetadataToInst

func (BuilderRef) BuildAShr added in v0.3.0

func (self BuilderRef) BuildAShr(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildAShr C.LLVMBuildAShr

func (BuilderRef) BuildAdd added in v0.3.0

func (self BuilderRef) BuildAdd(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

Arithmetic

llgo:link BuilderRef.BuildAdd C.LLVMBuildAdd

func (BuilderRef) BuildAddrSpaceCast added in v0.3.0

func (self BuilderRef) BuildAddrSpaceCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildAddrSpaceCast C.LLVMBuildAddrSpaceCast

func (BuilderRef) BuildAggregateRet added in v0.3.0

func (self BuilderRef) BuildAggregateRet(RetVals *ValueRef, N c.Uint) ValueRef

llgo:link BuilderRef.BuildAggregateRet C.LLVMBuildAggregateRet

func (BuilderRef) BuildAlloca added in v0.3.0

func (self BuilderRef) BuildAlloca(Ty TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildAlloca C.LLVMBuildAlloca

func (BuilderRef) BuildAnd added in v0.3.0

func (self BuilderRef) BuildAnd(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildAnd C.LLVMBuildAnd

func (BuilderRef) BuildArrayAlloca added in v0.3.0

func (self BuilderRef) BuildArrayAlloca(Ty TypeRef, Val ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildArrayAlloca C.LLVMBuildArrayAlloca

func (BuilderRef) BuildArrayMalloc added in v0.3.0

func (self BuilderRef) BuildArrayMalloc(Ty TypeRef, Val ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildArrayMalloc C.LLVMBuildArrayMalloc

func (BuilderRef) BuildAtomicCmpXchg added in v0.3.0

func (self BuilderRef) BuildAtomicCmpXchg(Ptr ValueRef, Cmp ValueRef, New ValueRef, SuccessOrdering AtomicOrdering, FailureOrdering AtomicOrdering, SingleThread Bool) ValueRef

llgo:link BuilderRef.BuildAtomicCmpXchg C.LLVMBuildAtomicCmpXchg

func (BuilderRef) BuildAtomicCmpXchgSyncScope added in v0.3.0

func (self BuilderRef) BuildAtomicCmpXchgSyncScope(Ptr ValueRef, Cmp ValueRef, New ValueRef, SuccessOrdering AtomicOrdering, FailureOrdering AtomicOrdering, SSID c.Uint) ValueRef

llgo:link BuilderRef.BuildAtomicCmpXchgSyncScope C.LLVMBuildAtomicCmpXchgSyncScope

func (BuilderRef) BuildAtomicRMW added in v0.3.0

func (self BuilderRef) BuildAtomicRMW(op AtomicRMWBinOp, PTR ValueRef, Val ValueRef, ordering AtomicOrdering, singleThread Bool) ValueRef

llgo:link BuilderRef.BuildAtomicRMW C.LLVMBuildAtomicRMW

func (BuilderRef) BuildAtomicRMWSyncScope added in v0.3.0

func (self BuilderRef) BuildAtomicRMWSyncScope(op AtomicRMWBinOp, PTR ValueRef, Val ValueRef, ordering AtomicOrdering, SSID c.Uint) ValueRef

llgo:link BuilderRef.BuildAtomicRMWSyncScope C.LLVMBuildAtomicRMWSyncScope

func (BuilderRef) BuildBinOp added in v0.3.0

func (self BuilderRef) BuildBinOp(Op Opcode, LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildBinOp C.LLVMBuildBinOp

func (BuilderRef) BuildBitCast added in v0.3.0

func (self BuilderRef) BuildBitCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildBitCast C.LLVMBuildBitCast

func (BuilderRef) BuildBr added in v0.3.0

func (self BuilderRef) BuildBr(Dest BasicBlockRef) ValueRef

llgo:link BuilderRef.BuildBr C.LLVMBuildBr

func (BuilderRef) BuildCall2 added in v0.3.0

func (self BuilderRef) BuildCall2(_llcppg_param2 TypeRef, Fn ValueRef, Args *ValueRef, NumArgs c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCall2 C.LLVMBuildCall2

func (BuilderRef) BuildCallBr added in v0.3.0

func (self BuilderRef) BuildCallBr(Ty TypeRef, Fn ValueRef, DefaultDest BasicBlockRef, IndirectDests *BasicBlockRef, NumIndirectDests c.Uint, Args *ValueRef, NumArgs c.Uint, Bundles *OperandBundleRef, NumBundles c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCallBr C.LLVMBuildCallBr

func (BuilderRef) BuildCallWithOperandBundles added in v0.3.0

func (self BuilderRef) BuildCallWithOperandBundles(_llcppg_param2 TypeRef, Fn ValueRef, Args *ValueRef, NumArgs c.Uint, Bundles *OperandBundleRef, NumBundles c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCallWithOperandBundles C.LLVMBuildCallWithOperandBundles

func (BuilderRef) BuildCast added in v0.3.0

func (self BuilderRef) BuildCast(Op Opcode, Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCast C.LLVMBuildCast

func (BuilderRef) BuildCatchPad added in v0.3.0

func (self BuilderRef) BuildCatchPad(ParentPad ValueRef, Args *ValueRef, NumArgs c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCatchPad C.LLVMBuildCatchPad

func (BuilderRef) BuildCatchRet added in v0.3.0

func (self BuilderRef) BuildCatchRet(CatchPad ValueRef, BB BasicBlockRef) ValueRef

llgo:link BuilderRef.BuildCatchRet C.LLVMBuildCatchRet

func (BuilderRef) BuildCatchSwitch added in v0.3.0

func (self BuilderRef) BuildCatchSwitch(ParentPad ValueRef, UnwindBB BasicBlockRef, NumHandlers c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCatchSwitch C.LLVMBuildCatchSwitch

func (BuilderRef) BuildCleanupPad added in v0.3.0

func (self BuilderRef) BuildCleanupPad(ParentPad ValueRef, Args *ValueRef, NumArgs c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildCleanupPad C.LLVMBuildCleanupPad

func (BuilderRef) BuildCleanupRet added in v0.3.0

func (self BuilderRef) BuildCleanupRet(CatchPad ValueRef, BB BasicBlockRef) ValueRef

llgo:link BuilderRef.BuildCleanupRet C.LLVMBuildCleanupRet

func (BuilderRef) BuildCondBr added in v0.3.0

func (self BuilderRef) BuildCondBr(If ValueRef, Then BasicBlockRef, Else BasicBlockRef) ValueRef

llgo:link BuilderRef.BuildCondBr C.LLVMBuildCondBr

func (BuilderRef) BuildExactSDiv added in v0.3.0

func (self BuilderRef) BuildExactSDiv(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildExactSDiv C.LLVMBuildExactSDiv

func (BuilderRef) BuildExactUDiv added in v0.3.0

func (self BuilderRef) BuildExactUDiv(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildExactUDiv C.LLVMBuildExactUDiv

func (BuilderRef) BuildExtractElement added in v0.3.0

func (self BuilderRef) BuildExtractElement(VecVal ValueRef, Index ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildExtractElement C.LLVMBuildExtractElement

func (BuilderRef) BuildExtractValue added in v0.3.0

func (self BuilderRef) BuildExtractValue(AggVal ValueRef, Index c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildExtractValue C.LLVMBuildExtractValue

func (BuilderRef) BuildFAdd added in v0.3.0

func (self BuilderRef) BuildFAdd(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFAdd C.LLVMBuildFAdd

func (BuilderRef) BuildFCmp added in v0.3.0

func (self BuilderRef) BuildFCmp(Op RealPredicate, LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFCmp C.LLVMBuildFCmp

func (BuilderRef) BuildFDiv added in v0.3.0

func (self BuilderRef) BuildFDiv(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFDiv C.LLVMBuildFDiv

func (BuilderRef) BuildFMul added in v0.3.0

func (self BuilderRef) BuildFMul(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFMul C.LLVMBuildFMul

func (BuilderRef) BuildFNeg added in v0.3.0

func (self BuilderRef) BuildFNeg(V ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFNeg C.LLVMBuildFNeg

func (BuilderRef) BuildFPCast added in v0.3.0

func (self BuilderRef) BuildFPCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFPCast C.LLVMBuildFPCast

func (BuilderRef) BuildFPExt added in v0.3.0

func (self BuilderRef) BuildFPExt(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFPExt C.LLVMBuildFPExt

func (BuilderRef) BuildFPToSI added in v0.3.0

func (self BuilderRef) BuildFPToSI(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFPToSI C.LLVMBuildFPToSI

func (BuilderRef) BuildFPToUI added in v0.3.0

func (self BuilderRef) BuildFPToUI(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFPToUI C.LLVMBuildFPToUI

func (BuilderRef) BuildFPTrunc added in v0.3.0

func (self BuilderRef) BuildFPTrunc(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFPTrunc C.LLVMBuildFPTrunc

func (BuilderRef) BuildFRem added in v0.3.0

func (self BuilderRef) BuildFRem(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFRem C.LLVMBuildFRem

func (BuilderRef) BuildFSub added in v0.3.0

func (self BuilderRef) BuildFSub(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFSub C.LLVMBuildFSub

func (BuilderRef) BuildFence added in v0.3.0

func (self BuilderRef) BuildFence(ordering AtomicOrdering, singleThread Bool, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFence C.LLVMBuildFence

func (BuilderRef) BuildFenceSyncScope added in v0.3.0

func (self BuilderRef) BuildFenceSyncScope(ordering AtomicOrdering, SSID c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFenceSyncScope C.LLVMBuildFenceSyncScope

func (BuilderRef) BuildFree added in v0.3.0

func (self BuilderRef) BuildFree(PointerVal ValueRef) ValueRef

llgo:link BuilderRef.BuildFree C.LLVMBuildFree

func (BuilderRef) BuildFreeze added in v0.3.0

func (self BuilderRef) BuildFreeze(Val ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildFreeze C.LLVMBuildFreeze

func (BuilderRef) BuildGEP2 added in v0.3.0

func (self BuilderRef) BuildGEP2(Ty TypeRef, Pointer ValueRef, Indices *ValueRef, NumIndices c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildGEP2 C.LLVMBuildGEP2

func (BuilderRef) BuildGEPWithNoWrapFlags added in v0.3.0

func (self BuilderRef) BuildGEPWithNoWrapFlags(Ty TypeRef, Pointer ValueRef, Indices *ValueRef, NumIndices c.Uint, Name *c.Char, NoWrapFlags GEPNoWrapFlags) ValueRef

Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows specifying the no-wrap flags.

@see llvm::IRBuilder::CreateGEP()

llgo:link BuilderRef.BuildGEPWithNoWrapFlags C.LLVMBuildGEPWithNoWrapFlags

func (BuilderRef) BuildGlobalString deprecated added in v0.3.0

func (self BuilderRef) BuildGlobalString(Str *c.Char, Name *c.Char) ValueRef

Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.

llgo:link BuilderRef.BuildGlobalString C.LLVMBuildGlobalString

func (BuilderRef) BuildGlobalStringPtr deprecated added in v0.3.0

func (self BuilderRef) BuildGlobalStringPtr(Str *c.Char, Name *c.Char) ValueRef

Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.

llgo:link BuilderRef.BuildGlobalStringPtr C.LLVMBuildGlobalStringPtr

func (BuilderRef) BuildICmp added in v0.3.0

func (self BuilderRef) BuildICmp(Op IntPredicate, LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

Comparisons

llgo:link BuilderRef.BuildICmp C.LLVMBuildICmp

func (BuilderRef) BuildInBoundsGEP2 added in v0.3.0

func (self BuilderRef) BuildInBoundsGEP2(Ty TypeRef, Pointer ValueRef, Indices *ValueRef, NumIndices c.Uint, Name *c.Char) ValueRef

Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows specifying the no-wrap flags.

@see llvm::IRBuilder::CreateGEP()

llgo:link BuilderRef.BuildInBoundsGEP2 C.LLVMBuildInBoundsGEP2

func (BuilderRef) BuildIndirectBr added in v0.3.0

func (self BuilderRef) BuildIndirectBr(Addr ValueRef, NumDests c.Uint) ValueRef

llgo:link BuilderRef.BuildIndirectBr C.LLVMBuildIndirectBr

func (BuilderRef) BuildInsertElement added in v0.3.0

func (self BuilderRef) BuildInsertElement(VecVal ValueRef, EltVal ValueRef, Index ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildInsertElement C.LLVMBuildInsertElement

func (BuilderRef) BuildInsertValue added in v0.3.0

func (self BuilderRef) BuildInsertValue(AggVal ValueRef, EltVal ValueRef, Index c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildInsertValue C.LLVMBuildInsertValue

func (BuilderRef) BuildIntCast deprecated added in v0.3.0

func (self BuilderRef) BuildIntCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead.

llgo:link BuilderRef.BuildIntCast C.LLVMBuildIntCast

func (BuilderRef) BuildIntCast2 added in v0.3.0

func (self BuilderRef) BuildIntCast2(Val ValueRef, DestTy TypeRef, IsSigned Bool, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildIntCast2 C.LLVMBuildIntCast2

func (BuilderRef) BuildIntToPtr added in v0.3.0

func (self BuilderRef) BuildIntToPtr(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildIntToPtr C.LLVMBuildIntToPtr

func (BuilderRef) BuildInvoke2 added in v0.3.0

func (self BuilderRef) BuildInvoke2(Ty TypeRef, Fn ValueRef, Args *ValueRef, NumArgs c.Uint, Then BasicBlockRef, Catch BasicBlockRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildInvoke2 C.LLVMBuildInvoke2

func (BuilderRef) BuildInvokeWithOperandBundles added in v0.3.0

func (self BuilderRef) BuildInvokeWithOperandBundles(Ty TypeRef, Fn ValueRef, Args *ValueRef, NumArgs c.Uint, Then BasicBlockRef, Catch BasicBlockRef, Bundles *OperandBundleRef, NumBundles c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildInvokeWithOperandBundles C.LLVMBuildInvokeWithOperandBundles

func (BuilderRef) BuildIsNotNull added in v0.3.0

func (self BuilderRef) BuildIsNotNull(Val ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildIsNotNull C.LLVMBuildIsNotNull

func (BuilderRef) BuildIsNull added in v0.3.0

func (self BuilderRef) BuildIsNull(Val ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildIsNull C.LLVMBuildIsNull

func (BuilderRef) BuildLShr added in v0.3.0

func (self BuilderRef) BuildLShr(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildLShr C.LLVMBuildLShr

func (BuilderRef) BuildLandingPad added in v0.3.0

func (self BuilderRef) BuildLandingPad(Ty TypeRef, PersFn ValueRef, NumClauses c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildLandingPad C.LLVMBuildLandingPad

func (BuilderRef) BuildLoad2 added in v0.3.0

func (self BuilderRef) BuildLoad2(Ty TypeRef, PointerVal ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildLoad2 C.LLVMBuildLoad2

func (BuilderRef) BuildMalloc added in v0.3.0

func (self BuilderRef) BuildMalloc(Ty TypeRef, Name *c.Char) ValueRef

Memory

llgo:link BuilderRef.BuildMalloc C.LLVMBuildMalloc

func (BuilderRef) BuildMemCpy added in v0.3.0

func (self BuilderRef) BuildMemCpy(Dst ValueRef, DstAlign c.Uint, Src ValueRef, SrcAlign c.Uint, Size ValueRef) ValueRef

Creates and inserts a memcpy between the specified pointers.

@see llvm::IRRBuilder::CreateMemCpy()

llgo:link BuilderRef.BuildMemCpy C.LLVMBuildMemCpy

func (BuilderRef) BuildMemMove added in v0.3.0

func (self BuilderRef) BuildMemMove(Dst ValueRef, DstAlign c.Uint, Src ValueRef, SrcAlign c.Uint, Size ValueRef) ValueRef

Creates and inserts a memmove between the specified pointers.

@see llvm::IRRBuilder::CreateMemMove()

llgo:link BuilderRef.BuildMemMove C.LLVMBuildMemMove

func (BuilderRef) BuildMemSet added in v0.3.0

func (self BuilderRef) BuildMemSet(Ptr ValueRef, Val ValueRef, Len ValueRef, Align c.Uint) ValueRef

Creates and inserts a memset to the specified pointer and the specified value.

@see llvm::IRRBuilder::CreateMemSet()

llgo:link BuilderRef.BuildMemSet C.LLVMBuildMemSet

func (BuilderRef) BuildMul added in v0.3.0

func (self BuilderRef) BuildMul(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildMul C.LLVMBuildMul

func (BuilderRef) BuildNSWAdd added in v0.3.0

func (self BuilderRef) BuildNSWAdd(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNSWAdd C.LLVMBuildNSWAdd

func (BuilderRef) BuildNSWMul added in v0.3.0

func (self BuilderRef) BuildNSWMul(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNSWMul C.LLVMBuildNSWMul

func (BuilderRef) BuildNSWNeg added in v0.3.0

func (self BuilderRef) BuildNSWNeg(V ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNSWNeg C.LLVMBuildNSWNeg

func (BuilderRef) BuildNSWSub added in v0.3.0

func (self BuilderRef) BuildNSWSub(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNSWSub C.LLVMBuildNSWSub

func (BuilderRef) BuildNUWAdd added in v0.3.0

func (self BuilderRef) BuildNUWAdd(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNUWAdd C.LLVMBuildNUWAdd

func (BuilderRef) BuildNUWMul added in v0.3.0

func (self BuilderRef) BuildNUWMul(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNUWMul C.LLVMBuildNUWMul

func (BuilderRef) BuildNUWNeg added in v0.3.0

func (self BuilderRef) BuildNUWNeg(V ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNUWNeg C.LLVMBuildNUWNeg

func (BuilderRef) BuildNUWSub added in v0.3.0

func (self BuilderRef) BuildNUWSub(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNUWSub C.LLVMBuildNUWSub

func (BuilderRef) BuildNeg added in v0.3.0

func (self BuilderRef) BuildNeg(V ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNeg C.LLVMBuildNeg

func (BuilderRef) BuildNot added in v0.3.0

func (self BuilderRef) BuildNot(V ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildNot C.LLVMBuildNot

func (BuilderRef) BuildOr added in v0.3.0

func (self BuilderRef) BuildOr(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildOr C.LLVMBuildOr

func (BuilderRef) BuildPhi added in v0.3.0

func (self BuilderRef) BuildPhi(Ty TypeRef, Name *c.Char) ValueRef

Miscellaneous instructions

llgo:link BuilderRef.BuildPhi C.LLVMBuildPhi

func (BuilderRef) BuildPointerCast added in v0.3.0

func (self BuilderRef) BuildPointerCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildPointerCast C.LLVMBuildPointerCast

func (BuilderRef) BuildPtrDiff2 added in v0.3.0

func (self BuilderRef) BuildPtrDiff2(ElemTy TypeRef, LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildPtrDiff2 C.LLVMBuildPtrDiff2

func (BuilderRef) BuildPtrToInt added in v0.3.0

func (self BuilderRef) BuildPtrToInt(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildPtrToInt C.LLVMBuildPtrToInt

func (BuilderRef) BuildResume added in v0.3.0

func (self BuilderRef) BuildResume(Exn ValueRef) ValueRef

Exception Handling

llgo:link BuilderRef.BuildResume C.LLVMBuildResume

func (BuilderRef) BuildRet added in v0.3.0

func (self BuilderRef) BuildRet(V ValueRef) ValueRef

llgo:link BuilderRef.BuildRet C.LLVMBuildRet

func (BuilderRef) BuildRetVoid added in v0.3.0

func (self BuilderRef) BuildRetVoid() ValueRef

Terminators

llgo:link BuilderRef.BuildRetVoid C.LLVMBuildRetVoid

func (BuilderRef) BuildSDiv added in v0.3.0

func (self BuilderRef) BuildSDiv(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSDiv C.LLVMBuildSDiv

func (BuilderRef) BuildSExt added in v0.3.0

func (self BuilderRef) BuildSExt(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSExt C.LLVMBuildSExt

func (BuilderRef) BuildSExtOrBitCast added in v0.3.0

func (self BuilderRef) BuildSExtOrBitCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSExtOrBitCast C.LLVMBuildSExtOrBitCast

func (BuilderRef) BuildSIToFP added in v0.3.0

func (self BuilderRef) BuildSIToFP(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSIToFP C.LLVMBuildSIToFP

func (BuilderRef) BuildSRem added in v0.3.0

func (self BuilderRef) BuildSRem(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSRem C.LLVMBuildSRem

func (BuilderRef) BuildSelect added in v0.3.0

func (self BuilderRef) BuildSelect(If ValueRef, Then ValueRef, Else ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSelect C.LLVMBuildSelect

func (BuilderRef) BuildShl added in v0.3.0

func (self BuilderRef) BuildShl(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildShl C.LLVMBuildShl

func (BuilderRef) BuildShuffleVector added in v0.3.0

func (self BuilderRef) BuildShuffleVector(V1 ValueRef, V2 ValueRef, Mask ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildShuffleVector C.LLVMBuildShuffleVector

func (BuilderRef) BuildStore added in v0.3.0

func (self BuilderRef) BuildStore(Val ValueRef, Ptr ValueRef) ValueRef

llgo:link BuilderRef.BuildStore C.LLVMBuildStore

func (BuilderRef) BuildStructGEP2 added in v0.3.0

func (self BuilderRef) BuildStructGEP2(Ty TypeRef, Pointer ValueRef, Idx c.Uint, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildStructGEP2 C.LLVMBuildStructGEP2

func (BuilderRef) BuildSub added in v0.3.0

func (self BuilderRef) BuildSub(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildSub C.LLVMBuildSub

func (BuilderRef) BuildSwitch added in v0.3.0

func (self BuilderRef) BuildSwitch(V ValueRef, Else BasicBlockRef, NumCases c.Uint) ValueRef

llgo:link BuilderRef.BuildSwitch C.LLVMBuildSwitch

func (BuilderRef) BuildTrunc added in v0.3.0

func (self BuilderRef) BuildTrunc(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

Casts

llgo:link BuilderRef.BuildTrunc C.LLVMBuildTrunc

func (BuilderRef) BuildTruncOrBitCast added in v0.3.0

func (self BuilderRef) BuildTruncOrBitCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildTruncOrBitCast C.LLVMBuildTruncOrBitCast

func (BuilderRef) BuildUDiv added in v0.3.0

func (self BuilderRef) BuildUDiv(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildUDiv C.LLVMBuildUDiv

func (BuilderRef) BuildUIToFP added in v0.3.0

func (self BuilderRef) BuildUIToFP(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildUIToFP C.LLVMBuildUIToFP

func (BuilderRef) BuildURem added in v0.3.0

func (self BuilderRef) BuildURem(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildURem C.LLVMBuildURem

func (BuilderRef) BuildUnreachable added in v0.3.0

func (self BuilderRef) BuildUnreachable() ValueRef

llgo:link BuilderRef.BuildUnreachable C.LLVMBuildUnreachable

func (BuilderRef) BuildVAArg added in v0.3.0

func (self BuilderRef) BuildVAArg(List ValueRef, Ty TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildVAArg C.LLVMBuildVAArg

func (BuilderRef) BuildXor added in v0.3.0

func (self BuilderRef) BuildXor(LHS ValueRef, RHS ValueRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildXor C.LLVMBuildXor

func (BuilderRef) BuildZExt added in v0.3.0

func (self BuilderRef) BuildZExt(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildZExt C.LLVMBuildZExt

func (BuilderRef) BuildZExtOrBitCast added in v0.3.0

func (self BuilderRef) BuildZExtOrBitCast(Val ValueRef, DestTy TypeRef, Name *c.Char) ValueRef

llgo:link BuilderRef.BuildZExtOrBitCast C.LLVMBuildZExtOrBitCast

func (BuilderRef) ClearInsertionPosition added in v0.3.0

func (self BuilderRef) ClearInsertionPosition()

llgo:link BuilderRef.ClearInsertionPosition C.LLVMClearInsertionPosition

func (BuilderRef) Context added in v0.3.1

func (self BuilderRef) Context() ContextRef

Obtain the context to which this builder is associated.

@see llvm::IRBuilder::getContext()

llgo:link BuilderRef.Context C.LLVMGetBuilderContext

func (BuilderRef) CurrentDebugLocation deprecated added in v0.3.0

func (self BuilderRef) CurrentDebugLocation() ValueRef

Deprecated: Returning the NULL location will crash. Use LLVMGetCurrentDebugLocation2 instead.

llgo:link BuilderRef.CurrentDebugLocation C.LLVMGetCurrentDebugLocation

func (BuilderRef) CurrentDebugLocation2 added in v0.3.0

func (self BuilderRef) CurrentDebugLocation2() MetadataRef

Get location information used by debugging information.

@see llvm::IRBuilder::getCurrentDebugLocation()

llgo:link BuilderRef.CurrentDebugLocation2 C.LLVMGetCurrentDebugLocation2

func (BuilderRef) DefaultFPMathTag added in v0.3.1

func (self BuilderRef) DefaultFPMathTag() MetadataRef

Get the dafult floating-point math metadata for a given builder.

@see llvm::IRBuilder::getDefaultFPMathTag()

llgo:link BuilderRef.DefaultFPMathTag C.LLVMBuilderGetDefaultFPMathTag

func (BuilderRef) Dispose added in v0.3.1

func (self BuilderRef) Dispose()

llgo:link BuilderRef.Dispose C.LLVMDisposeBuilder

func (BuilderRef) InsertBlock added in v0.3.0

func (self BuilderRef) InsertBlock() BasicBlockRef

llgo:link BuilderRef.InsertBlock C.LLVMGetInsertBlock

func (BuilderRef) InsertExistingBasicBlockAfterInsertBlock added in v0.3.0

func (self BuilderRef) InsertExistingBasicBlockAfterInsertBlock(BB BasicBlockRef)

Insert the given basic block after the insertion point of the given builder.

The insertion point must be valid.

@see llvm::Function::BasicBlockListType::insertAfter()

llgo:link BuilderRef.InsertExistingBasicBlockAfterInsertBlock C.LLVMInsertExistingBasicBlockAfterInsertBlock

func (BuilderRef) InsertInto added in v0.3.1

func (self BuilderRef) InsertInto(Instr ValueRef)

llgo:link BuilderRef.InsertInto C.LLVMInsertIntoBuilder

func (BuilderRef) InsertIntoBuilderWithName added in v0.3.0

func (self BuilderRef) InsertIntoBuilderWithName(Instr ValueRef, Name *c.Char)

llgo:link BuilderRef.InsertIntoBuilderWithName C.LLVMInsertIntoBuilderWithName

func (BuilderRef) Position added in v0.3.1

func (self BuilderRef) Position(Block BasicBlockRef, Instr ValueRef)

Set the builder position before Instr but after any attached debug records, or if Instr is null set the position to the end of Block.

llgo:link BuilderRef.Position C.LLVMPositionBuilder

func (BuilderRef) PositionBuilderAtEnd added in v0.3.0

func (self BuilderRef) PositionBuilderAtEnd(Block BasicBlockRef)

llgo:link BuilderRef.PositionBuilderAtEnd C.LLVMPositionBuilderAtEnd

func (BuilderRef) PositionBuilderBefore added in v0.3.0

func (self BuilderRef) PositionBuilderBefore(Instr ValueRef)

Set the builder position before Instr but after any attached debug records.

llgo:link BuilderRef.PositionBuilderBefore C.LLVMPositionBuilderBefore

func (BuilderRef) PositionBuilderBeforeDbgRecords added in v0.3.0

func (self BuilderRef) PositionBuilderBeforeDbgRecords(Block BasicBlockRef, Inst ValueRef)

Set the builder position before Instr and any attached debug records, or if Instr is null set the position to the end of Block.

llgo:link BuilderRef.PositionBuilderBeforeDbgRecords C.LLVMPositionBuilderBeforeDbgRecords

func (BuilderRef) PositionBuilderBeforeInstrAndDbgRecords added in v0.3.0

func (self BuilderRef) PositionBuilderBeforeInstrAndDbgRecords(Instr ValueRef)

Set the builder position before Instr and any attached debug records.

llgo:link BuilderRef.PositionBuilderBeforeInstrAndDbgRecords C.LLVMPositionBuilderBeforeInstrAndDbgRecords

func (BuilderRef) SetCurrentDebugLocation deprecated added in v0.3.0

func (self BuilderRef) SetCurrentDebugLocation(L ValueRef)

Deprecated: Passing the NULL location will crash. Use LLVMGetCurrentDebugLocation2 instead.

llgo:link BuilderRef.SetCurrentDebugLocation C.LLVMSetCurrentDebugLocation

func (BuilderRef) SetCurrentDebugLocation2 added in v0.3.0

func (self BuilderRef) SetCurrentDebugLocation2(Loc MetadataRef)

Set location information used by debugging information.

To clear the location metadata of the given instruction, pass NULL to \p Loc.

@see llvm::IRBuilder::SetCurrentDebugLocation()

llgo:link BuilderRef.SetCurrentDebugLocation2 C.LLVMSetCurrentDebugLocation2

func (BuilderRef) SetDefaultFPMathTag added in v0.3.1

func (self BuilderRef) SetDefaultFPMathTag(FPMathTag MetadataRef)

Set the default floating-point math metadata for the given builder.

To clear the metadata, pass NULL to \p FPMathTag.

@see llvm::IRBuilder::setDefaultFPMathTag()

llgo:link BuilderRef.SetDefaultFPMathTag C.LLVMBuilderSetDefaultFPMathTag

func (BuilderRef) SetInstDebugLocation added in v0.3.0

func (self BuilderRef) SetInstDebugLocation(Inst ValueRef)

Attempts to set the debug location for the given instruction using the current debug location for the given builder. If the builder has no current debug location, this function is a no-op.

@deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general

LLVMAddMetadataToInst.

@see llvm::IRBuilder::SetInstDebugLocation()

llgo:link BuilderRef.SetInstDebugLocation C.LLVMSetInstDebugLocation

type ByteOrdering

type ByteOrdering c.Uint
const (
	BigEndian    ByteOrdering = 0
	LittleEndian ByteOrdering = 1
)

type CallConv

type CallConv c.Uint
const (
	CCallConv             CallConv = 0
	FastCallConv          CallConv = 8
	ColdCallConv          CallConv = 9
	GHCCallConv           CallConv = 10
	HiPECallConv          CallConv = 11
	AnyRegCallConv        CallConv = 13
	PreserveMostCallConv  CallConv = 14
	PreserveAllCallConv   CallConv = 15
	SwiftCallConv         CallConv = 16
	CXXFASTTLSCallConv    CallConv = 17
	X86StdcallCallConv    CallConv = 64
	X86FastcallCallConv   CallConv = 65
	ARMAPCSCallConv       CallConv = 66
	ARMAAPCSCallConv      CallConv = 67
	ARMAAPCSVFPCallConv   CallConv = 68
	MSP430INTRCallConv    CallConv = 69
	X86ThisCallCallConv   CallConv = 70
	PTXKernelCallConv     CallConv = 71
	PTXDeviceCallConv     CallConv = 72
	SPIRFUNCCallConv      CallConv = 75
	SPIRKERNELCallConv    CallConv = 76
	IntelOCLBICallConv    CallConv = 77
	X8664SysVCallConv     CallConv = 78
	Win64CallConv         CallConv = 79
	X86VectorCallCallConv CallConv = 80
	HHVMCallConv          CallConv = 81
	HHVMCCallConv         CallConv = 82
	X86INTRCallConv       CallConv = 83
	AVRINTRCallConv       CallConv = 84
	AVRSIGNALCallConv     CallConv = 85
	AVRBUILTINCallConv    CallConv = 86
	AMDGPUVSCallConv      CallConv = 87
	AMDGPUGSCallConv      CallConv = 88
	AMDGPUPSCallConv      CallConv = 89
	AMDGPUCSCallConv      CallConv = 90
	AMDGPUKERNELCallConv  CallConv = 91
	X86RegCallCallConv    CallConv = 92
	AMDGPUHSCallConv      CallConv = 93
	MSP430BUILTINCallConv CallConv = 94
	AMDGPULSCallConv      CallConv = 95
	AMDGPUESCallConv      CallConv = 96
)

type ChecksumKind

type ChecksumKind c.Uint

The kind of checksum to emit.

const (
	// The kind of checksum to emit.
	CSK_MD5 ChecksumKind = 0
	// The kind of checksum to emit.
	CSK_SHA1 ChecksumKind = 1
	// The kind of checksum to emit.
	CSK_SHA256 ChecksumKind = 2
)

type CodeGenFileType

type CodeGenFileType c.Uint
const (
	AssemblyFile CodeGenFileType = 0
	ObjectFile   CodeGenFileType = 1
)

type CodeGenOptLevel

type CodeGenOptLevel c.Uint
const (
	CodeGenLevelNone       CodeGenOptLevel = 0
	CodeGenLevelLess       CodeGenOptLevel = 1
	CodeGenLevelDefault    CodeGenOptLevel = 2
	CodeGenLevelAggressive CodeGenOptLevel = 3
)

type CodeModel

type CodeModel c.Uint
const (
	CodeModelDefault    CodeModel = 0
	CodeModelJITDefault CodeModel = 1
	CodeModelTiny       CodeModel = 2
	CodeModelSmall      CodeModel = 3
	CodeModelKernel     CodeModel = 4
	CodeModelMedium     CodeModel = 5
	CodeModelLarge      CodeModel = 6
)

type Comdat

type Comdat struct {
}

type ComdatRef

type ComdatRef = *Comdat

@see llvm::Comdat

func (ComdatRef) SelectionKind added in v0.3.1

func (self ComdatRef) SelectionKind() ComdatSelectionKind

Get the conflict resolution selection kind for the Comdat.

@see llvm::Comdat::getSelectionKind()

llgo:link ComdatRef.SelectionKind C.LLVMGetComdatSelectionKind

func (ComdatRef) SetComdatSelectionKind added in v0.3.0

func (self ComdatRef) SetComdatSelectionKind(Kind ComdatSelectionKind)

Set the conflict resolution selection kind for the Comdat.

@see llvm::Comdat::setSelectionKind()

llgo:link ComdatRef.SetComdatSelectionKind C.LLVMSetComdatSelectionKind

type ComdatSelectionKind

type ComdatSelectionKind c.Uint
const (
	AnyComdatSelectionKind        ComdatSelectionKind = 0
	ExactMatchComdatSelectionKind ComdatSelectionKind = 1
	// < be the same.
	LargestComdatSelectionKind ComdatSelectionKind = 2
	// < COMDAT.
	NoDeduplicateComdatSelectionKind ComdatSelectionKind = 3
	// < The data referenced by the COMDAT must be
	// < the same size.
	SameSizeComdatSelectionKind ComdatSelectionKind = 4
)

type ContextRef

type ContextRef = *OpaqueContext

The top-level container for all LLVM global data. See the LLVMContext class.

func ContextCreate

func ContextCreate() ContextRef

Create a new context.

Every call to this function should be paired with a call to LLVMContextDispose() or the context will leak memory.

func GetGlobalContext

func GetGlobalContext() ContextRef

Obtain the global context instance.

func (ContextRef) AppendBasicBlock added in v0.3.1

func (self ContextRef) AppendBasicBlock(Fn ValueRef, Name *c.Char) BasicBlockRef

Append a basic block to the end of a function.

@see llvm::BasicBlock::Create()

llgo:link ContextRef.AppendBasicBlock C.LLVMAppendBasicBlockInContext

func (ContextRef) BFloatType added in v0.3.1

func (self ContextRef) BFloatType() TypeRef

Obtain a 16-bit brain floating point type from a context.

llgo:link ContextRef.BFloatType C.LLVMBFloatTypeInContext

func (ContextRef) BitcodeModule added in v0.3.1

func (self ContextRef) BitcodeModule(MemBuf MemoryBufferRef, OutM *ModuleRef, OutMessage **c.Char) Bool

Reads a module from the specified path, returning via the OutMP parameter a module provider which performs lazy deserialization. Returns 0 on success. Optionally returns a human-readable error message via OutMessage. This is deprecated. Use LLVMGetBitcodeModuleInContext2.

llgo:link ContextRef.BitcodeModule C.LLVMGetBitcodeModuleInContext

func (ContextRef) BitcodeModuleInContext2 added in v0.3.0

func (self ContextRef) BitcodeModuleInContext2(MemBuf MemoryBufferRef, OutM *ModuleRef) Bool

Reads a module from the given memory buffer, returning via the OutMP parameter a module provider which performs lazy deserialization.

Returns 0 on success.

Takes ownership of \p MemBuf if (and only if) the module was read successfully.

llgo:link ContextRef.BitcodeModuleInContext2 C.LLVMGetBitcodeModuleInContext2

func (ContextRef) ConstString added in v0.3.1

func (self ContextRef) ConstString(Str *c.Char, Length c.Uint, DontNullTerminate Bool) ValueRef

Create a ConstantDataSequential and initialize it with a string.

@deprecated LLVMConstStringInContext is deprecated in favor of the API accurate LLVMConstStringInContext2 @see llvm::ConstantDataArray::getString()

llgo:link ContextRef.ConstString C.LLVMConstStringInContext

func (ContextRef) ConstStringInContext2 added in v0.3.0

func (self ContextRef) ConstStringInContext2(Str *c.Char, Length c.SizeT, DontNullTerminate Bool) ValueRef

Create a ConstantDataSequential and initialize it with a string.

@see llvm::ConstantDataArray::getString()

llgo:link ContextRef.ConstStringInContext2 C.LLVMConstStringInContext2

func (ContextRef) ConstStruct added in v0.3.1

func (self ContextRef) ConstStruct(ConstantVals *ValueRef, Count c.Uint, Packed Bool) ValueRef

Create an anonymous ConstantStruct with the specified values.

@see llvm::ConstantStruct::getAnon()

llgo:link ContextRef.ConstStruct C.LLVMConstStructInContext

func (ContextRef) CreateBasicBlock added in v0.3.1

func (self ContextRef) CreateBasicBlock(Name *c.Char) BasicBlockRef

Create a new basic block without inserting it into a function.

@see llvm::BasicBlock::Create()

llgo:link ContextRef.CreateBasicBlock C.LLVMCreateBasicBlockInContext

func (ContextRef) CreateBuilder added in v0.3.1

func (self ContextRef) CreateBuilder() BuilderRef

llgo:link ContextRef.CreateBuilder C.LLVMCreateBuilderInContext

func (ContextRef) CreateConstantRangeAttribute added in v0.3.0

func (self ContextRef) CreateConstantRangeAttribute(KindID c.Uint, NumBits c.Uint, LowerWords *c.Uint64T, UpperWords *c.Uint64T) AttributeRef

Create a ConstantRange attribute.

LowerWords and UpperWords need to be NumBits divided by 64 rounded up elements long.

llgo:link ContextRef.CreateConstantRangeAttribute C.LLVMCreateConstantRangeAttribute

func (ContextRef) CreateEnumAttribute added in v0.3.0

func (self ContextRef) CreateEnumAttribute(KindID c.Uint, Val c.Uint64T) AttributeRef

Create an enum attribute.

llgo:link ContextRef.CreateEnumAttribute C.LLVMCreateEnumAttribute

func (ContextRef) CreateStringAttribute added in v0.3.0

func (self ContextRef) CreateStringAttribute(K *c.Char, KLength c.Uint, V *c.Char, VLength c.Uint) AttributeRef

Create a string attribute.

llgo:link ContextRef.CreateStringAttribute C.LLVMCreateStringAttribute

func (ContextRef) CreateTypeAttribute added in v0.3.0

func (self ContextRef) CreateTypeAttribute(KindID c.Uint, type_ref TypeRef) AttributeRef

Create a type attribute

llgo:link ContextRef.CreateTypeAttribute C.LLVMCreateTypeAttribute

func (ContextRef) DIBuilderCreateDebugLocation added in v0.3.0

func (self ContextRef) DIBuilderCreateDebugLocation(Line c.Uint, Column c.Uint, Scope MetadataRef, InlinedAt MetadataRef) MetadataRef

Creates a new DebugLocation that describes a source location. \param Line The line in the source file. \param Column The column in the source file. \param Scope The scope in which the location resides. \param InlinedAt The scope where this location was inlined, if at all.

(optional).

\note If the item to which this location is attached cannot be

attributed to a source line, pass 0 for the line and column.

llgo:link ContextRef.DIBuilderCreateDebugLocation C.LLVMDIBuilderCreateDebugLocation

func (ContextRef) Diagnostic added in v0.3.1

func (self ContextRef) Diagnostic() unsafe.Pointer

Get the diagnostic context of this context.

llgo:link ContextRef.Diagnostic C.LLVMContextGetDiagnosticContext

func (ContextRef) DiagnosticHandler added in v0.3.1

func (self ContextRef) DiagnosticHandler() DiagnosticHandler

Get the diagnostic handler of this context.

llgo:link ContextRef.DiagnosticHandler C.LLVMContextGetDiagnosticHandler

func (ContextRef) Dispose added in v0.3.1

func (self ContextRef) Dispose()

Destroy a context instance.

This should be called for every call to LLVMContextCreate() or memory will be leaked.

llgo:link ContextRef.Dispose C.LLVMContextDispose

func (ContextRef) DoubleType added in v0.3.1

func (self ContextRef) DoubleType() TypeRef

Obtain a 64-bit floating point type from a context.

llgo:link ContextRef.DoubleType C.LLVMDoubleTypeInContext

func (ContextRef) FP128Type added in v0.3.1

func (self ContextRef) FP128Type() TypeRef

Obtain a 128-bit floating point type (112-bit mantissa) from a context.

llgo:link ContextRef.FP128Type C.LLVMFP128TypeInContext

func (ContextRef) FloatType added in v0.3.1

func (self ContextRef) FloatType() TypeRef

Obtain a 32-bit floating point type from a context.

llgo:link ContextRef.FloatType C.LLVMFloatTypeInContext

func (ContextRef) HalfType added in v0.3.1

func (self ContextRef) HalfType() TypeRef

Obtain a 16-bit floating point type from a context.

llgo:link ContextRef.HalfType C.LLVMHalfTypeInContext

func (ContextRef) InsertBasicBlock added in v0.3.1

func (self ContextRef) InsertBasicBlock(BB BasicBlockRef, Name *c.Char) BasicBlockRef

Insert a basic block in a function before another basic block.

The function to add to is determined by the function of the passed basic block.

@see llvm::BasicBlock::Create()

llgo:link ContextRef.InsertBasicBlock C.LLVMInsertBasicBlockInContext

func (ContextRef) Int1Type added in v0.3.1

func (self ContextRef) Int1Type() TypeRef

Obtain an integer type from a context with specified bit width.

llgo:link ContextRef.Int1Type C.LLVMInt1TypeInContext

func (ContextRef) Int8Type added in v0.3.1

func (self ContextRef) Int8Type() TypeRef

llgo:link ContextRef.Int8Type C.LLVMInt8TypeInContext

func (ContextRef) Int16Type added in v0.3.1

func (self ContextRef) Int16Type() TypeRef

llgo:link ContextRef.Int16Type C.LLVMInt16TypeInContext

func (ContextRef) Int32Type added in v0.3.1

func (self ContextRef) Int32Type() TypeRef

llgo:link ContextRef.Int32Type C.LLVMInt32TypeInContext

func (ContextRef) Int64Type added in v0.3.1

func (self ContextRef) Int64Type() TypeRef

llgo:link ContextRef.Int64Type C.LLVMInt64TypeInContext

func (ContextRef) Int128Type added in v0.3.1

func (self ContextRef) Int128Type() TypeRef

llgo:link ContextRef.Int128Type C.LLVMInt128TypeInContext

func (ContextRef) IntPtrType added in v0.3.1

func (self ContextRef) IntPtrType(TD TargetDataRef) TypeRef

Returns the integer type that is the same size as a pointer on a target. See the method llvm::DataLayout::getIntPtrType.

llgo:link ContextRef.IntPtrType C.LLVMIntPtrTypeInContext

func (ContextRef) IntPtrTypeForAS added in v0.3.1

func (self ContextRef) IntPtrTypeForAS(TD TargetDataRef, AS c.Uint) TypeRef

Returns the integer type that is the same size as a pointer on a target. This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType.

llgo:link ContextRef.IntPtrTypeForAS C.LLVMIntPtrTypeForASInContext

func (ContextRef) IntType added in v0.3.1

func (self ContextRef) IntType(NumBits c.Uint) TypeRef

llgo:link ContextRef.IntType C.LLVMIntTypeInContext

func (ContextRef) IntrinsicGetType added in v0.3.0

func (self ContextRef) IntrinsicGetType(ID c.Uint, ParamTypes *TypeRef, ParamCount c.SizeT) TypeRef

Retrieves the type of an intrinsic. For overloaded intrinsics, parameter types must be provided to uniquely identify an overload.

@see llvm::Intrinsic::getType()

llgo:link ContextRef.IntrinsicGetType C.LLVMIntrinsicGetType

func (ContextRef) LabelType added in v0.3.1

func (self ContextRef) LabelType() TypeRef

Create a label type in a context.

llgo:link ContextRef.LabelType C.LLVMLabelTypeInContext

func (ContextRef) MDKindID added in v0.3.1

func (self ContextRef) MDKindID(Name *c.Char, SLen c.Uint) c.Uint

llgo:link ContextRef.MDKindID C.LLVMGetMDKindIDInContext

func (ContextRef) MDNode deprecated added in v0.3.1

func (self ContextRef) MDNode(Vals *ValueRef, Count c.Uint) ValueRef

Deprecated: Use LLVMMDNodeInContext2 instead.

llgo:link ContextRef.MDNode C.LLVMMDNodeInContext

func (ContextRef) MDNodeInContext2 added in v0.3.0

func (self ContextRef) MDNodeInContext2(MDs *MetadataRef, Count c.SizeT) MetadataRef

Create an MDNode value with the given array of operands.

@see llvm::MDNode::get()

llgo:link ContextRef.MDNodeInContext2 C.LLVMMDNodeInContext2

func (ContextRef) MDString deprecated added in v0.3.1

func (self ContextRef) MDString(Str *c.Char, SLen c.Uint) ValueRef

Deprecated: Use LLVMMDStringInContext2 instead.

llgo:link ContextRef.MDString C.LLVMMDStringInContext

func (ContextRef) MDStringInContext2 added in v0.3.0

func (self ContextRef) MDStringInContext2(Str *c.Char, SLen c.SizeT) MetadataRef

Create an MDString value from a given string value.

The MDString value does not take ownership of the given string, it remains the responsibility of the caller to free it.

@see llvm::MDString::get()

llgo:link ContextRef.MDStringInContext2 C.LLVMMDStringInContext2

func (ContextRef) MetadataAsValue added in v0.3.0

func (self ContextRef) MetadataAsValue(MD MetadataRef) ValueRef

Obtain a Metadata as a Value.

llgo:link ContextRef.MetadataAsValue C.LLVMMetadataAsValue

func (ContextRef) MetadataType added in v0.3.1

func (self ContextRef) MetadataType() TypeRef

Create a metadata type in a context.

llgo:link ContextRef.MetadataType C.LLVMMetadataTypeInContext

func (ContextRef) OrcCreateNewThreadSafeContext added in v0.3.1

func (self ContextRef) OrcCreateNewThreadSafeContext() OrcThreadSafeContextRef

Create a ThreadSafeContextRef from a given LLVMContext, which must not be associated with any existing ThreadSafeContext.

The underlying ThreadSafeContext will take ownership of the LLVMContext object, so clients should not free the LLVMContext passed to this function.

Ownership of the underlying ThreadSafeContext data is shared: Clients can and should dispose of their ThreadSafeContextRef as soon as they no longer need to refer to it directly. Other references (e.g. from ThreadSafeModules) will keep the underlying data alive as long as it is needed.

llgo:link ContextRef.OrcCreateNewThreadSafeContext C.LLVMOrcCreateNewThreadSafeContextFromLLVMContext

func (ContextRef) PPCFP128Type added in v0.3.1

func (self ContextRef) PPCFP128Type() TypeRef

Obtain a 128-bit floating point type (two 64-bits) from a context.

llgo:link ContextRef.PPCFP128Type C.LLVMPPCFP128TypeInContext

func (ContextRef) ParseBitcode added in v0.3.1

func (self ContextRef) ParseBitcode(MemBuf MemoryBufferRef, OutModule *ModuleRef, OutMessage **c.Char) Bool

This is deprecated. Use LLVMParseBitcodeInContext2.

llgo:link ContextRef.ParseBitcode C.LLVMParseBitcodeInContext

func (ContextRef) ParseBitcode2 added in v0.3.1

func (self ContextRef) ParseBitcode2(MemBuf MemoryBufferRef, OutModule *ModuleRef) Bool

llgo:link ContextRef.ParseBitcode2 C.LLVMParseBitcodeInContext2

func (ContextRef) ParseIR added in v0.3.1

func (self ContextRef) ParseIR(MemBuf MemoryBufferRef, OutM *ModuleRef, OutMessage **c.Char) Bool

Read LLVM IR from a memory buffer and convert it into an in-memory Module object. Returns 0 on success. Optionally returns a human-readable description of any errors that occurred during parsing IR. OutMessage must be disposed with LLVMDisposeMessage. The memory buffer is consumed by this function. This is deprecated. Use LLVMParseIRInContext2 instead.

@see llvm::ParseIR()

llgo:link ContextRef.ParseIR C.LLVMParseIRInContext

func (ContextRef) ParseIR2 added in v0.3.1

func (self ContextRef) ParseIR2(MemBuf MemoryBufferRef, OutM *ModuleRef, OutMessage **c.Char) Bool

Read LLVM IR from a memory buffer and convert it into an in-memory Module object. Returns 0 on success. Optionally returns a human-readable description of any errors that occurred during parsing IR. OutMessage must be disposed with LLVMDisposeMessage. The memory buffer is not consumed by this function. It is the responsibility of the caller to free it with \c LLVMDisposeMemoryBuffer.

@see llvm::ParseIR()

llgo:link ContextRef.ParseIR2 C.LLVMParseIRInContext2

func (ContextRef) PointerType added in v0.3.1

func (self ContextRef) PointerType(AddressSpace c.Uint) TypeRef

Create an opaque pointer type in a context.

@see llvm::PointerType::get()

llgo:link ContextRef.PointerType C.LLVMPointerTypeInContext

func (ContextRef) SetDiagnosticHandler added in v0.3.1

func (self ContextRef) SetDiagnosticHandler(Handler DiagnosticHandler, DiagnosticContext unsafe.Pointer)

Set the diagnostic handler for this context.

llgo:link ContextRef.SetDiagnosticHandler C.LLVMContextSetDiagnosticHandler

func (ContextRef) SetDiscardValueNames added in v0.3.1

func (self ContextRef) SetDiscardValueNames(Discard Bool)

Set whether the given context discards all value names.

If true, only the names of GlobalValue objects will be available in the IR. This can be used to save memory and runtime, especially in release mode.

@see LLVMContext::setDiscardValueNames()

llgo:link ContextRef.SetDiscardValueNames C.LLVMContextSetDiscardValueNames

func (ContextRef) SetYieldCallback added in v0.3.1

func (self ContextRef) SetYieldCallback(Callback YieldCallback, OpaqueHandle unsafe.Pointer)

Set the yield callback function for this context.

@see LLVMContext::setYieldCallback()

llgo:link ContextRef.SetYieldCallback C.LLVMContextSetYieldCallback

func (ContextRef) ShouldDiscardValueNames added in v0.3.1

func (self ContextRef) ShouldDiscardValueNames() Bool

Retrieve whether the given context is set to discard all value names.

@see LLVMContext::shouldDiscardValueNames()

llgo:link ContextRef.ShouldDiscardValueNames C.LLVMContextShouldDiscardValueNames

func (ContextRef) StructCreateNamed added in v0.3.0

func (self ContextRef) StructCreateNamed(Name *c.Char) TypeRef

Create an empty structure in a context having a specified name.

@see llvm::StructType::create()

llgo:link ContextRef.StructCreateNamed C.LLVMStructCreateNamed

func (ContextRef) StructType added in v0.3.1

func (self ContextRef) StructType(ElementTypes *TypeRef, ElementCount c.Uint, Packed Bool) TypeRef

Create a new structure type in a context.

A structure is specified by a list of inner elements/types and whether these can be packed together.

@see llvm::StructType::create()

llgo:link ContextRef.StructType C.LLVMStructTypeInContext

func (ContextRef) SyncScopeID added in v0.3.0

func (self ContextRef) SyncScopeID(Name *c.Char, SLen c.SizeT) c.Uint

Maps a synchronization scope name to a ID unique within this context.

llgo:link ContextRef.SyncScopeID C.LLVMGetSyncScopeID

func (ContextRef) TargetExtType added in v0.3.1

func (self ContextRef) TargetExtType(Name *c.Char, TypeParams *TypeRef, TypeParamCount c.Uint, IntParams *c.Uint, IntParamCount c.Uint) TypeRef

Create a target extension type in LLVM context.

llgo:link ContextRef.TargetExtType C.LLVMTargetExtTypeInContext

func (ContextRef) TemporaryMDNode added in v0.3.0

func (self ContextRef) TemporaryMDNode(Data *MetadataRef, NumElements c.SizeT) MetadataRef

Create a new temporary \c MDNode. Suitable for use in constructing cyclic \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd, and must be manually deleted with \c LLVMDisposeTemporaryMDNode. \param Ctx The context in which to construct the temporary node. \param Data The metadata elements. \param NumElements Number of metadata elements.

llgo:link ContextRef.TemporaryMDNode C.LLVMTemporaryMDNode

func (ContextRef) TokenType added in v0.3.1

func (self ContextRef) TokenType() TypeRef

Create a token type in a context.

llgo:link ContextRef.TokenType C.LLVMTokenTypeInContext

func (ContextRef) TypeByName2 added in v0.3.0

func (self ContextRef) TypeByName2(Name *c.Char) TypeRef

Obtain a Type from a context by its registered name.

llgo:link ContextRef.TypeByName2 C.LLVMGetTypeByName2

func (ContextRef) VoidType added in v0.3.1

func (self ContextRef) VoidType() TypeRef

Create a void type in a context.

llgo:link ContextRef.VoidType C.LLVMVoidTypeInContext

func (ContextRef) X86AMXType added in v0.3.1

func (self ContextRef) X86AMXType() TypeRef

Create a X86 AMX type in a context.

llgo:link ContextRef.X86AMXType C.LLVMX86AMXTypeInContext

func (ContextRef) X86FP80Type added in v0.3.1

func (self ContextRef) X86FP80Type() TypeRef

Obtain a 80-bit floating point type (X87) from a context.

llgo:link ContextRef.X86FP80Type C.LLVMX86FP80TypeInContext

type DIBuilderRef

type DIBuilderRef = *OpaqueDIBuilder

Represents an LLVM debug info builder.

This models llvm::DIBuilder.

func (DIBuilderRef) CreateArrayType added in v0.3.1

func (self DIBuilderRef) CreateArrayType(Size c.Uint64T, AlignInBits c.Uint32T, Ty MetadataRef, Subscripts *MetadataRef, NumSubscripts c.Uint) MetadataRef

Create debugging information entry for an array. \param Builder The DIBuilder. \param Size Array size. \param AlignInBits Alignment. \param Ty Element type. \param Subscripts Subscripts. \param NumSubscripts Number of subscripts.

llgo:link DIBuilderRef.CreateArrayType C.LLVMDIBuilderCreateArrayType

func (DIBuilderRef) CreateArtificialType added in v0.3.1

func (self DIBuilderRef) CreateArtificialType(Type MetadataRef) MetadataRef

Create a uniqued DIType* clone with FlagArtificial set. \param Builder The DIBuilder. \param Type The underlying type.

llgo:link DIBuilderRef.CreateArtificialType C.LLVMDIBuilderCreateArtificialType

func (DIBuilderRef) CreateAutoVariable added in v0.3.1

func (self DIBuilderRef) CreateAutoVariable(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, Ty MetadataRef, AlwaysPreserve Bool, Flags DIFlags, AlignInBits c.Uint32T) MetadataRef

Create a new descriptor for a local auto variable. \param Builder The DIBuilder. \param Scope The local scope the variable is declared in. \param Name Variable name. \param NameLen Length of variable name. \param File File where this variable is defined. \param LineNo Line number. \param Ty Metadata describing the type of the variable. \param AlwaysPreserve If true, this descriptor will survive optimizations. \param Flags Flags. \param AlignInBits Variable alignment.

llgo:link DIBuilderRef.CreateAutoVariable C.LLVMDIBuilderCreateAutoVariable

func (DIBuilderRef) CreateBasicType added in v0.3.1

func (self DIBuilderRef) CreateBasicType(Name *c.Char, NameLen c.SizeT, SizeInBits c.Uint64T, Encoding DWARFTypeEncoding, Flags DIFlags) MetadataRef

Create debugging information entry for a basic type. \param Builder The DIBuilder. \param Name Type name. \param NameLen Length of type name. \param SizeInBits Size of the type. \param Encoding DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float. \param Flags Flags to encode optional attribute like endianity

llgo:link DIBuilderRef.CreateBasicType C.LLVMDIBuilderCreateBasicType

func (DIBuilderRef) CreateBitFieldMemberType added in v0.3.1

func (self DIBuilderRef) CreateBitFieldMemberType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, OffsetInBits c.Uint64T, StorageOffsetInBits c.Uint64T, Flags DIFlags, Type MetadataRef) MetadataRef

Create debugging information entry for a bit field member. \param Builder The DIBuilder. \param Scope Member scope. \param Name Member name. \param NameLen Length of member name. \param File File where this member is defined. \param LineNumber Line number. \param SizeInBits Member size. \param OffsetInBits Member offset. \param StorageOffsetInBits Member storage offset. \param Flags Flags to encode member attribute. \param Type Parent type.

llgo:link DIBuilderRef.CreateBitFieldMemberType C.LLVMDIBuilderCreateBitFieldMemberType

func (DIBuilderRef) CreateClassType added in v0.3.1

func (self DIBuilderRef) CreateClassType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, OffsetInBits c.Uint64T, Flags DIFlags, DerivedFrom MetadataRef, Elements *MetadataRef, NumElements c.Uint, VTableHolder MetadataRef, TemplateParamsNode MetadataRef, UniqueIdentifier *c.Char, UniqueIdentifierLen c.SizeT) MetadataRef

Create debugging information entry for a class. \param Scope Scope in which this class is defined. \param Name Class name. \param NameLen The length of the C string passed to \c Name. \param File File where this member is defined. \param LineNumber Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param OffsetInBits Member offset. \param Flags Flags to encode member attribute, e.g. private. \param DerivedFrom Debug info of the base class of this type. \param Elements Class members. \param NumElements Number of class elements. \param VTableHolder Debug info of the base class that contains vtable

for this type. This is used in
DW_AT_containing_type. See DWARF documentation
for more info.

\param TemplateParamsNode Template type parameters. \param UniqueIdentifier A unique identifier for the type. \param UniqueIdentifierLen Length of the unique identifier.

llgo:link DIBuilderRef.CreateClassType C.LLVMDIBuilderCreateClassType

func (DIBuilderRef) CreateCompileUnit added in v0.3.1

func (self DIBuilderRef) CreateCompileUnit(Lang DWARFSourceLanguage, FileRef MetadataRef, Producer *c.Char, ProducerLen c.SizeT, isOptimized Bool, Flags *c.Char, FlagsLen c.SizeT, RuntimeVer c.Uint, SplitName *c.Char, SplitNameLen c.SizeT, Kind DWARFEmissionKind, DWOId c.Uint, SplitDebugInlining Bool, DebugInfoForProfiling Bool, SysRoot *c.Char, SysRootLen c.SizeT, SDK *c.Char, SDKLen c.SizeT) MetadataRef

A CompileUnit provides an anchor for all debugging information generated during this instance of compilation. \param Lang Source programming language, eg.

\c LLVMDWARFSourceLanguageC99

\param FileRef File info. \param Producer Identify the producer of debugging information

and code.  Usually this is a compiler
version string.

\param ProducerLen The length of the C string passed to \c Producer. \param isOptimized A boolean flag which indicates whether optimization

is enabled or not.

\param Flags This string lists command line options. This

string is directly embedded in debug info
output which may be used by a tool
analyzing generated debugging information.

\param FlagsLen The length of the C string passed to \c Flags. \param RuntimeVer This indicates runtime version for languages like

Objective-C.

\param SplitName The name of the file that we'll split debug info

out into.

\param SplitNameLen The length of the C string passed to \c SplitName. \param Kind The kind of debug information to generate. \param DWOId The DWOId if this is a split skeleton compile unit. \param SplitDebugInlining Whether to emit inline debug info. \param DebugInfoForProfiling Whether to emit extra debug info for

profile collection.

\param SysRoot The Clang system root (value of -isysroot). \param SysRootLen The length of the C string passed to \c SysRoot. \param SDK The SDK. On Darwin, the last component of the sysroot. \param SDKLen The length of the C string passed to \c SDK.

llgo:link DIBuilderRef.CreateCompileUnit C.LLVMDIBuilderCreateCompileUnit

func (DIBuilderRef) CreateConstantValueExpression added in v0.3.1

func (self DIBuilderRef) CreateConstantValueExpression(Value c.Uint64T) MetadataRef

Create a new descriptor for the specified variable that does not have an address, but does have a constant value. \param Builder The DIBuilder. \param Value The constant value.

llgo:link DIBuilderRef.CreateConstantValueExpression C.LLVMDIBuilderCreateConstantValueExpression

func (DIBuilderRef) CreateDynamicArrayType added in v0.3.1

func (self DIBuilderRef) CreateDynamicArrayType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, LineNo c.Uint, File MetadataRef, Size c.Uint64T, AlignInBits c.Uint32T, Ty MetadataRef, Subscripts *MetadataRef, NumSubscripts c.Uint, DataLocation MetadataRef, Associated MetadataRef, Allocated MetadataRef, Rank MetadataRef, BitStride MetadataRef) MetadataRef

Create debugging information entry for a dynamic array. \param Builder The DIBuilder. \param Size Array size. \param AlignInBits Alignment. \param Ty Element type. \param Subscripts Subscripts. \param NumSubscripts Number of subscripts. \param DataLocation DataLocation. (DIVariable, DIExpression or NULL) \param Associated Associated. (DIVariable, DIExpression or NULL) \param Allocated Allocated. (DIVariable, DIExpression or NULL) \param Rank Rank. (DIVariable, DIExpression or NULL) \param BitStride BitStride.

llgo:link DIBuilderRef.CreateDynamicArrayType C.LLVMDIBuilderCreateDynamicArrayType

func (DIBuilderRef) CreateEnumerationType added in v0.3.1

func (self DIBuilderRef) CreateEnumerationType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Elements *MetadataRef, NumElements c.Uint, ClassTy MetadataRef) MetadataRef

Create debugging information entry for an enumeration. \param Builder The DIBuilder. \param Scope Scope in which this enumeration is defined. \param Name Enumeration name. \param NameLen Length of enumeration name. \param File File where this member is defined. \param LineNumber Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param Elements Enumeration elements. \param NumElements Number of enumeration elements. \param ClassTy Underlying type of a C++11/ObjC fixed enum.

llgo:link DIBuilderRef.CreateEnumerationType C.LLVMDIBuilderCreateEnumerationType

func (DIBuilderRef) CreateEnumerator added in v0.3.1

func (self DIBuilderRef) CreateEnumerator(Name *c.Char, NameLen c.SizeT, Value c.Int64T, IsUnsigned Bool) MetadataRef

Create debugging information entry for an enumerator. @param Builder The DIBuilder. @param Name Enumerator name. @param NameLen Length of enumerator name. @param Value Enumerator value. @param IsUnsigned True if the value is unsigned.

llgo:link DIBuilderRef.CreateEnumerator C.LLVMDIBuilderCreateEnumerator

func (DIBuilderRef) CreateEnumeratorOfArbitraryPrecision added in v0.3.1

func (self DIBuilderRef) CreateEnumeratorOfArbitraryPrecision(Name *c.Char, NameLen c.SizeT, SizeInBits c.Uint64T, Words *c.Uint64T, IsUnsigned Bool) MetadataRef

Create debugging information entry for an enumerator of arbitrary precision. @param Builder The DIBuilder. @param Name Enumerator name. @param NameLen Length of enumerator name. @param SizeInBits Number of bits of the value. @param Words The words that make up the value. @param IsUnsigned True if the value is unsigned.

llgo:link DIBuilderRef.CreateEnumeratorOfArbitraryPrecision C.LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision

func (DIBuilderRef) CreateExpression added in v0.3.1

func (self DIBuilderRef) CreateExpression(Addr *c.Uint64T, Length c.SizeT) MetadataRef

Create a new descriptor for the specified variable which has a complex address expression for its address. \param Builder The DIBuilder. \param Addr An array of complex address operations. \param Length Length of the address operation array.

llgo:link DIBuilderRef.CreateExpression C.LLVMDIBuilderCreateExpression

func (DIBuilderRef) CreateFile added in v0.3.1

func (self DIBuilderRef) CreateFile(Filename *c.Char, FilenameLen c.SizeT, Directory *c.Char, DirectoryLen c.SizeT) MetadataRef

Create a file descriptor to hold debugging information for a file. \param Builder The \c DIBuilder. \param Filename File name. \param FilenameLen The length of the C string passed to \c Filename. \param Directory Directory. \param DirectoryLen The length of the C string passed to \c Directory.

llgo:link DIBuilderRef.CreateFile C.LLVMDIBuilderCreateFile

func (DIBuilderRef) CreateFileWithChecksum added in v0.3.1

func (self DIBuilderRef) CreateFileWithChecksum(Filename *c.Char, FilenameLen c.SizeT, Directory *c.Char, DirectoryLen c.SizeT, ChecksumKind ChecksumKind, Checksum *c.Char, ChecksumLen c.SizeT, Source *c.Char, SourceLen c.SizeT) MetadataRef

Create a file descriptor to hold debugging information for a file. \param Builder The \c DIBuilder. \param Filename File name. \param FilenameLen The length of the C string passed to \c Filename. \param Directory Directory. \param DirectoryLen The length of the C string passed to \c Directory. \param ChecksumKind The kind of checksum. eg MD5, SHA256 \param Checksum The checksum. \param ChecksumLen The length of the checksum. \param Souce The embedded source. \param SourceLen The length of the source.

llgo:link DIBuilderRef.CreateFileWithChecksum C.LLVMDIBuilderCreateFileWithChecksum

func (DIBuilderRef) CreateForwardDecl added in v0.3.1

func (self DIBuilderRef) CreateForwardDecl(Tag c.Uint, Name *c.Char, NameLen c.SizeT, Scope MetadataRef, File MetadataRef, Line c.Uint, RuntimeLang c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, UniqueIdentifier *c.Char, UniqueIdentifierLen c.SizeT) MetadataRef

Create a permanent forward-declared type. \param Builder The DIBuilder. \param Tag A unique tag for this type. \param Name Type name. \param NameLen Length of type name. \param Scope Type scope. \param File File where this type is defined. \param Line Line number where this type is defined. \param RuntimeLang Indicates runtime version for languages like

Objective-C.

\param SizeInBits Member size. \param AlignInBits Member alignment. \param UniqueIdentifier A unique identifier for the type. \param UniqueIdentifierLen Length of the unique identifier.

llgo:link DIBuilderRef.CreateForwardDecl C.LLVMDIBuilderCreateForwardDecl

func (DIBuilderRef) CreateFunction added in v0.3.1

func (self DIBuilderRef) CreateFunction(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, LinkageName *c.Char, LinkageNameLen c.SizeT, File MetadataRef, LineNo c.Uint, Ty MetadataRef, IsLocalToUnit Bool, IsDefinition Bool, ScopeLine c.Uint, Flags DIFlags, IsOptimized Bool) MetadataRef

Create a new descriptor for the specified subprogram. \param Builder The \c DIBuilder. \param Scope Function scope. \param Name Function name. \param NameLen Length of enumeration name. \param LinkageName Mangled function name. \param LinkageNameLen Length of linkage name. \param File File where this variable is defined. \param LineNo Line number. \param Ty Function type. \param IsLocalToUnit True if this function is not externally visible. \param IsDefinition True if this is a function definition. \param ScopeLine Set to the beginning of the scope this starts \param Flags E.g.: \c LLVMDIFlagLValueReference. These flags are

used to emit dwarf attributes.

\param IsOptimized True if optimization is ON.

llgo:link DIBuilderRef.CreateFunction C.LLVMDIBuilderCreateFunction

func (DIBuilderRef) CreateGlobalVariableExpression added in v0.3.1

func (self DIBuilderRef) CreateGlobalVariableExpression(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, Linkage *c.Char, LinkLen c.SizeT, File MetadataRef, LineNo c.Uint, Ty MetadataRef, LocalToUnit Bool, Expr MetadataRef, Decl MetadataRef, AlignInBits c.Uint32T) MetadataRef

Create a new descriptor for the specified variable. \param Scope Variable scope. \param Name Name of the variable. \param NameLen The length of the C string passed to \c Name. \param Linkage Mangled name of the variable. \param LinkLen The length of the C string passed to \c Linkage. \param File File where this variable is defined. \param LineNo Line number. \param Ty Variable Type. \param LocalToUnit Boolean flag indicate whether this variable is

externally visible or not.

\param Expr The location of the global relative to the attached

GlobalVariable.

\param Decl Reference to the corresponding declaration.

variables.

\param AlignInBits Variable alignment(or 0 if no alignment attr was

specified)

llgo:link DIBuilderRef.CreateGlobalVariableExpression C.LLVMDIBuilderCreateGlobalVariableExpression

func (DIBuilderRef) CreateImportedDeclaration added in v0.3.1

func (self DIBuilderRef) CreateImportedDeclaration(Scope MetadataRef, Decl MetadataRef, File MetadataRef, Line c.Uint, Name *c.Char, NameLen c.SizeT, Elements *MetadataRef, NumElements c.Uint) MetadataRef

Create a descriptor for an imported function, type, or variable. Suitable for e.g. FORTRAN-style USE declarations. \param Builder The DIBuilder. \param Scope The scope this module is imported into. \param Decl The declaration (or definition) of a function, type, or variable. \param File File where the declaration is located. \param Line Line number of the declaration. \param Name A name that uniquely identifies this imported declaration. \param NameLen The length of the C string passed to \c Name. \param Elements Renamed elements. \param NumElements Number of renamed elements.

llgo:link DIBuilderRef.CreateImportedDeclaration C.LLVMDIBuilderCreateImportedDeclaration

func (DIBuilderRef) CreateImportedModuleFromAlias added in v0.3.1

func (self DIBuilderRef) CreateImportedModuleFromAlias(Scope MetadataRef, ImportedEntity MetadataRef, File MetadataRef, Line c.Uint, Elements *MetadataRef, NumElements c.Uint) MetadataRef

Create a descriptor for an imported module that aliases another imported entity descriptor. \param Builder The \c DIBuilder. \param Scope The scope this module is imported into \param ImportedEntity Previous imported entity to alias. \param File File where the declaration is located. \param Line Line number of the declaration. \param Elements Renamed elements. \param NumElements Number of renamed elements.

llgo:link DIBuilderRef.CreateImportedModuleFromAlias C.LLVMDIBuilderCreateImportedModuleFromAlias

func (DIBuilderRef) CreateImportedModuleFromModule added in v0.3.1

func (self DIBuilderRef) CreateImportedModuleFromModule(Scope MetadataRef, M MetadataRef, File MetadataRef, Line c.Uint, Elements *MetadataRef, NumElements c.Uint) MetadataRef

Create a descriptor for an imported module. \param Builder The \c DIBuilder. \param Scope The scope this module is imported into \param M The module being imported here \param File File where the declaration is located. \param Line Line number of the declaration. \param Elements Renamed elements. \param NumElements Number of renamed elements.

llgo:link DIBuilderRef.CreateImportedModuleFromModule C.LLVMDIBuilderCreateImportedModuleFromModule

func (DIBuilderRef) CreateImportedModuleFromNamespace added in v0.3.1

func (self DIBuilderRef) CreateImportedModuleFromNamespace(Scope MetadataRef, NS MetadataRef, File MetadataRef, Line c.Uint) MetadataRef

Create a descriptor for an imported namespace. Suitable for e.g. C++ using declarations. \param Builder The \c DIBuilder. \param Scope The scope this module is imported into \param File File where the declaration is located. \param Line Line number of the declaration.

llgo:link DIBuilderRef.CreateImportedModuleFromNamespace C.LLVMDIBuilderCreateImportedModuleFromNamespace

func (DIBuilderRef) CreateInheritance added in v0.3.1

func (self DIBuilderRef) CreateInheritance(Ty MetadataRef, BaseTy MetadataRef, BaseOffset c.Uint64T, VBPtrOffset c.Uint32T, Flags DIFlags) MetadataRef

Create debugging information entry to establish inheritance relationship between two types. \param Builder The DIBuilder. \param Ty Original type. \param BaseTy Base type. Ty is inherits from base. \param BaseOffset Base offset. \param VBPtrOffset Virtual base pointer offset. \param Flags Flags to describe inheritance attribute, e.g. private

llgo:link DIBuilderRef.CreateInheritance C.LLVMDIBuilderCreateInheritance

func (DIBuilderRef) CreateLabel added in v0.3.1

func (self DIBuilderRef) CreateLabel(Context MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, AlwaysPreserve Bool) MetadataRef

Create a new descriptor for a label

\param Builder The DIBuilder. \param Scope The scope to create the label in. \param Name Variable name. \param NameLen Length of variable name. \param File The file to create the label in. \param LineNo Line Number. \param AlwaysPreserve Preserve the label regardless of optimization.

@see llvm::DIBuilder::createLabel()

llgo:link DIBuilderRef.CreateLabel C.LLVMDIBuilderCreateLabel

func (DIBuilderRef) CreateLexicalBlock added in v0.3.1

func (self DIBuilderRef) CreateLexicalBlock(Scope MetadataRef, File MetadataRef, Line c.Uint, Column c.Uint) MetadataRef

Create a descriptor for a lexical block with the specified parent context. \param Builder The \c DIBuilder. \param Scope Parent lexical block. \param File Source file. \param Line The line in the source file. \param Column The column in the source file.

llgo:link DIBuilderRef.CreateLexicalBlock C.LLVMDIBuilderCreateLexicalBlock

func (DIBuilderRef) CreateLexicalBlockFile added in v0.3.1

func (self DIBuilderRef) CreateLexicalBlockFile(Scope MetadataRef, File MetadataRef, Discriminator c.Uint) MetadataRef

Create a descriptor for a lexical block with a new file attached. \param Builder The \c DIBuilder. \param Scope Lexical block. \param File Source file. \param Discriminator DWARF path discriminator value.

llgo:link DIBuilderRef.CreateLexicalBlockFile C.LLVMDIBuilderCreateLexicalBlockFile

func (DIBuilderRef) CreateMacro added in v0.3.1

func (self DIBuilderRef) CreateMacro(ParentMacroFile MetadataRef, Line c.Uint, RecordType DWARFMacinfoRecordType, Name *c.Char, NameLen c.SizeT, Value *c.Char, ValueLen c.SizeT) MetadataRef

Create debugging information entry for a macro. @param Builder The DIBuilder. @param ParentMacroFile Macro parent (could be NULL). @param Line Source line number where the macro is defined. @param RecordType DW_MACINFO_define or DW_MACINFO_undef. @param Name Macro name. @param NameLen Macro name length. @param Value Macro value. @param ValueLen Macro value length.

llgo:link DIBuilderRef.CreateMacro C.LLVMDIBuilderCreateMacro

func (DIBuilderRef) CreateMemberPointerType added in v0.3.1

func (self DIBuilderRef) CreateMemberPointerType(PointeeType MetadataRef, ClassType MetadataRef, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Flags DIFlags) MetadataRef

Create debugging information entry for a pointer to member. \param Builder The DIBuilder. \param PointeeType Type pointed to by this pointer. \param ClassType Type for which this pointer points to members of. \param SizeInBits Size. \param AlignInBits Alignment. \param Flags Flags.

llgo:link DIBuilderRef.CreateMemberPointerType C.LLVMDIBuilderCreateMemberPointerType

func (DIBuilderRef) CreateMemberType added in v0.3.1

func (self DIBuilderRef) CreateMemberType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, OffsetInBits c.Uint64T, Flags DIFlags, Ty MetadataRef) MetadataRef

Create debugging information entry for a member. \param Builder The DIBuilder. \param Scope Member scope. \param Name Member name. \param NameLen Length of member name. \param File File where this member is defined. \param LineNo Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param OffsetInBits Member offset. \param Flags Flags to encode member attribute, e.g. private \param Ty Parent type.

llgo:link DIBuilderRef.CreateMemberType C.LLVMDIBuilderCreateMemberType

func (DIBuilderRef) CreateModule added in v0.3.1

func (self DIBuilderRef) CreateModule(ParentScope MetadataRef, Name *c.Char, NameLen c.SizeT, ConfigMacros *c.Char, ConfigMacrosLen c.SizeT, IncludePath *c.Char, IncludePathLen c.SizeT, APINotesFile *c.Char, APINotesFileLen c.SizeT) MetadataRef

Creates a new descriptor for a module with the specified parent scope. \param Builder The \c DIBuilder. \param ParentScope The parent scope containing this module declaration. \param Name Module name. \param NameLen The length of the C string passed to \c Name. \param ConfigMacros A space-separated shell-quoted list of -D macro definitions as they would appear on a command line. \param ConfigMacrosLen The length of the C string passed to \c ConfigMacros. \param IncludePath The path to the module map file. \param IncludePathLen The length of the C string passed to \c IncludePath. \param APINotesFile The path to an API notes file for the module. \param APINotesFileLen The length of the C string passed to \c APINotestFile.

llgo:link DIBuilderRef.CreateModule C.LLVMDIBuilderCreateModule

func (DIBuilderRef) CreateNameSpace added in v0.3.1

func (self DIBuilderRef) CreateNameSpace(ParentScope MetadataRef, Name *c.Char, NameLen c.SizeT, ExportSymbols Bool) MetadataRef

Creates a new descriptor for a namespace with the specified parent scope. \param Builder The \c DIBuilder. \param ParentScope The parent scope containing this module declaration. \param Name NameSpace name. \param NameLen The length of the C string passed to \c Name. \param ExportSymbols Whether or not the namespace exports symbols, e.g.

this is true of C++ inline namespaces.

llgo:link DIBuilderRef.CreateNameSpace C.LLVMDIBuilderCreateNameSpace

func (DIBuilderRef) CreateNullPtrType added in v0.3.1

func (self DIBuilderRef) CreateNullPtrType() MetadataRef

Create C++11 nullptr type. \param Builder The DIBuilder.

llgo:link DIBuilderRef.CreateNullPtrType C.LLVMDIBuilderCreateNullPtrType

func (DIBuilderRef) CreateObjCIVar added in v0.3.1

func (self DIBuilderRef) CreateObjCIVar(Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, OffsetInBits c.Uint64T, Flags DIFlags, Ty MetadataRef, PropertyNode MetadataRef) MetadataRef

Create debugging information entry for Objective-C instance variable. \param Builder The DIBuilder. \param Name Member name. \param NameLen The length of the C string passed to \c Name. \param File File where this member is defined. \param LineNo Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param OffsetInBits Member offset. \param Flags Flags to encode member attribute, e.g. private \param Ty Parent type. \param PropertyNode Property associated with this ivar.

llgo:link DIBuilderRef.CreateObjCIVar C.LLVMDIBuilderCreateObjCIVar

func (DIBuilderRef) CreateObjCProperty added in v0.3.1

func (self DIBuilderRef) CreateObjCProperty(Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, GetterName *c.Char, GetterNameLen c.SizeT, SetterName *c.Char, SetterNameLen c.SizeT, PropertyAttributes c.Uint, Ty MetadataRef) MetadataRef

Create debugging information entry for Objective-C property. \param Builder The DIBuilder. \param Name Property name. \param NameLen The length of the C string passed to \c Name. \param File File where this property is defined. \param LineNo Line number. \param GetterName Name of the Objective C property getter selector. \param GetterNameLen The length of the C string passed to \c GetterName. \param SetterName Name of the Objective C property setter selector. \param SetterNameLen The length of the C string passed to \c SetterName. \param PropertyAttributes Objective C property attributes. \param Ty Type.

llgo:link DIBuilderRef.CreateObjCProperty C.LLVMDIBuilderCreateObjCProperty

func (DIBuilderRef) CreateObjectPointerType added in v0.3.1

func (self DIBuilderRef) CreateObjectPointerType(Type MetadataRef, Implicit Bool) MetadataRef

Create a uniqued DIType* clone with FlagObjectPointer. If \c Implicit is true, then also set FlagArtificial. \param Builder The DIBuilder. \param Type The underlying type to which this pointer points. \param Implicit Indicates whether this pointer was implicitly generated

(i.e., not spelled out in source).

llgo:link DIBuilderRef.CreateObjectPointerType C.LLVMDIBuilderCreateObjectPointerType

func (DIBuilderRef) CreateParameterVariable added in v0.3.1

func (self DIBuilderRef) CreateParameterVariable(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, ArgNo c.Uint, File MetadataRef, LineNo c.Uint, Ty MetadataRef, AlwaysPreserve Bool, Flags DIFlags) MetadataRef

Create a new descriptor for a function parameter variable. \param Builder The DIBuilder. \param Scope The local scope the variable is declared in. \param Name Variable name. \param NameLen Length of variable name. \param ArgNo Unique argument number for this variable; starts at 1. \param File File where this variable is defined. \param LineNo Line number. \param Ty Metadata describing the type of the variable. \param AlwaysPreserve If true, this descriptor will survive optimizations. \param Flags Flags.

llgo:link DIBuilderRef.CreateParameterVariable C.LLVMDIBuilderCreateParameterVariable

func (DIBuilderRef) CreatePointerType added in v0.3.1

func (self DIBuilderRef) CreatePointerType(PointeeTy MetadataRef, SizeInBits c.Uint64T, AlignInBits c.Uint32T, AddressSpace c.Uint, Name *c.Char, NameLen c.SizeT) MetadataRef

Create debugging information entry for a pointer. \param Builder The DIBuilder. \param PointeeTy Type pointed by this pointer. \param SizeInBits Size. \param AlignInBits Alignment. (optional, pass 0 to ignore) \param AddressSpace DWARF address space. (optional, pass 0 to ignore) \param Name Pointer type name. (optional) \param NameLen Length of pointer type name. (optional)

llgo:link DIBuilderRef.CreatePointerType C.LLVMDIBuilderCreatePointerType

func (DIBuilderRef) CreateQualifiedType added in v0.3.1

func (self DIBuilderRef) CreateQualifiedType(Tag c.Uint, Type MetadataRef) MetadataRef

Create debugging information entry for a qualified type, e.g. 'const int'. \param Builder The DIBuilder. \param Tag Tag identifying type,

e.g. LLVMDWARFTypeQualifier_volatile_type

\param Type Base Type.

llgo:link DIBuilderRef.CreateQualifiedType C.LLVMDIBuilderCreateQualifiedType

func (DIBuilderRef) CreateReferenceType added in v0.3.1

func (self DIBuilderRef) CreateReferenceType(Tag c.Uint, Type MetadataRef) MetadataRef

Create debugging information entry for a c++ style reference or rvalue reference type. \param Builder The DIBuilder. \param Tag Tag identifying type, \param Type Base Type.

llgo:link DIBuilderRef.CreateReferenceType C.LLVMDIBuilderCreateReferenceType

func (DIBuilderRef) CreateReplaceableCompositeType added in v0.3.1

func (self DIBuilderRef) CreateReplaceableCompositeType(Tag c.Uint, Name *c.Char, NameLen c.SizeT, Scope MetadataRef, File MetadataRef, Line c.Uint, RuntimeLang c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Flags DIFlags, UniqueIdentifier *c.Char, UniqueIdentifierLen c.SizeT) MetadataRef

Create a temporary forward-declared type. \param Builder The DIBuilder. \param Tag A unique tag for this type. \param Name Type name. \param NameLen Length of type name. \param Scope Type scope. \param File File where this type is defined. \param Line Line number where this type is defined. \param RuntimeLang Indicates runtime version for languages like

Objective-C.

\param SizeInBits Member size. \param AlignInBits Member alignment. \param Flags Flags. \param UniqueIdentifier A unique identifier for the type. \param UniqueIdentifierLen Length of the unique identifier.

llgo:link DIBuilderRef.CreateReplaceableCompositeType C.LLVMDIBuilderCreateReplaceableCompositeType

func (DIBuilderRef) CreateSetType added in v0.3.1

func (self DIBuilderRef) CreateSetType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, BaseTy MetadataRef) MetadataRef

Create debugging information entry for a set. \param Builder The DIBuilder. \param Scope The scope in which the set is defined. \param Name A name that uniquely identifies this set. \param NameLen The length of the C string passed to \c Name. \param File File where the set is located. \param Line Line number of the declaration. \param SizeInBits Set size. \param AlignInBits Set alignment. \param BaseTy The base type of the set.

llgo:link DIBuilderRef.CreateSetType C.LLVMDIBuilderCreateSetType

func (DIBuilderRef) CreateStaticMemberType added in v0.3.1

func (self DIBuilderRef) CreateStaticMemberType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, Type MetadataRef, Flags DIFlags, ConstantVal ValueRef, AlignInBits c.Uint32T) MetadataRef

Create debugging information entry for a C++ static data member. \param Builder The DIBuilder. \param Scope Member scope. \param Name Member name. \param NameLen Length of member name. \param File File where this member is declared. \param LineNumber Line number. \param Type Type of the static member. \param Flags Flags to encode member attribute, e.g. private. \param ConstantVal Const initializer of the member. \param AlignInBits Member alignment.

llgo:link DIBuilderRef.CreateStaticMemberType C.LLVMDIBuilderCreateStaticMemberType

func (DIBuilderRef) CreateStructType added in v0.3.1

func (self DIBuilderRef) CreateStructType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Flags DIFlags, DerivedFrom MetadataRef, Elements *MetadataRef, NumElements c.Uint, RunTimeLang c.Uint, VTableHolder MetadataRef, UniqueId *c.Char, UniqueIdLen c.SizeT) MetadataRef

Create debugging information entry for a struct. \param Builder The DIBuilder. \param Scope Scope in which this struct is defined. \param Name Struct name. \param NameLen Struct name length. \param File File where this member is defined. \param LineNumber Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param Flags Flags to encode member attribute, e.g. private \param Elements Struct elements. \param NumElements Number of struct elements. \param RunTimeLang Optional parameter, Objective-C runtime version. \param VTableHolder The object containing the vtable for the struct. \param UniqueId A unique identifier for the struct. \param UniqueIdLen Length of the unique identifier for the struct.

llgo:link DIBuilderRef.CreateStructType C.LLVMDIBuilderCreateStructType

func (DIBuilderRef) CreateSubrangeType added in v0.3.1

func (self DIBuilderRef) CreateSubrangeType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, LineNo c.Uint, File MetadataRef, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Flags DIFlags, BaseTy MetadataRef, LowerBound MetadataRef, UpperBound MetadataRef, Stride MetadataRef, Bias MetadataRef) MetadataRef

Create a descriptor for a subrange with dynamic bounds. \param Builder The DIBuilder. \param Scope The scope in which the subrange is defined. \param Name A name that uniquely identifies this subrange. \param NameLen The length of the C string passed to \c Name. \param LineNo Line number. \param File File where the subrange is located. \param SizeInBits Member size. \param AlignInBits Member alignment. \param Flags Flags. \param BaseTy The base type of the subrange. eg integer or enumeration \param LowerBound Lower bound of the subrange. \param UpperBound Upper bound of the subrange. \param Stride Stride of the subrange. \param Bias Bias of the subrange.

llgo:link DIBuilderRef.CreateSubrangeType C.LLVMDIBuilderCreateSubrangeType

func (DIBuilderRef) CreateSubroutineType added in v0.3.1

func (self DIBuilderRef) CreateSubroutineType(File MetadataRef, ParameterTypes *MetadataRef, NumParameterTypes c.Uint, Flags DIFlags) MetadataRef

Create subroutine type. \param Builder The DIBuilder. \param File The file in which the subroutine resides. \param ParameterTypes An array of subroutine parameter types. This

includes return type at 0th index.

\param NumParameterTypes The number of parameter types in \c ParameterTypes \param Flags E.g.: \c LLVMDIFlagLValueReference.

These flags are used to emit dwarf attributes.

llgo:link DIBuilderRef.CreateSubroutineType C.LLVMDIBuilderCreateSubroutineType

func (DIBuilderRef) CreateTempGlobalVariableFwdDecl added in v0.3.1

func (self DIBuilderRef) CreateTempGlobalVariableFwdDecl(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, Linkage *c.Char, LnkLen c.SizeT, File MetadataRef, LineNo c.Uint, Ty MetadataRef, LocalToUnit Bool, Decl MetadataRef, AlignInBits c.Uint32T) MetadataRef

Create a new descriptor for the specified global variable that is temporary and meant to be RAUWed. \param Scope Variable scope. \param Name Name of the variable. \param NameLen The length of the C string passed to \c Name. \param Linkage Mangled name of the variable. \param LnkLen The length of the C string passed to \c Linkage. \param File File where this variable is defined. \param LineNo Line number. \param Ty Variable Type. \param LocalToUnit Boolean flag indicate whether this variable is

externally visible or not.

\param Decl Reference to the corresponding declaration. \param AlignInBits Variable alignment(or 0 if no alignment attr was

specified)

llgo:link DIBuilderRef.CreateTempGlobalVariableFwdDecl C.LLVMDIBuilderCreateTempGlobalVariableFwdDecl

func (DIBuilderRef) CreateTempMacroFile added in v0.3.1

func (self DIBuilderRef) CreateTempMacroFile(ParentMacroFile MetadataRef, Line c.Uint, File MetadataRef) MetadataRef

Create debugging information temporary entry for a macro file. List of macro node direct children will be calculated by DIBuilder, using the \p ParentMacroFile relationship. @param Builder The DIBuilder. @param ParentMacroFile Macro parent (could be NULL). @param Line Source line number where the macro file is included. @param File File descriptor containing the name of the macro file.

llgo:link DIBuilderRef.CreateTempMacroFile C.LLVMDIBuilderCreateTempMacroFile

func (DIBuilderRef) CreateTypedef added in v0.3.1

func (self DIBuilderRef) CreateTypedef(Type MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNo c.Uint, Scope MetadataRef, AlignInBits c.Uint32T) MetadataRef

Create debugging information entry for a typedef. \param Builder The DIBuilder. \param Type Original type. \param Name Typedef name. \param File File where this type is defined. \param LineNo Line number. \param Scope The surrounding context for the typedef.

llgo:link DIBuilderRef.CreateTypedef C.LLVMDIBuilderCreateTypedef

func (DIBuilderRef) CreateUnionType added in v0.3.1

func (self DIBuilderRef) CreateUnionType(Scope MetadataRef, Name *c.Char, NameLen c.SizeT, File MetadataRef, LineNumber c.Uint, SizeInBits c.Uint64T, AlignInBits c.Uint32T, Flags DIFlags, Elements *MetadataRef, NumElements c.Uint, RunTimeLang c.Uint, UniqueId *c.Char, UniqueIdLen c.SizeT) MetadataRef

Create debugging information entry for a union. \param Builder The DIBuilder. \param Scope Scope in which this union is defined. \param Name Union name. \param NameLen Length of union name. \param File File where this member is defined. \param LineNumber Line number. \param SizeInBits Member size. \param AlignInBits Member alignment. \param Flags Flags to encode member attribute, e.g. private \param Elements Union elements. \param NumElements Number of union elements. \param RunTimeLang Optional parameter, Objective-C runtime version. \param UniqueId A unique identifier for the union. \param UniqueIdLen Length of unique identifier.

llgo:link DIBuilderRef.CreateUnionType C.LLVMDIBuilderCreateUnionType

func (DIBuilderRef) CreateUnspecifiedType added in v0.3.1

func (self DIBuilderRef) CreateUnspecifiedType(Name *c.Char, NameLen c.SizeT) MetadataRef

Create a DWARF unspecified type. \param Builder The DIBuilder. \param Name The unspecified type's name. \param NameLen Length of type name.

llgo:link DIBuilderRef.CreateUnspecifiedType C.LLVMDIBuilderCreateUnspecifiedType

func (DIBuilderRef) CreateVectorType added in v0.3.1

func (self DIBuilderRef) CreateVectorType(Size c.Uint64T, AlignInBits c.Uint32T, Ty MetadataRef, Subscripts *MetadataRef, NumSubscripts c.Uint) MetadataRef

Create debugging information entry for a vector type. \param Builder The DIBuilder. \param Size Vector size. \param AlignInBits Alignment. \param Ty Element type. \param Subscripts Subscripts. \param NumSubscripts Number of subscripts.

llgo:link DIBuilderRef.CreateVectorType C.LLVMDIBuilderCreateVectorType

func (DIBuilderRef) Dispose added in v0.3.1

func (self DIBuilderRef) Dispose()

Deallocates the \c DIBuilder and everything it owns. @note You must call \c LLVMDIBuilderFinalize before this

llgo:link DIBuilderRef.Dispose C.LLVMDisposeDIBuilder

func (DIBuilderRef) Finalize added in v0.3.1

func (self DIBuilderRef) Finalize()

Construct any deferred debug info descriptors.

llgo:link DIBuilderRef.Finalize C.LLVMDIBuilderFinalize

func (DIBuilderRef) FinalizeSubprogram added in v0.3.1

func (self DIBuilderRef) FinalizeSubprogram(Subprogram MetadataRef)

Finalize a specific subprogram. No new variables may be added to this subprogram afterwards.

llgo:link DIBuilderRef.FinalizeSubprogram C.LLVMDIBuilderFinalizeSubprogram

func (DIBuilderRef) InsertDbgValueRecordAtEnd added in v0.3.1

func (self DIBuilderRef) InsertDbgValueRecordAtEnd(Val ValueRef, VarInfo MetadataRef, Expr MetadataRef, DebugLoc MetadataRef, Block BasicBlockRef) DbgRecordRef

Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

The debug format can be switched later after inserting the records using LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.

Insert a new debug record at the end of the given basic block. If the basic block has a terminator instruction, the record is inserted before that terminator instruction. \param Builder The DIBuilder. \param Val The value of the variable. \param VarInfo The variable's debug info descriptor. \param Expr A complex location expression for the variable. \param DebugLoc Debug info location. \param Block Basic block acting as a location for the new record.

llgo:link DIBuilderRef.InsertDbgValueRecordAtEnd C.LLVMDIBuilderInsertDbgValueRecordAtEnd

func (DIBuilderRef) InsertDbgValueRecordBefore added in v0.3.1

func (self DIBuilderRef) InsertDbgValueRecordBefore(Val ValueRef, VarInfo MetadataRef, Expr MetadataRef, DebugLoc MetadataRef, Instr ValueRef) DbgRecordRef

Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

The debug format can be switched later after inserting the records using LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.

Insert a new debug record before the given instruction. \param Builder The DIBuilder. \param Val The value of the variable. \param VarInfo The variable's debug info descriptor. \param Expr A complex location expression for the variable. \param DebugLoc Debug info location. \param Instr Instruction acting as a location for the new record.

llgo:link DIBuilderRef.InsertDbgValueRecordBefore C.LLVMDIBuilderInsertDbgValueRecordBefore

func (DIBuilderRef) InsertDeclareRecordAtEnd added in v0.3.1

func (self DIBuilderRef) InsertDeclareRecordAtEnd(Storage ValueRef, VarInfo MetadataRef, Expr MetadataRef, DebugLoc MetadataRef, Block BasicBlockRef) DbgRecordRef

Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

The debug format can be switched later after inserting the records using LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.

Insert a Declare DbgRecord at the end of the given basic block. If the basic block has a terminator instruction, the record is inserted before that terminator instruction. \param Builder The DIBuilder. \param Storage The storage of the variable to declare. \param VarInfo The variable's debug info descriptor. \param Expr A complex location expression for the variable. \param DebugLoc Debug info location. \param Block Basic block acting as a location for the new record.

llgo:link DIBuilderRef.InsertDeclareRecordAtEnd C.LLVMDIBuilderInsertDeclareRecordAtEnd

func (DIBuilderRef) InsertDeclareRecordBefore added in v0.3.1

func (self DIBuilderRef) InsertDeclareRecordBefore(Storage ValueRef, VarInfo MetadataRef, Expr MetadataRef, DebugLoc MetadataRef, Instr ValueRef) DbgRecordRef

Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

The debug format can be switched later after inserting the records using LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons.

Insert a Declare DbgRecord before the given instruction. \param Builder The DIBuilder. \param Storage The storage of the variable to declare. \param VarInfo The variable's debug info descriptor. \param Expr A complex location expression for the variable. \param DebugLoc Debug info location. \param Instr Instruction acting as a location for the new record.

llgo:link DIBuilderRef.InsertDeclareRecordBefore C.LLVMDIBuilderInsertDeclareRecordBefore

func (DIBuilderRef) InsertLabelAtEnd added in v0.3.1

func (self DIBuilderRef) InsertLabelAtEnd(LabelInfo MetadataRef, Location MetadataRef, InsertAtEnd BasicBlockRef) DbgRecordRef

Insert a new llvm.dbg.label intrinsic call

\param Builder The DIBuilder. \param LabelInfo The Label's debug info descriptor \param Location The debug info location \param InsertAtEnd Location for the new intrinsic.

@see llvm::DIBuilder::insertLabel()

llgo:link DIBuilderRef.InsertLabelAtEnd C.LLVMDIBuilderInsertLabelAtEnd

func (DIBuilderRef) InsertLabelBefore added in v0.3.1

func (self DIBuilderRef) InsertLabelBefore(LabelInfo MetadataRef, Location MetadataRef, InsertBefore ValueRef) DbgRecordRef

Insert a new llvm.dbg.label intrinsic call

\param Builder The DIBuilder. \param LabelInfo The Label's debug info descriptor \param Location The debug info location \param InsertBefore Location for the new intrinsic.

@see llvm::DIBuilder::insertLabel()

llgo:link DIBuilderRef.InsertLabelBefore C.LLVMDIBuilderInsertLabelBefore

func (DIBuilderRef) OrCreateArray added in v0.3.1

func (self DIBuilderRef) OrCreateArray(Data *MetadataRef, NumElements c.SizeT) MetadataRef

Create an array of DI Nodes. \param Builder The DIBuilder. \param Data The DI Node elements. \param NumElements Number of DI Node elements.

llgo:link DIBuilderRef.OrCreateArray C.LLVMDIBuilderGetOrCreateArray

func (DIBuilderRef) OrCreateSubrange added in v0.3.1

func (self DIBuilderRef) OrCreateSubrange(LowerBound c.Int64T, Count c.Int64T) MetadataRef

Create a descriptor for a value range. \param Builder The DIBuilder. \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran. \param Count Count of elements in the subrange.

llgo:link DIBuilderRef.OrCreateSubrange C.LLVMDIBuilderGetOrCreateSubrange

func (DIBuilderRef) OrCreateTypeArray added in v0.3.1

func (self DIBuilderRef) OrCreateTypeArray(Data *MetadataRef, NumElements c.SizeT) MetadataRef

Create a type array. \param Builder The DIBuilder. \param Data The type elements. \param NumElements Number of type elements.

llgo:link DIBuilderRef.OrCreateTypeArray C.LLVMDIBuilderGetOrCreateTypeArray

func (DIBuilderRef) ReplaceArrays added in v0.3.0

func (self DIBuilderRef) ReplaceArrays(T *MetadataRef, Elements *MetadataRef, NumElements c.Uint)

Replace arrays.

@see DIBuilder::replaceArrays()

llgo:link DIBuilderRef.ReplaceArrays C.LLVMReplaceArrays

type DIFlags

type DIFlags c.Uint

Debug info flags.

const (
	DIFlagZero                DIFlags = 0
	DIFlagPrivate             DIFlags = 1
	DIFlagProtected           DIFlags = 2
	DIFlagPublic              DIFlags = 3
	DIFlagFwdDecl             DIFlags = 4
	DIFlagAppleBlock          DIFlags = 8
	DIFlagReservedBit4        DIFlags = 16
	DIFlagVirtual             DIFlags = 32
	DIFlagArtificial          DIFlags = 64
	DIFlagExplicit            DIFlags = 128
	DIFlagPrototyped          DIFlags = 256
	DIFlagObjcClassComplete   DIFlags = 512
	DIFlagObjectPointer       DIFlags = 1024
	DIFlagVector              DIFlags = 2048
	DIFlagStaticMember        DIFlags = 4096
	DIFlagLValueReference     DIFlags = 8192
	DIFlagRValueReference     DIFlags = 16384
	DIFlagReserved            DIFlags = 32768
	DIFlagSingleInheritance   DIFlags = 65536
	DIFlagMultipleInheritance DIFlags = 131072
	DIFlagVirtualInheritance  DIFlags = 196608
	DIFlagIntroducedVirtual   DIFlags = 262144
	DIFlagBitField            DIFlags = 524288
	DIFlagNoReturn            DIFlags = 1048576
	DIFlagTypePassByValue     DIFlags = 4194304
	DIFlagTypePassByReference DIFlags = 8388608
	DIFlagEnumClass           DIFlags = 16777216
	DIFlagFixedEnum           DIFlags = 16777216
	DIFlagThunk               DIFlags = 33554432
	DIFlagNonTrivial          DIFlags = 67108864
	DIFlagBigEndian           DIFlags = 134217728
	DIFlagLittleEndian        DIFlags = 268435456
	DIFlagIndirectVirtualBase DIFlags = 36
	DIFlagAccessibility       DIFlags = 3
	DIFlagPtrToMemberRep      DIFlags = 196608
)

type DLLStorageClass

type DLLStorageClass c.Uint
const (
	DefaultStorageClass   DLLStorageClass = 0
	DLLImportStorageClass DLLStorageClass = 1
	// < Function to be accessible from DLL.
	DLLExportStorageClass DLLStorageClass = 2
)

type DWARFEmissionKind

type DWARFEmissionKind c.Uint

The amount of debug information to emit.

const (
	DWARFEmissionNone           DWARFEmissionKind = 0
	DWARFEmissionFull           DWARFEmissionKind = 1
	DWARFEmissionLineTablesOnly DWARFEmissionKind = 2
)

type DWARFMacinfoRecordType

type DWARFMacinfoRecordType c.Uint

Describes the kind of macro declaration used for LLVMDIBuilderCreateMacro. @see llvm::dwarf::MacinfoRecordType @note Values are from DW_MACINFO_* constants in the DWARF specification.

const (
	DWARFMacinfoRecordTypeDefine    DWARFMacinfoRecordType = 1
	DWARFMacinfoRecordTypeMacro     DWARFMacinfoRecordType = 2
	DWARFMacinfoRecordTypeStartFile DWARFMacinfoRecordType = 3
	DWARFMacinfoRecordTypeEndFile   DWARFMacinfoRecordType = 4
	DWARFMacinfoRecordTypeVendorExt DWARFMacinfoRecordType = 255
)

type DWARFSourceLanguage

type DWARFSourceLanguage c.Uint

Source languages known by DWARF.

const (
	DWARFSourceLanguageC89       DWARFSourceLanguage = 0
	DWARFSourceLanguageC         DWARFSourceLanguage = 1
	DWARFSourceLanguageAda83     DWARFSourceLanguage = 2
	DWARFSourceLanguageCPlusPlus DWARFSourceLanguage = 3
	DWARFSourceLanguageCobol74   DWARFSourceLanguage = 4
	DWARFSourceLanguageCobol85   DWARFSourceLanguage = 5
	DWARFSourceLanguageFortran77 DWARFSourceLanguage = 6
	DWARFSourceLanguageFortran90 DWARFSourceLanguage = 7
	DWARFSourceLanguagePascal83  DWARFSourceLanguage = 8
	DWARFSourceLanguageModula2   DWARFSourceLanguage = 9
	// New in DWARF v3:
	DWARFSourceLanguageJava         DWARFSourceLanguage = 10
	DWARFSourceLanguageC99          DWARFSourceLanguage = 11
	DWARFSourceLanguageAda95        DWARFSourceLanguage = 12
	DWARFSourceLanguageFortran95    DWARFSourceLanguage = 13
	DWARFSourceLanguagePLI          DWARFSourceLanguage = 14
	DWARFSourceLanguageObjC         DWARFSourceLanguage = 15
	DWARFSourceLanguageObjCPlusPlus DWARFSourceLanguage = 16
	DWARFSourceLanguageUPC          DWARFSourceLanguage = 17
	DWARFSourceLanguageD            DWARFSourceLanguage = 18
	// New in DWARF v4:
	DWARFSourceLanguagePython DWARFSourceLanguage = 19
	// New in DWARF v5:
	DWARFSourceLanguageOpenCL       DWARFSourceLanguage = 20
	DWARFSourceLanguageGo           DWARFSourceLanguage = 21
	DWARFSourceLanguageModula3      DWARFSourceLanguage = 22
	DWARFSourceLanguageHaskell      DWARFSourceLanguage = 23
	DWARFSourceLanguageCPlusPlus03  DWARFSourceLanguage = 24
	DWARFSourceLanguageCPlusPlus11  DWARFSourceLanguage = 25
	DWARFSourceLanguageOCaml        DWARFSourceLanguage = 26
	DWARFSourceLanguageRust         DWARFSourceLanguage = 27
	DWARFSourceLanguageC11          DWARFSourceLanguage = 28
	DWARFSourceLanguageSwift        DWARFSourceLanguage = 29
	DWARFSourceLanguageJulia        DWARFSourceLanguage = 30
	DWARFSourceLanguageDylan        DWARFSourceLanguage = 31
	DWARFSourceLanguageCPlusPlus14  DWARFSourceLanguage = 32
	DWARFSourceLanguageFortran03    DWARFSourceLanguage = 33
	DWARFSourceLanguageFortran08    DWARFSourceLanguage = 34
	DWARFSourceLanguageRenderScript DWARFSourceLanguage = 35
	DWARFSourceLanguageBLISS        DWARFSourceLanguage = 36
	DWARFSourceLanguageKotlin       DWARFSourceLanguage = 37
	DWARFSourceLanguageZig          DWARFSourceLanguage = 38
	DWARFSourceLanguageCrystal      DWARFSourceLanguage = 39
	DWARFSourceLanguageCPlusPlus17  DWARFSourceLanguage = 40
	DWARFSourceLanguageCPlusPlus20  DWARFSourceLanguage = 41
	DWARFSourceLanguageC17          DWARFSourceLanguage = 42
	DWARFSourceLanguageFortran18    DWARFSourceLanguage = 43
	DWARFSourceLanguageAda2005      DWARFSourceLanguage = 44
	DWARFSourceLanguageAda2012      DWARFSourceLanguage = 45
	DWARFSourceLanguageHIP          DWARFSourceLanguage = 46
	DWARFSourceLanguageAssembly     DWARFSourceLanguage = 47
	DWARFSourceLanguageCSharp       DWARFSourceLanguage = 48
	DWARFSourceLanguageMojo         DWARFSourceLanguage = 49
	DWARFSourceLanguageGLSL         DWARFSourceLanguage = 50
	DWARFSourceLanguageGLSL_ES      DWARFSourceLanguage = 51
	DWARFSourceLanguageHLSL         DWARFSourceLanguage = 52
	DWARFSourceLanguageOpenCL_CPP   DWARFSourceLanguage = 53
	DWARFSourceLanguageCPPForOpenCL DWARFSourceLanguage = 54
	DWARFSourceLanguageSYCL         DWARFSourceLanguage = 55
	DWARFSourceLanguageRuby         DWARFSourceLanguage = 56
	DWARFSourceLanguageMove         DWARFSourceLanguage = 57
	DWARFSourceLanguageHylo         DWARFSourceLanguage = 58
	DWARFSourceLanguageMetal        DWARFSourceLanguage = 59
	// Vendor extensions:
	DWARFSourceLanguageMips_Assembler      DWARFSourceLanguage = 60
	DWARFSourceLanguageGOOGLE_RenderScript DWARFSourceLanguage = 61
	DWARFSourceLanguageBORLAND_Delphi      DWARFSourceLanguage = 62
)

type DWARFTypeEncoding

type DWARFTypeEncoding = c.Uint

An LLVM DWARF type encoding.

type DbgRecordKind

type DbgRecordKind c.Uint
const (
	DbgRecordLabel   DbgRecordKind = 0
	DbgRecordDeclare DbgRecordKind = 1
	DbgRecordValue   DbgRecordKind = 2
	DbgRecordAssign  DbgRecordKind = 3
)

type DbgRecordRef

type DbgRecordRef = *OpaqueDbgRecord

@see llvm::DbgRecord

func (DbgRecordRef) DbgVariableRecordGetExpression added in v0.3.0

func (self DbgRecordRef) DbgVariableRecordGetExpression() MetadataRef

Get the debug info expression of the DbgVariableRecord.

@see llvm::DbgVariableRecord::getExpression()

llgo:link DbgRecordRef.DbgVariableRecordGetExpression C.LLVMDbgVariableRecordGetExpression

func (DbgRecordRef) DbgVariableRecordGetValue added in v0.3.0

func (self DbgRecordRef) DbgVariableRecordGetValue(OpIdx c.Uint) ValueRef

Get the value of the DbgVariableRecord.

@see llvm::DbgVariableRecord::getValue()

llgo:link DbgRecordRef.DbgVariableRecordGetValue C.LLVMDbgVariableRecordGetValue

func (DbgRecordRef) DbgVariableRecordGetVariable added in v0.3.0

func (self DbgRecordRef) DbgVariableRecordGetVariable() MetadataRef

Get the debug info variable of the DbgVariableRecord.

@see llvm::DbgVariableRecord::getVariable()

llgo:link DbgRecordRef.DbgVariableRecordGetVariable C.LLVMDbgVariableRecordGetVariable

func (DbgRecordRef) DebugLoc added in v0.3.1

func (self DbgRecordRef) DebugLoc() MetadataRef

Get the debug location attached to the debug record.

@see llvm::DbgRecord::getDebugLoc()

llgo:link DbgRecordRef.DebugLoc C.LLVMDbgRecordGetDebugLoc

func (DbgRecordRef) Kind added in v0.3.1

func (self DbgRecordRef) Kind() DbgRecordKind

llgo:link DbgRecordRef.Kind C.LLVMDbgRecordGetKind

func (DbgRecordRef) Next added in v0.3.1

func (self DbgRecordRef) Next() DbgRecordRef

Obtain the next DbgRecord in the sequence or NULL if there are no more.

@see llvm::Instruction::getDbgRecordRange()

llgo:link DbgRecordRef.Next C.LLVMGetNextDbgRecord

func (DbgRecordRef) Previous added in v0.3.1

func (self DbgRecordRef) Previous() DbgRecordRef

Obtain the previous DbgRecord in the sequence or NULL if there are no more.

@see llvm::Instruction::getDbgRecordRange()

llgo:link DbgRecordRef.Previous C.LLVMGetPreviousDbgRecord

func (DbgRecordRef) PrintDbgRecordToString added in v0.3.0

func (self DbgRecordRef) PrintDbgRecordToString() *c.Char

Return a string representation of the DbgRecord. Use LLVMDisposeMessage to free the string.

@see llvm::DbgRecord::print()

llgo:link DbgRecordRef.PrintDbgRecordToString C.LLVMPrintDbgRecordToString

type DiagnosticHandler

type DiagnosticHandler = func(_llcppg_param1 DiagnosticInfoRef, _llcppg_param2 unsafe.Pointer)

llgo:type C

type DiagnosticInfoRef

type DiagnosticInfoRef = *OpaqueDiagnosticInfo

@see llvm::DiagnosticInfo

func (DiagnosticInfoRef) Description added in v0.3.1

func (self DiagnosticInfoRef) Description() *c.Char

Return a string representation of the DiagnosticInfo. Use LLVMDisposeMessage to free the string.

@see DiagnosticInfo::print()

llgo:link DiagnosticInfoRef.Description C.LLVMGetDiagInfoDescription

func (DiagnosticInfoRef) Severity added in v0.3.1

func (self DiagnosticInfoRef) Severity() DiagnosticSeverity

Return an enum LLVMDiagnosticSeverity.

@see DiagnosticInfo::getSeverity()

llgo:link DiagnosticInfoRef.Severity C.LLVMGetDiagInfoSeverity

type DiagnosticSeverity

type DiagnosticSeverity c.Uint
const (
	DSError   DiagnosticSeverity = 0
	DSWarning DiagnosticSeverity = 1
	DSRemark  DiagnosticSeverity = 2
	DSNote    DiagnosticSeverity = 3
)

type DisasmContextRef

type DisasmContextRef uintptr

An opaque reference to a disassembler context.

func CreateDisasm

func CreateDisasm(TripleName *c.Char, DisInfo unsafe.Pointer, TagType c.Int, GetOpInfo OpInfoCallback, SymbolLookUp SymbolLookupCallback) DisasmContextRef

Create a disassembler for the TripleName. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty CPU name and feature set.

func CreateDisasmCPU

func CreateDisasmCPU(Triple *c.Char, CPU *c.Char, DisInfo unsafe.Pointer, TagType c.Int, GetOpInfo OpInfoCallback, SymbolLookUp SymbolLookupCallback) DisasmContextRef

Create a disassembler for the TripleName and a specific CPU. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL. This function is equivalent to calling LLVMCreateDisasmCPUFeatures() with an empty feature set.

func CreateDisasmCPUFeatures

func CreateDisasmCPUFeatures(Triple *c.Char, CPU *c.Char, Features *c.Char, DisInfo unsafe.Pointer, TagType c.Int, GetOpInfo OpInfoCallback, SymbolLookUp SymbolLookupCallback) DisasmContextRef

Create a disassembler for the TripleName, a specific CPU and specific feature string. Symbolic disassembly is supported by passing a block of information in the DisInfo parameter and specifying the TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it returns NULL.

func (DisasmContextRef) Dispose added in v0.2.0

func (self DisasmContextRef) Dispose()

Dispose of a disassembler context.

llgo:link DisasmContextRef.Dispose C.LLVMDisasmDispose

func (DisasmContextRef) Instruction added in v0.2.0

func (self DisasmContextRef) Instruction(Bytes *c.Uint8T, BytesSize c.Uint64T, PC c.Uint64T, OutString *c.Char, OutStringSize c.SizeT) c.SizeT

Disassemble a single instruction using the disassembler context specified in the parameter DC. The bytes of the instruction are specified in the parameter Bytes, and contains at least BytesSize number of bytes. The instruction is at the address specified by the PC parameter. If a valid instruction can be disassembled, its string is returned indirectly in OutString whose size is specified in the parameter OutStringSize. This function returns the number of bytes in the instruction or zero if there was no valid instruction.

llgo:link DisasmContextRef.Instruction C.LLVMDisasmInstruction

func (DisasmContextRef) SetOptions added in v0.2.0

func (self DisasmContextRef) SetOptions(Options c.Uint64T) c.Int

Set the disassembler's options. Returns 1 if it can set the Options and 0 otherwise.

llgo:link DisasmContextRef.SetOptions C.LLVMSetDisasmOptions

type ErrorRef

type ErrorRef = *OpaqueError

Opaque reference to an error instance. Null serves as the 'success' value.

func CreateStringError

func CreateStringError(ErrMsg *c.Char) ErrorRef

Create a StringError.

func OrcCreateDynamicLibrarySearchGeneratorForPath

func OrcCreateDynamicLibrarySearchGeneratorForPath(Result *OrcDefinitionGeneratorRef, FileName *c.Char, GlobalPrefix c.Char, Filter OrcSymbolPredicate, FilterCtx unsafe.Pointer) ErrorRef

Get a LLVMOrcCreateDynamicLibararySearchGeneratorForPath that will reflect library symbols into the JITDylib. On success the resulting generator is owned by the client. Ownership is typically transferred by adding the instance to a JITDylib using LLVMOrcJITDylibAddGenerator,

The GlobalPrefix argument specifies the character that appears on the front of linker-mangled symbols for the target platform (e.g. '_' on MachO). If non-null, this character will be stripped from the start of all symbol strings before passing the remaining substring to dlsym.

The optional Filter and Ctx arguments can be used to supply a symbol name filter: Only symbols for which the filter returns true will be visible to JIT'd code. If the Filter argument is null then all library symbols will be visible to JIT'd code. Note that the symbol name passed to the Filter function is the full mangled symbol: The client is responsible for stripping the global prefix if present.

THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!

func OrcCreateDynamicLibrarySearchGeneratorForProcess

func OrcCreateDynamicLibrarySearchGeneratorForProcess(Result *OrcDefinitionGeneratorRef, GlobalPrefx c.Char, Filter OrcSymbolPredicate, FilterCtx unsafe.Pointer) ErrorRef

Get a DynamicLibrarySearchGenerator that will reflect process symbols into the JITDylib. On success the resulting generator is owned by the client. Ownership is typically transferred by adding the instance to a JITDylib using LLVMOrcJITDylibAddGenerator,

The GlobalPrefix argument specifies the character that appears on the front of linker-mangled symbols for the target platform (e.g. '_' on MachO). If non-null, this character will be stripped from the start of all symbol strings before passing the remaining substring to dlsym.

The optional Filter and Ctx arguments can be used to supply a symbol name filter: Only symbols for which the filter returns true will be visible to JIT'd code. If the Filter argument is null then all process symbols will be visible to JIT'd code. Note that the symbol name passed to the Filter function is the full mangled symbol: The client is responsible for stripping the global prefix if present.

func OrcCreateLLJIT added in v0.3.0

func OrcCreateLLJIT(Result *OrcLLJITRef, Builder OrcLLJITBuilderRef) ErrorRef

Create an LLJIT instance from an LLJITBuilder.

This operation takes ownership of the Builder argument: clients should not dispose of the builder after calling this function (even if the function returns an error). If a null Builder argument is provided then a default-constructed LLJITBuilder will be used.

On success the resulting LLJIT instance is uniquely owned by the client and automatically manages the memory of all JIT'd code and all modules that are transferred to it (e.g. via LLVMOrcLLJITAddLLVMIRModule). Disposing of the LLJIT instance will free all memory managed by the JIT, including JIT'd code and not-yet compiled modules.

func OrcCreateLocalLazyCallThroughManager

func OrcCreateLocalLazyCallThroughManager(TargetTriple *c.Char, ES OrcExecutionSessionRef, ErrorHandlerAddr OrcJITTargetAddress, LCTM *OrcLazyCallThroughManagerRef) ErrorRef

func OrcCreateObjectLinkingLayerWithInProcessMemoryManager added in v0.3.0

func OrcCreateObjectLinkingLayerWithInProcessMemoryManager(Result *OrcObjectLayerRef, ES OrcExecutionSessionRef) ErrorRef

Create a ObjectLinkingLayer instance using the standard JITLink InProcessMemoryManager for memory management.

func OrcCreateStaticLibrarySearchGeneratorForPath added in v0.3.0

func OrcCreateStaticLibrarySearchGeneratorForPath(Result *OrcDefinitionGeneratorRef, ObjLayer OrcObjectLayerRef, FileName *c.Char) ErrorRef

Get a LLVMOrcCreateStaticLibrarySearchGeneratorForPath that will reflect static library symbols into the JITDylib. On success the resulting generator is owned by the client. Ownership is typically transferred by adding the instance to a JITDylib using LLVMOrcJITDylibAddGenerator,

Call with the optional TargetTriple argument will succeed if the file at the given path is a static library or a MachO universal binary containing a static library that is compatible with the given triple. Otherwise it will return an error.

THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!

func OrcJITTargetMachineBuilderDetectHost added in v0.3.0

func OrcJITTargetMachineBuilderDetectHost(Result *OrcJITTargetMachineBuilderRef) ErrorRef

Create a JITTargetMachineBuilder by detecting the host.

On success the client owns the resulting JITTargetMachineBuilder. It must be passed to a consuming operation (e.g. LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

func (ErrorRef) CantFail added in v0.3.0

func (self ErrorRef) CantFail()

Report a fatal error if Err is a failure value.

This function can be used to wrap calls to fallible functions ONLY when it is known that the Error will always be a success value.

llgo:link ErrorRef.CantFail C.LLVMCantFail

func (ErrorRef) Consume added in v0.3.1

func (self ErrorRef) Consume()

Dispose of the given error without handling it. This operation consumes the error, and the given LLVMErrorRef value is not usable once this call returns. Note: This method *only* needs to be called if the error is not being passed to some other consuming operation, e.g. LLVMGetErrorMessage.

llgo:link ErrorRef.Consume C.LLVMConsumeError

func (ErrorRef) Message added in v0.3.1

func (self ErrorRef) Message() *c.Char

Returns the given string's error message. This operation consumes the error, and the given LLVMErrorRef value is not usable once this call returns. The caller is responsible for disposing of the string by calling LLVMDisposeErrorMessage.

llgo:link ErrorRef.Message C.LLVMGetErrorMessage

func (ErrorRef) TypeId added in v0.3.1

func (self ErrorRef) TypeId() ErrorTypeId

Returns the type id for the given error instance, which must be a failure value (i.e. non-null).

llgo:link ErrorRef.TypeId C.LLVMGetErrorTypeId

type ErrorTypeId

type ErrorTypeId uintptr

Error type identifier.

func GetStringErrorTypeId

func GetStringErrorTypeId() ErrorTypeId

Returns the type id for llvm StringError.

type ExecutionEngineRef

type ExecutionEngineRef = *OpaqueExecutionEngine

func (ExecutionEngineRef) AddGlobalMapping added in v0.3.0

func (self ExecutionEngineRef) AddGlobalMapping(Global ValueRef, Addr unsafe.Pointer)

llgo:link ExecutionEngineRef.AddGlobalMapping C.LLVMAddGlobalMapping

func (ExecutionEngineRef) AddModule added in v0.3.0

func (self ExecutionEngineRef) AddModule(M ModuleRef)

llgo:link ExecutionEngineRef.AddModule C.LLVMAddModule

func (ExecutionEngineRef) Dispose added in v0.3.1

func (self ExecutionEngineRef) Dispose()

llgo:link ExecutionEngineRef.Dispose C.LLVMDisposeExecutionEngine

func (ExecutionEngineRef) ErrMsg added in v0.3.1

func (self ExecutionEngineRef) ErrMsg(OutError **c.Char) Bool

Returns true on error, false on success. If true is returned then the error message is copied to OutStr and cleared in the ExecutionEngine instance.

llgo:link ExecutionEngineRef.ErrMsg C.LLVMExecutionEngineGetErrMsg

func (ExecutionEngineRef) FindFunction added in v0.3.0

func (self ExecutionEngineRef) FindFunction(Name *c.Char, OutFn *ValueRef) Bool

llgo:link ExecutionEngineRef.FindFunction C.LLVMFindFunction

func (ExecutionEngineRef) FreeMachineCodeForFunction added in v0.3.0

func (self ExecutionEngineRef) FreeMachineCodeForFunction(F ValueRef)

llgo:link ExecutionEngineRef.FreeMachineCodeForFunction C.LLVMFreeMachineCodeForFunction

func (ExecutionEngineRef) FunctionAddress added in v0.3.0

func (self ExecutionEngineRef) FunctionAddress(Name *c.Char) c.Uint64T

llgo:link ExecutionEngineRef.FunctionAddress C.LLVMGetFunctionAddress

func (ExecutionEngineRef) GlobalValueAddress added in v0.3.0

func (self ExecutionEngineRef) GlobalValueAddress(Name *c.Char) c.Uint64T

llgo:link ExecutionEngineRef.GlobalValueAddress C.LLVMGetGlobalValueAddress

func (ExecutionEngineRef) PointerToGlobal added in v0.3.0

func (self ExecutionEngineRef) PointerToGlobal(Global ValueRef) unsafe.Pointer

llgo:link ExecutionEngineRef.PointerToGlobal C.LLVMGetPointerToGlobal

func (ExecutionEngineRef) RecompileAndRelinkFunction added in v0.3.0

func (self ExecutionEngineRef) RecompileAndRelinkFunction(Fn ValueRef) unsafe.Pointer

llgo:link ExecutionEngineRef.RecompileAndRelinkFunction C.LLVMRecompileAndRelinkFunction

func (ExecutionEngineRef) RemoveModule added in v0.3.0

func (self ExecutionEngineRef) RemoveModule(M ModuleRef, OutMod *ModuleRef, OutError **c.Char) Bool

llgo:link ExecutionEngineRef.RemoveModule C.LLVMRemoveModule

func (ExecutionEngineRef) RunFunction added in v0.3.0

func (self ExecutionEngineRef) RunFunction(F ValueRef, NumArgs c.Uint, Args *GenericValueRef) GenericValueRef

llgo:link ExecutionEngineRef.RunFunction C.LLVMRunFunction

func (ExecutionEngineRef) RunFunctionAsMain added in v0.3.0

func (self ExecutionEngineRef) RunFunctionAsMain(F ValueRef, ArgC c.Uint, ArgV **c.Char, EnvP **c.Char) c.Int

llgo:link ExecutionEngineRef.RunFunctionAsMain C.LLVMRunFunctionAsMain

func (ExecutionEngineRef) RunStaticConstructors added in v0.3.0

func (self ExecutionEngineRef) RunStaticConstructors()

llgo:link ExecutionEngineRef.RunStaticConstructors C.LLVMRunStaticConstructors

func (ExecutionEngineRef) RunStaticDestructors added in v0.3.0

func (self ExecutionEngineRef) RunStaticDestructors()

llgo:link ExecutionEngineRef.RunStaticDestructors C.LLVMRunStaticDestructors

func (ExecutionEngineRef) TargetData added in v0.3.1

func (self ExecutionEngineRef) TargetData() TargetDataRef

llgo:link ExecutionEngineRef.TargetData C.LLVMGetExecutionEngineTargetData

func (ExecutionEngineRef) TargetMachine added in v0.3.1

func (self ExecutionEngineRef) TargetMachine() TargetMachineRef

llgo:link ExecutionEngineRef.TargetMachine C.LLVMGetExecutionEngineTargetMachine

type FastMathFlags

type FastMathFlags = c.Uint

Flags to indicate what fast-math-style optimizations are allowed on operations.

See https://llvm.org/docs/LangRef.html#fast-math-flags

type FatalErrorHandler

type FatalErrorHandler = func(_llcppg_param1 *c.Char)

llgo:type C

type GEPNoWrapFlags

type GEPNoWrapFlags = c.Uint

Flags that constrain the allowed wrap semantics of a getelementptr instruction.

See https://llvm.org/docs/LangRef.html#getelementptr-instruction

type GenericValueRef

type GenericValueRef = *OpaqueGenericValue

func CreateGenericValueOfPointer

func CreateGenericValueOfPointer(P unsafe.Pointer) GenericValueRef

func (GenericValueRef) Dispose added in v0.3.1

func (self GenericValueRef) Dispose()

llgo:link GenericValueRef.Dispose C.LLVMDisposeGenericValue

func (GenericValueRef) IntWidth added in v0.3.1

func (self GenericValueRef) IntWidth() c.Uint

llgo:link GenericValueRef.IntWidth C.LLVMGenericValueIntWidth

func (GenericValueRef) ToInt added in v0.3.1

func (self GenericValueRef) ToInt(IsSigned Bool) c.UlongLong

llgo:link GenericValueRef.ToInt C.LLVMGenericValueToInt

func (GenericValueRef) ToPointer added in v0.3.1

func (self GenericValueRef) ToPointer() unsafe.Pointer

llgo:link GenericValueRef.ToPointer C.LLVMGenericValueToPointer

type GlobalISelAbortMode

type GlobalISelAbortMode c.Uint
const (
	GlobalISelAbortEnable          GlobalISelAbortMode = 0
	GlobalISelAbortDisable         GlobalISelAbortMode = 1
	GlobalISelAbortDisableWithDiag GlobalISelAbortMode = 2
)

type InlineAsmDialect

type InlineAsmDialect c.Uint
const (
	InlineAsmDialectATT   InlineAsmDialect = 0
	InlineAsmDialectIntel InlineAsmDialect = 1
)

type IntPredicate

type IntPredicate c.Uint
const (
	IntEQ  IntPredicate = 32
	IntNE  IntPredicate = 33
	IntUGT IntPredicate = 34
	IntUGE IntPredicate = 35
	IntULT IntPredicate = 36
	IntULE IntPredicate = 37
	IntSGT IntPredicate = 38
	IntSGE IntPredicate = 39
	IntSLT IntPredicate = 40
	// < signed less or equal
	IntSLE IntPredicate = 41
)

type JITEvaluatedSymbol

type JITEvaluatedSymbol struct {
	Address OrcExecutorAddress
	Flags   JITSymbolFlags
}

Represents an evaluated symbol address and flags.

type JITEventListenerRef

type JITEventListenerRef = *OpaqueJITEventListener

@see llvm::JITEventListener

func CreateGDBRegistrationListener

func CreateGDBRegistrationListener() JITEventListenerRef

func CreateIntelJITEventListener

func CreateIntelJITEventListener() JITEventListenerRef

func CreateOProfileJITEventListener

func CreateOProfileJITEventListener() JITEventListenerRef

func CreatePerfJITEventListener

func CreatePerfJITEventListener() JITEventListenerRef

type JITSymbolFlags

type JITSymbolFlags struct {
	GenericFlags c.Uint8T
	TargetFlags  c.Uint8T
}

Represents the linkage flags for a symbol definition.

type JITSymbolGenericFlags

type JITSymbolGenericFlags c.Uint

Represents generic linkage flags for a symbol definition.

const (
	JITSymbolGenericFlagsNone                           JITSymbolGenericFlags = 0
	JITSymbolGenericFlagsExported                       JITSymbolGenericFlags = 1
	JITSymbolGenericFlagsWeak                           JITSymbolGenericFlags = 2
	JITSymbolGenericFlagsCallable                       JITSymbolGenericFlags = 4
	JITSymbolGenericFlagsMaterializationSideEffectsOnly JITSymbolGenericFlags = 8
)

type JITSymbolTargetFlags

type JITSymbolTargetFlags = c.Uint8T

Represents target specific flags for a symbol definition.

type LTOObjectBuffer

type LTOObjectBuffer struct {
	Buffer *c.Char
	Size   c.SizeT
}

Type to wrap a single object returned by ThinLTO.

\since LTO_API_VERSION=18

type Linkage

type Linkage c.Uint
const (
	ExternalLinkage            Linkage = 0
	AvailableExternallyLinkage Linkage = 1
	LinkOnceAnyLinkage         Linkage = 2
	LinkOnceODRLinkage         Linkage = 3
	LinkOnceODRAutoHideLinkage Linkage = 4
	WeakAnyLinkage             Linkage = 5
	WeakODRLinkage             Linkage = 6
	AppendingLinkage           Linkage = 7
	InternalLinkage            Linkage = 8
	PrivateLinkage             Linkage = 9
	DLLImportLinkage           Linkage = 10
	DLLExportLinkage           Linkage = 11
	ExternalWeakLinkage        Linkage = 12
	GhostLinkage               Linkage = 13
	CommonLinkage              Linkage = 14
	LinkerPrivateLinkage       Linkage = 15
	// < Like LinkerPrivate, but is weak.
	LinkerPrivateWeakLinkage Linkage = 16
)

type LinkerMode

type LinkerMode c.Uint

This enum is provided for backwards-compatibility only. It has no effect.

const (
	LinkerDestroySource LinkerMode = 0
	// This option has been deprecated and
	// should not be used.
	LinkerPreserveSource_Removed LinkerMode = 1
)

type LtoBoolT

type LtoBoolT = bool

func LtoModuleHasObjcCategory

func LtoModuleHasObjcCategory(mem unsafe.Pointer, length c.SizeT) LtoBoolT

Return true if \p Buffer contains a bitcode file with ObjC code (category or class) in it.

\since LTO_API_VERSION=20

func LtoModuleIsObjectFile

func LtoModuleIsObjectFile(path *c.Char) LtoBoolT

Checks if a file is a loadable object file.

\since prior to LTO_API_VERSION=3

func LtoModuleIsObjectFileForTarget

func LtoModuleIsObjectFileForTarget(path *c.Char, target_triple_prefix *c.Char) LtoBoolT

Checks if a file is a loadable object compiled for requested target.

\since prior to LTO_API_VERSION=3

func LtoModuleIsObjectFileInMemory

func LtoModuleIsObjectFileInMemory(mem unsafe.Pointer, length c.SizeT) LtoBoolT

Checks if a buffer is a loadable object file.

\since prior to LTO_API_VERSION=3

func LtoModuleIsObjectFileInMemoryForTarget

func LtoModuleIsObjectFileInMemoryForTarget(mem unsafe.Pointer, length c.SizeT, target_triple_prefix *c.Char) LtoBoolT

Checks if a buffer is a loadable object compiled for requested target.

\since prior to LTO_API_VERSION=3

type LtoCodeGenT

type LtoCodeGenT = *OpaqueLTOCodeGenerator

opaque reference to a code generator

func LtoCodegenCreate

func LtoCodegenCreate() LtoCodeGenT

Instantiates a code generator. Returns NULL on error (check lto_get_error_message() for details).

All modules added using \a lto_codegen_add_module() must have been created in the same context as the codegen.

\since prior to LTO_API_VERSION=3

func LtoCodegenCreateInLocalContext

func LtoCodegenCreateInLocalContext() LtoCodeGenT

Instantiate a code generator in its own context.

Instantiates a code generator in its own context. Modules added via \a lto_codegen_add_module() must have all been created in the same context, using \a lto_module_create_in_codegen_context().

\since LTO_API_VERSION=11

func (LtoCodeGenT) AddModule added in v0.3.1

func (self LtoCodeGenT) AddModule(mod LtoModuleT) LtoBoolT

Add an object module to the set of modules for which code will be generated. Returns true on error (check lto_get_error_message() for details).

\c cg and \c mod must both be in the same context. See \a lto_codegen_create_in_local_context() and \a lto_module_create_in_codegen_context().

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.AddModule C.lto_codegen_add_module

func (LtoCodeGenT) AddMustPreserveSymbol added in v0.3.1

func (self LtoCodeGenT) AddMustPreserveSymbol(symbol *c.Char)

Adds to a list of all global symbols that must exist in the final generated code. If a function is not listed there, it might be inlined into every usage and optimized away.

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.AddMustPreserveSymbol C.lto_codegen_add_must_preserve_symbol

func (LtoCodeGenT) Compile added in v0.3.1

func (self LtoCodeGenT) Compile(length *c.SizeT) unsafe.Pointer

Generates code for all added modules into one native object file. This calls lto_codegen_optimize then lto_codegen_compile_optimized.

On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details).

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.Compile C.lto_codegen_compile

func (LtoCodeGenT) CompileOptimized added in v0.3.1

func (self LtoCodeGenT) CompileOptimized(length *c.SizeT) unsafe.Pointer

Generates code for the optimized merged module into one native object file. It will not run any IR optimizations on the merged module.

On success returns a pointer to a generated mach-o/ELF buffer and length set to the buffer size. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile_optimized() is called again. On failure, returns NULL (check lto_get_error_message() for details).

\since LTO_API_VERSION=12

llgo:link LtoCodeGenT.CompileOptimized C.lto_codegen_compile_optimized

func (LtoCodeGenT) CompileToFile added in v0.3.1

func (self LtoCodeGenT) CompileToFile(name **c.Char) LtoBoolT

Generates code for all added modules into one native object file. This calls lto_codegen_optimize then lto_codegen_compile_optimized (instead of returning a generated mach-o/ELF buffer, it writes to a file).

The name of the file is written to name. Returns true on error.

\since LTO_API_VERSION=5

llgo:link LtoCodeGenT.CompileToFile C.lto_codegen_compile_to_file

func (LtoCodeGenT) DebugOptions added in v0.3.1

func (self LtoCodeGenT) DebugOptions(_llcppg_param2 *c.Char)

Sets options to help debug codegen bugs. Since parsing shud only happen once, only one of lto_codegen_debug_options or lto_set_debug_options should be called.

This function takes one or more options separated by spaces. Warning: passing file paths through this function may confuse the argument parser if the paths contain spaces.

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.DebugOptions C.lto_codegen_debug_options

func (LtoCodeGenT) DebugOptionsArray added in v0.3.1

func (self LtoCodeGenT) DebugOptionsArray(_llcppg_param2 **c.Char, number c.Int)

Same as the previous function, but takes every option separately through an array.

\since prior to LTO_API_VERSION=26

llgo:link LtoCodeGenT.DebugOptionsArray C.lto_codegen_debug_options_array

func (LtoCodeGenT) Dispose added in v0.3.1

func (self LtoCodeGenT) Dispose()

Frees all code generator and all memory it internally allocated. Upon return the lto_code_gen_t is no longer valid.

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.Dispose C.lto_codegen_dispose

func (LtoCodeGenT) Optimize added in v0.3.1

func (self LtoCodeGenT) Optimize() LtoBoolT

Runs optimization for the merged module. Returns true on error.

\since LTO_API_VERSION=12

llgo:link LtoCodeGenT.Optimize C.lto_codegen_optimize

func (LtoCodeGenT) SetAssemblerArgs added in v0.3.1

func (self LtoCodeGenT) SetAssemblerArgs(args **c.Char, nargs c.Int)

Sets extra arguments that libLTO should pass to the assembler.

\since LTO_API_VERSION=4

llgo:link LtoCodeGenT.SetAssemblerArgs C.lto_codegen_set_assembler_args

func (LtoCodeGenT) SetAssemblerPath added in v0.3.1

func (self LtoCodeGenT) SetAssemblerPath(path *c.Char)

Sets the location of the assembler tool to run. If not set, libLTO will use gcc to invoke the assembler.

\since LTO_API_VERSION=3

llgo:link LtoCodeGenT.SetAssemblerPath C.lto_codegen_set_assembler_path

func (LtoCodeGenT) SetCpu added in v0.3.1

func (self LtoCodeGenT) SetCpu(cpu *c.Char)

Sets the cpu to generate code for.

\since LTO_API_VERSION=4

llgo:link LtoCodeGenT.SetCpu C.lto_codegen_set_cpu

func (LtoCodeGenT) SetDebugModel added in v0.3.1

func (self LtoCodeGenT) SetDebugModel(_llcppg_param2 LtoDebugModel) LtoBoolT

Sets if debug info should be generated. Returns true on error (check lto_get_error_message() for details).

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.SetDebugModel C.lto_codegen_set_debug_model

func (LtoCodeGenT) SetDiagnosticHandler added in v0.3.1

func (self LtoCodeGenT) SetDiagnosticHandler(_llcppg_param2 LtoDiagnosticHandlerT, _llcppg_param3 unsafe.Pointer)

Set a diagnostic handler and the related context (void *). This is more general than lto_get_error_message, as the diagnostic handler can be called at anytime within lto.

\since LTO_API_VERSION=7

llgo:link LtoCodeGenT.SetDiagnosticHandler C.lto_codegen_set_diagnostic_handler

func (LtoCodeGenT) SetModule added in v0.3.1

func (self LtoCodeGenT) SetModule(mod LtoModuleT)

Sets the object module for code generation. This will transfer the ownership of the module to the code generator.

\c cg and \c mod must both be in the same context.

\since LTO_API_VERSION=13

llgo:link LtoCodeGenT.SetModule C.lto_codegen_set_module

func (LtoCodeGenT) SetPicModel added in v0.3.1

func (self LtoCodeGenT) SetPicModel(_llcppg_param2 LtoCodegenModel) LtoBoolT

Sets which PIC code model to generated. Returns true on error (check lto_get_error_message() for details).

\since prior to LTO_API_VERSION=3

llgo:link LtoCodeGenT.SetPicModel C.lto_codegen_set_pic_model

func (LtoCodeGenT) SetShouldEmbedUselists added in v0.3.1

func (self LtoCodeGenT) SetShouldEmbedUselists(ShouldEmbedUselists LtoBoolT)

Set whether to embed uselists in bitcode.

Sets whether \a lto_codegen_write_merged_modules() should embed uselists in output bitcode. This should be turned on for all -save-temps output.

\since LTO_API_VERSION=15

llgo:link LtoCodeGenT.SetShouldEmbedUselists C.lto_codegen_set_should_embed_uselists

func (LtoCodeGenT) SetShouldInternalize added in v0.3.1

func (self LtoCodeGenT) SetShouldInternalize(ShouldInternalize LtoBoolT)

Sets if we should run internalize pass during optimization and code generation.

\since LTO_API_VERSION=14

llgo:link LtoCodeGenT.SetShouldInternalize C.lto_codegen_set_should_internalize

func (LtoCodeGenT) WriteMergedModules added in v0.3.1

func (self LtoCodeGenT) WriteMergedModules(path *c.Char) LtoBoolT

Writes a new object file at the specified path that contains the merged contents of all modules added so far. Returns true on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=5

llgo:link LtoCodeGenT.WriteMergedModules C.lto_codegen_write_merged_modules

type LtoCodegenDiagnosticSeverityT

type LtoCodegenDiagnosticSeverityT c.Uint

Diagnostic severity.

\since LTO_API_VERSION=7

const (
	LTO_DS_ERROR   LtoCodegenDiagnosticSeverityT = 0
	LTO_DS_WARNING LtoCodegenDiagnosticSeverityT = 1
	LTO_DS_REMARK  LtoCodegenDiagnosticSeverityT = 3
	LTO_DS_NOTE    LtoCodegenDiagnosticSeverityT = 2
)

type LtoCodegenModel

type LtoCodegenModel c.Uint

\since prior to LTO_API_VERSION=3

const (
	LTO_CODEGEN_PIC_MODEL_STATIC         LtoCodegenModel = 0
	LTO_CODEGEN_PIC_MODEL_DYNAMIC        LtoCodegenModel = 1
	LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC LtoCodegenModel = 2
	LTO_CODEGEN_PIC_MODEL_DEFAULT        LtoCodegenModel = 3
)

type LtoDebugModel

type LtoDebugModel c.Uint

\since prior to LTO_API_VERSION=3

const (
	LTO_DEBUG_MODEL_NONE  LtoDebugModel = 0
	LTO_DEBUG_MODEL_DWARF LtoDebugModel = 1
)

type LtoDiagnosticHandlerT

type LtoDiagnosticHandlerT = func(_llcppg_param1 LtoCodegenDiagnosticSeverityT, _llcppg_param2 *c.Char, _llcppg_param3 unsafe.Pointer)

Diagnostic handler type. \p severity defines the severity. \p diag is the actual diagnostic. The diagnostic is not prefixed by any of severity keyword, e.g., 'error: '. \p ctxt is used to pass the context set with the diagnostic handler.

\since LTO_API_VERSION=7

llgo:type C

type LtoInputT

type LtoInputT = *OpaqueLTOInput

Opaque reference to an LTO input file

func LtoInputCreate

func LtoInputCreate(buffer unsafe.Pointer, buffer_size c.SizeT, path *c.Char) LtoInputT

Creates an LTO input file from a buffer. The path argument is used for diagnotics as this function otherwise does not know which file the given buffer is associated with.

\since LTO_API_VERSION=24

func (LtoInputT) DependentLibrary added in v0.3.1

func (self LtoInputT) DependentLibrary(index c.SizeT, size *c.SizeT) *c.Char

Returns the ith dependent library specifier for the given LTO input file. The returned string is not null-terminated.

\since LTO_API_VERSION=24

llgo:link LtoInputT.DependentLibrary C.lto_input_get_dependent_library

func (LtoInputT) Dispose added in v0.3.1

func (self LtoInputT) Dispose()

Frees all memory internally allocated by the LTO input file. Upon return the lto_module_t is no longer valid.

\since LTO_API_VERSION=24

llgo:link LtoInputT.Dispose C.lto_input_dispose

func (LtoInputT) NumDependentLibraries added in v0.3.1

func (self LtoInputT) NumDependentLibraries() c.Uint

Returns the number of dependent library specifiers for the given LTO input file.

\since LTO_API_VERSION=24

llgo:link LtoInputT.NumDependentLibraries C.lto_input_get_num_dependent_libraries

type LtoModuleT

type LtoModuleT = *OpaqueLTOModule

opaque reference to a loaded object module

func LtoModuleCreate

func LtoModuleCreate(path *c.Char) LtoModuleT

Loads an object file from disk. Returns NULL on error (check lto_get_error_message() for details).

\since prior to LTO_API_VERSION=3

func LtoModuleCreateFromFd

func LtoModuleCreateFromFd(fd c.Int, path *c.Char, file_size c.SizeT) LtoModuleT

Loads an object file from disk. The seek point of fd is not preserved. Returns NULL on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=5

func LtoModuleCreateFromFdAtOffset

func LtoModuleCreateFromFdAtOffset(fd c.Int, path *c.Char, file_size c.SizeT, map_size c.SizeT, offset os.OffT) LtoModuleT

Loads an object file from disk. The seek point of fd is not preserved. Returns NULL on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=5

func LtoModuleCreateFromMemory

func LtoModuleCreateFromMemory(mem unsafe.Pointer, length c.SizeT) LtoModuleT

Loads an object file from memory. Returns NULL on error (check lto_get_error_message() for details).

\since prior to LTO_API_VERSION=3

func LtoModuleCreateFromMemoryWithPath

func LtoModuleCreateFromMemoryWithPath(mem unsafe.Pointer, length c.SizeT, path *c.Char) LtoModuleT

Loads an object file from memory with an extra path argument. Returns NULL on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=9

func LtoModuleCreateInCodegenContext

func LtoModuleCreateInCodegenContext(mem unsafe.Pointer, length c.SizeT, path *c.Char, cg LtoCodeGenT) LtoModuleT

Loads an object file in the codegen context.

Loads an object file into the same context as \c cg. The module is safe to add using \a lto_codegen_add_module().

Returns NULL on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=11

func LtoModuleCreateInLocalContext

func LtoModuleCreateInLocalContext(mem unsafe.Pointer, length c.SizeT, path *c.Char) LtoModuleT

Loads an object file in its own context.

Loads an object file in its own LLVMContext. This function call is thread-safe. However, modules created this way should not be merged into an lto_code_gen_t using \a lto_codegen_add_module().

Returns NULL on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=11

func (LtoModuleT) AsmUndefSymbolName added in v0.3.1

func (self LtoModuleT) AsmUndefSymbolName(index c.Uint) *c.Char

Returns the name of the ith asm undefined symbol in the object module.

\since prior to LTO_API_VERSION=30

llgo:link LtoModuleT.AsmUndefSymbolName C.lto_module_get_asm_undef_symbol_name

func (LtoModuleT) Dispose added in v0.3.1

func (self LtoModuleT) Dispose()

Frees all memory internally allocated by the module. Upon return the lto_module_t is no longer valid.

\since prior to LTO_API_VERSION=3

llgo:link LtoModuleT.Dispose C.lto_module_dispose

func (LtoModuleT) HasCtorDtor added in v0.3.1

func (self LtoModuleT) HasCtorDtor() LtoBoolT

This function can be used by the linker to check if a given module has any constructor or destructor functions.

Returns true if the module has either the @llvm.global_ctors or the @llvm.global_dtors symbol. Otherwise returns false.

\since LTO_API_VERSION=29

llgo:link LtoModuleT.HasCtorDtor C.lto_module_has_ctor_dtor

func (LtoModuleT) IsThinlto added in v0.3.1

func (self LtoModuleT) IsThinlto() LtoBoolT

Test if a module has support for ThinLTO linking.

\since LTO_API_VERSION=18

llgo:link LtoModuleT.IsThinlto C.lto_module_is_thinlto

func (LtoModuleT) Linkeropts added in v0.3.1

func (self LtoModuleT) Linkeropts() *c.Char

Returns the module's linker options.

The linker options may consist of multiple flags. It is the linker's responsibility to split the flags using a platform-specific mechanism.

\since LTO_API_VERSION=16

llgo:link LtoModuleT.Linkeropts C.lto_module_get_linkeropts

func (LtoModuleT) MachoCputype added in v0.3.1

func (self LtoModuleT) MachoCputype(out_cputype *c.Uint, out_cpusubtype *c.Uint) LtoBoolT

If targeting mach-o on darwin, this function gets the CPU type and subtype that will end up being encoded in the mach-o header. These are the values that can be found in mach/machine.h.

\p out_cputype and \p out_cpusubtype must be non-NULL.

Returns true on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=27

llgo:link LtoModuleT.MachoCputype C.lto_module_get_macho_cputype

func (LtoModuleT) NumAsmUndefSymbols added in v0.3.1

func (self LtoModuleT) NumAsmUndefSymbols() c.Uint

Returns the number of asm undefined symbols in the object module.

\since prior to LTO_API_VERSION=30

llgo:link LtoModuleT.NumAsmUndefSymbols C.lto_module_get_num_asm_undef_symbols

func (LtoModuleT) NumSymbols added in v0.3.1

func (self LtoModuleT) NumSymbols() c.Uint

Returns the number of symbols in the object module.

\since prior to LTO_API_VERSION=3

llgo:link LtoModuleT.NumSymbols C.lto_module_get_num_symbols

func (LtoModuleT) SetTargetTriple added in v0.3.1

func (self LtoModuleT) SetTargetTriple(triple *c.Char)

Sets triple string with which the object will be codegened.

\since LTO_API_VERSION=4

llgo:link LtoModuleT.SetTargetTriple C.lto_module_set_target_triple

func (LtoModuleT) SymbolAttribute added in v0.3.1

func (self LtoModuleT) SymbolAttribute(index c.Uint) LtoSymbolAttributes

Returns the attributes of the ith symbol in the object module.

\since prior to LTO_API_VERSION=3

llgo:link LtoModuleT.SymbolAttribute C.lto_module_get_symbol_attribute

func (LtoModuleT) SymbolName added in v0.3.1

func (self LtoModuleT) SymbolName(index c.Uint) *c.Char

Returns the name of the ith symbol in the object module.

\since prior to LTO_API_VERSION=3

llgo:link LtoModuleT.SymbolName C.lto_module_get_symbol_name

func (LtoModuleT) TargetTriple added in v0.3.1

func (self LtoModuleT) TargetTriple() *c.Char

Returns triple string which the object module was compiled under.

\since prior to LTO_API_VERSION=3

llgo:link LtoModuleT.TargetTriple C.lto_module_get_target_triple

type LtoSymbolAttributes

type LtoSymbolAttributes c.Uint

\since prior to LTO_API_VERSION=3

const (
	LTO_SYMBOL_ALIGNMENT_MASK              LtoSymbolAttributes = 31
	LTO_SYMBOL_PERMISSIONS_MASK            LtoSymbolAttributes = 224
	LTO_SYMBOL_PERMISSIONS_CODE            LtoSymbolAttributes = 160
	LTO_SYMBOL_PERMISSIONS_DATA            LtoSymbolAttributes = 192
	LTO_SYMBOL_PERMISSIONS_RODATA          LtoSymbolAttributes = 128
	LTO_SYMBOL_DEFINITION_MASK             LtoSymbolAttributes = 1792
	LTO_SYMBOL_DEFINITION_REGULAR          LtoSymbolAttributes = 256
	LTO_SYMBOL_DEFINITION_TENTATIVE        LtoSymbolAttributes = 512
	LTO_SYMBOL_DEFINITION_WEAK             LtoSymbolAttributes = 768
	LTO_SYMBOL_DEFINITION_UNDEFINED        LtoSymbolAttributes = 1024
	LTO_SYMBOL_DEFINITION_WEAKUNDEF        LtoSymbolAttributes = 1280
	LTO_SYMBOL_SCOPE_MASK                  LtoSymbolAttributes = 14336
	LTO_SYMBOL_SCOPE_INTERNAL              LtoSymbolAttributes = 2048
	LTO_SYMBOL_SCOPE_HIDDEN                LtoSymbolAttributes = 4096
	LTO_SYMBOL_SCOPE_PROTECTED             LtoSymbolAttributes = 8192
	LTO_SYMBOL_SCOPE_DEFAULT               LtoSymbolAttributes = 6144
	LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN LtoSymbolAttributes = 10240
	LTO_SYMBOL_COMDAT                      LtoSymbolAttributes = 16384
	LTO_SYMBOL_ALIAS                       LtoSymbolAttributes = 32768
)

type MCJITCompilerOptions

type MCJITCompilerOptions struct {
	OptLevel           c.Uint
	CodeModel          CodeModel
	NoFramePointerElim Bool
	EnableFastISel     Bool
	MCJMM              MCJITMemoryManagerRef
}

func (*MCJITCompilerOptions) Initialize

func (self *MCJITCompilerOptions) Initialize(SizeOfOptions c.SizeT)

llgo:link (*MCJITCompilerOptions).Initialize C.LLVMInitializeMCJITCompilerOptions

type MCJITMemoryManagerRef

type MCJITMemoryManagerRef = *OpaqueMCJITMemoryManager

func CreateSimpleMCJITMemoryManager

func CreateSimpleMCJITMemoryManager(Opaque unsafe.Pointer, AllocateCodeSection MemoryManagerAllocateCodeSectionCallback, AllocateDataSection MemoryManagerAllocateDataSectionCallback, FinalizeMemory MemoryManagerFinalizeMemoryCallback, Destroy MemoryManagerDestroyCallback) MCJITMemoryManagerRef

Create a simple custom MCJIT memory manager. This memory manager can intercept allocations in a module-oblivious way. This will return NULL if any of the passed functions are NULL.

@param Opaque An opaque client object to pass back to the callbacks. @param AllocateCodeSection Allocate a block of memory for executable code. @param AllocateDataSection Allocate a block of memory for data. @param FinalizeMemory Set page permissions and flush cache. Return 0 on

success, 1 on error.

func (MCJITMemoryManagerRef) Dispose added in v0.3.1

func (self MCJITMemoryManagerRef) Dispose()

llgo:link MCJITMemoryManagerRef.Dispose C.LLVMDisposeMCJITMemoryManager

type MemoryBufferRef

type MemoryBufferRef = *OpaqueMemoryBuffer

Used to pass regions of memory through LLVM interfaces.

@see llvm::MemoryBuffer

func CreateMemoryBufferWithMemoryRange

func CreateMemoryBufferWithMemoryRange(InputData *c.Char, InputDataLength c.SizeT, BufferName *c.Char, RequiresNullTerminator Bool) MemoryBufferRef

func CreateMemoryBufferWithMemoryRangeCopy

func CreateMemoryBufferWithMemoryRangeCopy(InputData *c.Char, InputDataLength c.SizeT, BufferName *c.Char) MemoryBufferRef

func (MemoryBufferRef) BitcodeModule added in v0.3.0

func (self MemoryBufferRef) BitcodeModule(OutM *ModuleRef, OutMessage **c.Char) Bool

This is deprecated. Use LLVMGetBitcodeModule2.

llgo:link MemoryBufferRef.BitcodeModule C.LLVMGetBitcodeModule

func (MemoryBufferRef) BitcodeModule2 added in v0.3.0

func (self MemoryBufferRef) BitcodeModule2(OutM *ModuleRef) Bool

llgo:link MemoryBufferRef.BitcodeModule2 C.LLVMGetBitcodeModule2

func (MemoryBufferRef) BufferSize added in v0.3.0

func (self MemoryBufferRef) BufferSize() c.SizeT

llgo:link MemoryBufferRef.BufferSize C.LLVMGetBufferSize

func (MemoryBufferRef) BufferStart added in v0.3.0

func (self MemoryBufferRef) BufferStart() *c.Char

llgo:link MemoryBufferRef.BufferStart C.LLVMGetBufferStart

func (MemoryBufferRef) CreateBinary added in v0.3.0

func (self MemoryBufferRef) CreateBinary(Context ContextRef, ErrorMessage **c.Char) BinaryRef

Create a binary file from the given memory buffer.

The exact type of the binary file will be inferred automatically, and the appropriate implementation selected. The context may be NULL except if the resulting file is an LLVM IR file.

The memory buffer is not consumed by this function. It is the responsibility of the caller to free it with \c LLVMDisposeMemoryBuffer.

If NULL is returned, the \p ErrorMessage parameter is populated with the error's description. It is then the caller's responsibility to free this message by calling \c LLVMDisposeMessage.

@see llvm::object::createBinary

llgo:link MemoryBufferRef.CreateBinary C.LLVMCreateBinary

func (MemoryBufferRef) CreateObjectFile deprecated added in v0.3.0

func (self MemoryBufferRef) CreateObjectFile() ObjectFileRef

Deprecated: Use LLVMCreateBinary instead.

llgo:link MemoryBufferRef.CreateObjectFile C.LLVMCreateObjectFile

func (MemoryBufferRef) Dispose added in v0.3.1

func (self MemoryBufferRef) Dispose()

llgo:link MemoryBufferRef.Dispose C.LLVMDisposeMemoryBuffer

func (MemoryBufferRef) ParseBitcode added in v0.3.0

func (self MemoryBufferRef) ParseBitcode(OutModule *ModuleRef, OutMessage **c.Char) Bool

Builds a module from the bitcode in the specified memory buffer, returning a reference to the module via the OutModule parameter. Returns 0 on success. Optionally returns a human-readable error message via OutMessage.

This is deprecated. Use LLVMParseBitcode2.

llgo:link MemoryBufferRef.ParseBitcode C.LLVMParseBitcode

func (MemoryBufferRef) ParseBitcode2 added in v0.3.0

func (self MemoryBufferRef) ParseBitcode2(OutModule *ModuleRef) Bool

Builds a module from the bitcode in the specified memory buffer, returning a reference to the module via the OutModule parameter. Returns 0 on success.

llgo:link MemoryBufferRef.ParseBitcode2 C.LLVMParseBitcode2

type MemoryManagerAllocateCodeSectionCallback

type MemoryManagerAllocateCodeSectionCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.UintptrT, _llcppg_param3 c.Uint, _llcppg_param4 c.Uint, _llcppg_param5 *c.Char) *c.Uint8T

llgo:type C

type MemoryManagerAllocateDataSectionCallback

type MemoryManagerAllocateDataSectionCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.UintptrT, _llcppg_param3 c.Uint, _llcppg_param4 c.Uint, _llcppg_param5 *c.Char, _llcppg_param6 Bool) *c.Uint8T

llgo:type C

type MemoryManagerCreateContextCallback

type MemoryManagerCreateContextCallback = func(_llcppg_param1 unsafe.Pointer) unsafe.Pointer

llgo:type C

type MemoryManagerDestroyCallback

type MemoryManagerDestroyCallback = func(_llcppg_param1 unsafe.Pointer)

llgo:type C

type MemoryManagerFinalizeMemoryCallback

type MemoryManagerFinalizeMemoryCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 **c.Char) Bool

llgo:type C

type MemoryManagerNotifyTerminatingCallback

type MemoryManagerNotifyTerminatingCallback = func(_llcppg_param1 unsafe.Pointer)

llgo:type C

type MetadataKind

type MetadataKind = c.Uint

type MetadataRef

type MetadataRef = *OpaqueMetadata

Represents an LLVM Metadata.

This models llvm::Metadata.

func (MetadataRef) DIFileGetDirectory added in v0.3.0

func (self MetadataRef) DIFileGetDirectory(Len *c.Uint) *c.Char

Get the directory of a given file. \param File The file object. \param Len The length of the returned string.

@see DIFile::getDirectory()

llgo:link MetadataRef.DIFileGetDirectory C.LLVMDIFileGetDirectory

func (MetadataRef) DIFileGetFilename added in v0.3.0

func (self MetadataRef) DIFileGetFilename(Len *c.Uint) *c.Char

Get the name of a given file. \param File The file object. \param Len The length of the returned string.

@see DIFile::getFilename()

llgo:link MetadataRef.DIFileGetFilename C.LLVMDIFileGetFilename

func (MetadataRef) DIFileGetSource added in v0.3.0

func (self MetadataRef) DIFileGetSource(Len *c.Uint) *c.Char

Get the source of a given file. \param File The file object. \param Len The length of the returned string.

@see DIFile::getSource()

llgo:link MetadataRef.DIFileGetSource C.LLVMDIFileGetSource

func (MetadataRef) DIGlobalVariableExpressionGetExpression added in v0.3.0

func (self MetadataRef) DIGlobalVariableExpressionGetExpression() MetadataRef

Retrieves the \c DIExpression associated with this global variable expression. \param GVE The global variable expression.

@see llvm::DIGlobalVariableExpression::getExpression()

llgo:link MetadataRef.DIGlobalVariableExpressionGetExpression C.LLVMDIGlobalVariableExpressionGetExpression

func (MetadataRef) DIGlobalVariableExpressionGetVariable added in v0.3.0

func (self MetadataRef) DIGlobalVariableExpressionGetVariable() MetadataRef

Retrieves the \c DIVariable associated with this global variable expression. \param GVE The global variable expression.

@see llvm::DIGlobalVariableExpression::getVariable()

llgo:link MetadataRef.DIGlobalVariableExpressionGetVariable C.LLVMDIGlobalVariableExpressionGetVariable

func (MetadataRef) DILocationGetColumn added in v0.3.0

func (self MetadataRef) DILocationGetColumn() c.Uint

Get the column number of this debug location. \param Location The debug location.

@see DILocation::getColumn()

llgo:link MetadataRef.DILocationGetColumn C.LLVMDILocationGetColumn

func (MetadataRef) DILocationGetInlinedAt added in v0.3.0

func (self MetadataRef) DILocationGetInlinedAt() MetadataRef

Get the "inline at" location associated with this debug location. \param Location The debug location.

@see DILocation::getInlinedAt()

llgo:link MetadataRef.DILocationGetInlinedAt C.LLVMDILocationGetInlinedAt

func (MetadataRef) DILocationGetLine added in v0.3.0

func (self MetadataRef) DILocationGetLine() c.Uint

Get the line number of this debug location. \param Location The debug location.

@see DILocation::getLine()

llgo:link MetadataRef.DILocationGetLine C.LLVMDILocationGetLine

func (MetadataRef) DILocationGetScope added in v0.3.0

func (self MetadataRef) DILocationGetScope() MetadataRef

Get the local scope associated with this debug location. \param Location The debug location.

@see DILocation::getScope()

llgo:link MetadataRef.DILocationGetScope C.LLVMDILocationGetScope

func (MetadataRef) DINodeTag added in v0.3.0

func (self MetadataRef) DINodeTag() c.Uint16T

Get the dwarf::Tag of a DINode

llgo:link MetadataRef.DINodeTag C.LLVMGetDINodeTag

func (MetadataRef) DIScopeGetFile added in v0.3.0

func (self MetadataRef) DIScopeGetFile() MetadataRef

Get the metadata of the file associated with a given scope. \param Scope The scope object.

@see DIScope::getFile()

llgo:link MetadataRef.DIScopeGetFile C.LLVMDIScopeGetFile

func (MetadataRef) DISubprogramGetLine added in v0.3.0

func (self MetadataRef) DISubprogramGetLine() c.Uint

Get the line associated with a given subprogram. \param Subprogram The subprogram object.

@see DISubprogram::getLine()

llgo:link MetadataRef.DISubprogramGetLine C.LLVMDISubprogramGetLine

func (MetadataRef) DITypeGetAlignInBits added in v0.3.0

func (self MetadataRef) DITypeGetAlignInBits() c.Uint32T

Get the alignment of this DIType in bits. \param DType The DIType.

@see DIType::getAlignInBits()

llgo:link MetadataRef.DITypeGetAlignInBits C.LLVMDITypeGetAlignInBits

func (MetadataRef) DITypeGetFlags added in v0.3.0

func (self MetadataRef) DITypeGetFlags() DIFlags

Get the flags associated with this DIType. \param DType The DIType.

@see DIType::getFlags()

llgo:link MetadataRef.DITypeGetFlags C.LLVMDITypeGetFlags

func (MetadataRef) DITypeGetLine added in v0.3.0

func (self MetadataRef) DITypeGetLine() c.Uint

Get the source line where this DIType is declared. \param DType The DIType.

@see DIType::getLine()

llgo:link MetadataRef.DITypeGetLine C.LLVMDITypeGetLine

func (MetadataRef) DITypeGetName added in v0.3.0

func (self MetadataRef) DITypeGetName(Length *c.SizeT) *c.Char

Get the name of this DIType. \param DType The DIType. \param Length The length of the returned string.

@see DIType::getName()

llgo:link MetadataRef.DITypeGetName C.LLVMDITypeGetName

func (MetadataRef) DITypeGetOffsetInBits added in v0.3.0

func (self MetadataRef) DITypeGetOffsetInBits() c.Uint64T

Get the offset of this DIType in bits. \param DType The DIType.

@see DIType::getOffsetInBits()

llgo:link MetadataRef.DITypeGetOffsetInBits C.LLVMDITypeGetOffsetInBits

func (MetadataRef) DITypeGetSizeInBits added in v0.3.0

func (self MetadataRef) DITypeGetSizeInBits() c.Uint64T

Get the size of this DIType in bits. \param DType The DIType.

@see DIType::getSizeInBits()

llgo:link MetadataRef.DITypeGetSizeInBits C.LLVMDITypeGetSizeInBits

func (MetadataRef) DIVariableGetFile added in v0.3.0

func (self MetadataRef) DIVariableGetFile() MetadataRef

Get the metadata of the file associated with a given variable. \param Var The variable object.

@see DIVariable::getFile()

llgo:link MetadataRef.DIVariableGetFile C.LLVMDIVariableGetFile

func (MetadataRef) DIVariableGetLine added in v0.3.0

func (self MetadataRef) DIVariableGetLine() c.Uint

Get the source line where this \c DIVariable is declared. \param Var The DIVariable.

@see DIVariable::getLine()

llgo:link MetadataRef.DIVariableGetLine C.LLVMDIVariableGetLine

func (MetadataRef) DIVariableGetScope added in v0.3.0

func (self MetadataRef) DIVariableGetScope() MetadataRef

Get the metadata of the scope associated with a given variable. \param Var The variable object.

@see DIVariable::getScope()

llgo:link MetadataRef.DIVariableGetScope C.LLVMDIVariableGetScope

func (MetadataRef) DisposeTemporaryMDNode added in v0.3.0

func (self MetadataRef) DisposeTemporaryMDNode()

Deallocate a temporary node.

Calls \c replaceAllUsesWith(nullptr) before deleting, so any remaining references will be reset. \param TempNode The temporary metadata node.

llgo:link MetadataRef.DisposeTemporaryMDNode C.LLVMDisposeTemporaryMDNode

func (MetadataRef) Kind added in v0.3.1

func (self MetadataRef) Kind() MetadataKind

Obtain the enumerated type of a Metadata instance.

@see llvm::Metadata::getMetadataID()

llgo:link MetadataRef.Kind C.LLVMGetMetadataKind

type ModuleFlagBehavior

type ModuleFlagBehavior c.Uint
const (
	// Emits an error if two values disagree, otherwise the resulting value is
	// that of the operands.
	//
	// @see Module::ModFlagBehavior::Error
	ModuleFlagBehaviorError ModuleFlagBehavior = 0
	// Emits a warning if two values disagree. The result value will be the
	// operand for the flag from the first module being linked.
	//
	// @see Module::ModFlagBehavior::Warning
	ModuleFlagBehaviorWarning ModuleFlagBehavior = 1
	// Adds a requirement that another module flag be present and have a
	// specified value after linking is performed. The value must be a metadata
	// pair, where the first element of the pair is the ID of the module flag
	// to be restricted, and the second element of the pair is the value the
	// module flag should be restricted to. This behavior can be used to
	// restrict the allowable results (via triggering of an error) of linking
	// IDs with the **Override** behavior.
	//
	// @see Module::ModFlagBehavior::Require
	ModuleFlagBehaviorRequire ModuleFlagBehavior = 2
	// Uses the specified value, regardless of the behavior or value of the
	// other module. If both modules specify **Override**, but the values
	// differ, an error will be emitted.
	//
	// @see Module::ModFlagBehavior::Override
	ModuleFlagBehaviorOverride ModuleFlagBehavior = 3
	// Appends the two values, which are required to be metadata nodes.
	//
	// @see Module::ModFlagBehavior::Append
	ModuleFlagBehaviorAppend ModuleFlagBehavior = 4
	// Appends the two values, which are required to be metadata
	// nodes. However, duplicate entries in the second list are dropped
	// during the append operation.
	//
	// @see Module::ModFlagBehavior::AppendUnique
	ModuleFlagBehaviorAppendUnique ModuleFlagBehavior = 5
)

type ModuleFlagEntry

type ModuleFlagEntry = OpaqueModuleFlagEntry

@see llvm::Module::ModuleFlagEntry

func (*ModuleFlagEntry) DisposeModuleFlagsMetadata added in v0.3.0

func (self *ModuleFlagEntry) DisposeModuleFlagsMetadata()

Destroys module flags metadata entries.

llgo:link (*ModuleFlagEntry).DisposeModuleFlagsMetadata C.LLVMDisposeModuleFlagsMetadata

func (*ModuleFlagEntry) ModuleFlagEntriesGetFlagBehavior added in v0.3.0

func (self *ModuleFlagEntry) ModuleFlagEntriesGetFlagBehavior(Index c.Uint) ModuleFlagBehavior

Returns the flag behavior for a module flag entry at a specific index.

@see Module::ModuleFlagEntry::Behavior

llgo:link (*ModuleFlagEntry).ModuleFlagEntriesGetFlagBehavior C.LLVMModuleFlagEntriesGetFlagBehavior

func (*ModuleFlagEntry) ModuleFlagEntriesGetKey added in v0.3.0

func (self *ModuleFlagEntry) ModuleFlagEntriesGetKey(Index c.Uint, Len *c.SizeT) *c.Char

Returns the key for a module flag entry at a specific index.

@see Module::ModuleFlagEntry::Key

llgo:link (*ModuleFlagEntry).ModuleFlagEntriesGetKey C.LLVMModuleFlagEntriesGetKey

func (*ModuleFlagEntry) ModuleFlagEntriesGetMetadata added in v0.3.0

func (self *ModuleFlagEntry) ModuleFlagEntriesGetMetadata(Index c.Uint) MetadataRef

Returns the metadata for a module flag entry at a specific index.

@see Module::ModuleFlagEntry::Val

llgo:link (*ModuleFlagEntry).ModuleFlagEntriesGetMetadata C.LLVMModuleFlagEntriesGetMetadata

type ModuleProviderRef

type ModuleProviderRef = *OpaqueModuleProvider

Interface used to provide a module to JIT or interpreter. This is now just a synonym for llvm::Module, but we have to keep using the different type to keep binary compatibility.

func (ModuleProviderRef) CreateFunctionPassManager deprecated added in v0.3.0

func (self ModuleProviderRef) CreateFunctionPassManager() PassManagerRef

Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.

llgo:link ModuleProviderRef.CreateFunctionPassManager C.LLVMCreateFunctionPassManager

func (ModuleProviderRef) Dispose added in v0.3.1

func (self ModuleProviderRef) Dispose()

Destroys the module M.

llgo:link ModuleProviderRef.Dispose C.LLVMDisposeModuleProvider

type ModuleRef

type ModuleRef = *OpaqueModule

The top-level container for all other LLVM Intermediate Representation (IR) objects.

@see llvm::Module

func ModuleCreateWithName

func ModuleCreateWithName(ModuleID *c.Char) ModuleRef

Create a new, empty module in the global context.

This is equivalent to calling LLVMModuleCreateWithNameInContext with LLVMGetGlobalContext() as the context parameter.

Every invocation should be paired with LLVMDisposeModule() or memory will be leaked.

func ModuleCreateWithNameInContext

func ModuleCreateWithNameInContext(ModuleID *c.Char, C ContextRef) ModuleRef

Create a new, empty module in a specific context.

Every invocation should be paired with LLVMDisposeModule() or memory will be leaked.

func (ModuleRef) AddAlias2 added in v0.3.0

func (self ModuleRef) AddAlias2(ValueTy TypeRef, AddrSpace c.Uint, Aliasee ValueRef, Name *c.Char) ValueRef

Add a GlobalAlias with the given value type, address space and aliasee.

@see llvm::GlobalAlias::create()

llgo:link ModuleRef.AddAlias2 C.LLVMAddAlias2

func (ModuleRef) AddFunction added in v0.3.0

func (self ModuleRef) AddFunction(Name *c.Char, FunctionTy TypeRef) ValueRef

Add a function to a module under a specified name.

@see llvm::Function::Create()

llgo:link ModuleRef.AddFunction C.LLVMAddFunction

func (ModuleRef) AddGlobal added in v0.3.0

func (self ModuleRef) AddGlobal(Ty TypeRef, Name *c.Char) ValueRef

@defgroup LLVMCoreValueConstantGlobalVariable Global Variables

This group contains functions that operate on global variable values.

@see llvm::GlobalVariable

@{

llgo:link ModuleRef.AddGlobal C.LLVMAddGlobal

func (ModuleRef) AddGlobalIFunc added in v0.3.0

func (self ModuleRef) AddGlobalIFunc(Name *c.Char, NameLen c.SizeT, Ty TypeRef, AddrSpace c.Uint, Resolver ValueRef) ValueRef

Add a global indirect function to a module under a specified name.

@see llvm::GlobalIFunc::create()

llgo:link ModuleRef.AddGlobalIFunc C.LLVMAddGlobalIFunc

func (ModuleRef) AddGlobalInAddressSpace added in v0.3.0

func (self ModuleRef) AddGlobalInAddressSpace(Ty TypeRef, Name *c.Char, AddressSpace c.Uint) ValueRef

llgo:link ModuleRef.AddGlobalInAddressSpace C.LLVMAddGlobalInAddressSpace

func (ModuleRef) AddModuleFlag added in v0.3.0

func (self ModuleRef) AddModuleFlag(Behavior ModuleFlagBehavior, Key *c.Char, KeyLen c.SizeT, Val MetadataRef)

Add a module-level flag to the module-level flags metadata if it doesn't already exist.

@see Module::addModuleFlag()

llgo:link ModuleRef.AddModuleFlag C.LLVMAddModuleFlag

func (ModuleRef) AddNamedMetadataOperand added in v0.3.0

func (self ModuleRef) AddNamedMetadataOperand(Name *c.Char, Val ValueRef)

Add an operand to named metadata.

@see llvm::Module::getNamedMetadata() @see llvm::MDNode::addOperand()

llgo:link ModuleRef.AddNamedMetadataOperand C.LLVMAddNamedMetadataOperand

func (ModuleRef) AppendModuleInlineAsm added in v0.3.0

func (self ModuleRef) AppendModuleInlineAsm(Asm *c.Char, Len c.SizeT)

Append inline assembly to a module.

@see Module::appendModuleInlineAsm()

llgo:link ModuleRef.AppendModuleInlineAsm C.LLVMAppendModuleInlineAsm

func (ModuleRef) Clone added in v0.3.1

func (self ModuleRef) Clone() ModuleRef

Return an exact copy of the specified module.

llgo:link ModuleRef.Clone C.LLVMCloneModule

func (ModuleRef) Context added in v0.3.1

func (self ModuleRef) Context() ContextRef

Obtain the context to which this module is associated.

@see Module::getContext()

llgo:link ModuleRef.Context C.LLVMGetModuleContext

func (ModuleRef) CopyModuleFlagsMetadata added in v0.3.0

func (self ModuleRef) CopyModuleFlagsMetadata(Len *c.SizeT) *ModuleFlagEntry

Returns the module flags as an array of flag-key-value triples. The caller is responsible for freeing this array by calling \c LLVMDisposeModuleFlagsMetadata.

@see Module::getModuleFlagsMetadata()

llgo:link ModuleRef.CopyModuleFlagsMetadata C.LLVMCopyModuleFlagsMetadata

func (ModuleRef) CreateDIBuilder added in v0.3.0

func (self ModuleRef) CreateDIBuilder() DIBuilderRef

Construct a builder for a module and collect unresolved nodes attached to the module in order to resolve cycles during a call to \c LLVMDIBuilderFinalize.

llgo:link ModuleRef.CreateDIBuilder C.LLVMCreateDIBuilder

func (ModuleRef) CreateDIBuilderDisallowUnresolved added in v0.3.0

func (self ModuleRef) CreateDIBuilderDisallowUnresolved() DIBuilderRef

Construct a builder for a module, and do not allow for unresolved nodes attached to the module.

llgo:link ModuleRef.CreateDIBuilderDisallowUnresolved C.LLVMCreateDIBuilderDisallowUnresolved

func (ModuleRef) CreateFunctionPassManagerFor added in v0.3.1

func (self ModuleRef) CreateFunctionPassManagerFor() PassManagerRef

Constructs a new function-by-function pass pipeline over the module provider. It does not take ownership of the module provider. This type of pipeline is suitable for code generation and JIT compilation tasks. @see llvm::FunctionPassManager::FunctionPassManager

llgo:link ModuleRef.CreateFunctionPassManagerFor C.LLVMCreateFunctionPassManagerForModule

func (ModuleRef) CreateModuleProviderForExisting added in v0.3.1

func (self ModuleRef) CreateModuleProviderForExisting() ModuleProviderRef

Changes the type of M so it can be passed to FunctionPassManagers and the JIT. They take ModuleProviders for historical reasons.

llgo:link ModuleRef.CreateModuleProviderForExisting C.LLVMCreateModuleProviderForExistingModule

func (ModuleRef) DataLayout added in v0.3.0

func (self ModuleRef) DataLayout() *c.Char

llgo:link ModuleRef.DataLayout C.LLVMGetDataLayout

func (ModuleRef) DataLayoutStr added in v0.3.0

func (self ModuleRef) DataLayoutStr() *c.Char

Obtain the data layout for a module.

@see Module::getDataLayoutStr()

LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect, but match the name of another method on the module. Prefer the use of LLVMGetDataLayoutStr, which is not ambiguous.

llgo:link ModuleRef.DataLayoutStr C.LLVMGetDataLayoutStr

func (ModuleRef) DebugMetadataVersion added in v0.3.1

func (self ModuleRef) DebugMetadataVersion() c.Uint

The version of debug metadata that's present in the provided \c Module.

llgo:link ModuleRef.DebugMetadataVersion C.LLVMGetModuleDebugMetadataVersion

func (ModuleRef) Dispose added in v0.3.1

func (self ModuleRef) Dispose()

Destroy a module instance.

This must be called for every created module or memory will be leaked.

llgo:link ModuleRef.Dispose C.LLVMDisposeModule

func (ModuleRef) Dump added in v0.3.1

func (self ModuleRef) Dump()

Dump a representation of a module to stderr.

@see Module::dump()

llgo:link ModuleRef.Dump C.LLVMDumpModule

func (ModuleRef) FirstFunction added in v0.3.0

func (self ModuleRef) FirstFunction() ValueRef

Obtain an iterator to the first Function in a Module.

@see llvm::Module::begin()

llgo:link ModuleRef.FirstFunction C.LLVMGetFirstFunction

func (ModuleRef) FirstGlobal added in v0.3.0

func (self ModuleRef) FirstGlobal() ValueRef

llgo:link ModuleRef.FirstGlobal C.LLVMGetFirstGlobal

func (ModuleRef) FirstGlobalAlias added in v0.3.0

func (self ModuleRef) FirstGlobalAlias() ValueRef

Obtain an iterator to the first GlobalAlias in a Module.

@see llvm::Module::alias_begin()

llgo:link ModuleRef.FirstGlobalAlias C.LLVMGetFirstGlobalAlias

func (ModuleRef) FirstGlobalIFunc added in v0.3.0

func (self ModuleRef) FirstGlobalIFunc() ValueRef

Obtain an iterator to the first GlobalIFunc in a Module.

@see llvm::Module::ifunc_begin()

llgo:link ModuleRef.FirstGlobalIFunc C.LLVMGetFirstGlobalIFunc

func (ModuleRef) FirstNamedMetadata added in v0.3.0

func (self ModuleRef) FirstNamedMetadata() NamedMDNodeRef

Obtain an iterator to the first NamedMDNode in a Module.

@see llvm::Module::named_metadata_begin()

llgo:link ModuleRef.FirstNamedMetadata C.LLVMGetFirstNamedMetadata

func (ModuleRef) Flag added in v0.3.1

func (self ModuleRef) Flag(Key *c.Char, KeyLen c.SizeT) MetadataRef

Add a module-level flag to the module-level flags metadata if it doesn't already exist.

@see Module::getModuleFlag()

llgo:link ModuleRef.Flag C.LLVMGetModuleFlag

func (ModuleRef) GetModuleDataLayout added in v0.3.1

func (self ModuleRef) GetModuleDataLayout() TargetDataRef

Obtain the data layout for a module.

@see Module::getDataLayout()

llgo:link ModuleRef.GetModuleDataLayout C.LLVMGetModuleDataLayout

func (ModuleRef) Identifier added in v0.3.1

func (self ModuleRef) Identifier(Len *c.SizeT) *c.Char

Obtain the identifier of a module.

@param M Module to obtain identifier of @param Len Out parameter which holds the length of the returned string. @return The identifier of M. @see Module::getModuleIdentifier()

llgo:link ModuleRef.Identifier C.LLVMGetModuleIdentifier

func (ModuleRef) InlineAsm added in v0.3.1

func (self ModuleRef) InlineAsm(Len *c.SizeT) *c.Char

Get inline assembly for a module.

@see Module::getModuleInlineAsm()

llgo:link ModuleRef.InlineAsm C.LLVMGetModuleInlineAsm

func (ModuleRef) IntrinsicCopyOverloadedName2 added in v0.3.0

func (self ModuleRef) IntrinsicCopyOverloadedName2(ID c.Uint, ParamTypes *TypeRef, ParamCount c.SizeT, NameLength *c.SizeT) *c.Char

Copies the name of an overloaded intrinsic identified by a given list of parameter types.

Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the returned string.

This version also supports unnamed types.

@see llvm::Intrinsic::getName()

llgo:link ModuleRef.IntrinsicCopyOverloadedName2 C.LLVMIntrinsicCopyOverloadedName2

func (ModuleRef) IntrinsicDeclaration added in v0.3.0

func (self ModuleRef) IntrinsicDeclaration(ID c.Uint, ParamTypes *TypeRef, ParamCount c.SizeT) ValueRef

Get or insert the declaration of an intrinsic. For overloaded intrinsics, parameter types must be provided to uniquely identify an overload.

@see llvm::Intrinsic::getOrInsertDeclaration()

llgo:link ModuleRef.IntrinsicDeclaration C.LLVMGetIntrinsicDeclaration

func (ModuleRef) IsNewDbgInfoFormat added in v0.3.0

func (self ModuleRef) IsNewDbgInfoFormat() Bool

Soon to be deprecated. See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

Returns true if the module is in the new debug info mode which uses non-instruction debug records instead of debug intrinsics for variable location tracking.

llgo:link ModuleRef.IsNewDbgInfoFormat C.LLVMIsNewDbgInfoFormat

func (ModuleRef) LastFunction added in v0.3.0

func (self ModuleRef) LastFunction() ValueRef

Obtain an iterator to the last Function in a Module.

@see llvm::Module::end()

llgo:link ModuleRef.LastFunction C.LLVMGetLastFunction

func (ModuleRef) LastGlobal added in v0.3.0

func (self ModuleRef) LastGlobal() ValueRef

llgo:link ModuleRef.LastGlobal C.LLVMGetLastGlobal

func (ModuleRef) LastGlobalAlias added in v0.3.0

func (self ModuleRef) LastGlobalAlias() ValueRef

Obtain an iterator to the last GlobalAlias in a Module.

@see llvm::Module::alias_end()

llgo:link ModuleRef.LastGlobalAlias C.LLVMGetLastGlobalAlias

func (ModuleRef) LastGlobalIFunc added in v0.3.0

func (self ModuleRef) LastGlobalIFunc() ValueRef

Obtain an iterator to the last GlobalIFunc in a Module.

@see llvm::Module::ifunc_end()

llgo:link ModuleRef.LastGlobalIFunc C.LLVMGetLastGlobalIFunc

func (ModuleRef) LastNamedMetadata added in v0.3.0

func (self ModuleRef) LastNamedMetadata() NamedMDNodeRef

Obtain an iterator to the last NamedMDNode in a Module.

@see llvm::Module::named_metadata_end()

llgo:link ModuleRef.LastNamedMetadata C.LLVMGetLastNamedMetadata

func (ModuleRef) NamedFunction added in v0.3.0

func (self ModuleRef) NamedFunction(Name *c.Char) ValueRef

Obtain a Function value from a Module by its name.

The returned value corresponds to a llvm::Function value.

@see llvm::Module::getFunction()

llgo:link ModuleRef.NamedFunction C.LLVMGetNamedFunction

func (ModuleRef) NamedFunctionWithLength added in v0.3.0

func (self ModuleRef) NamedFunctionWithLength(Name *c.Char, Length c.SizeT) ValueRef

Obtain a Function value from a Module by its name.

The returned value corresponds to a llvm::Function value.

@see llvm::Module::getFunction()

llgo:link ModuleRef.NamedFunctionWithLength C.LLVMGetNamedFunctionWithLength

func (ModuleRef) NamedGlobal added in v0.3.0

func (self ModuleRef) NamedGlobal(Name *c.Char) ValueRef

llgo:link ModuleRef.NamedGlobal C.LLVMGetNamedGlobal

func (ModuleRef) NamedGlobalAlias added in v0.3.0

func (self ModuleRef) NamedGlobalAlias(Name *c.Char, NameLen c.SizeT) ValueRef

Obtain a GlobalAlias value from a Module by its name.

The returned value corresponds to a llvm::GlobalAlias value.

@see llvm::Module::getNamedAlias()

llgo:link ModuleRef.NamedGlobalAlias C.LLVMGetNamedGlobalAlias

func (ModuleRef) NamedGlobalIFunc added in v0.3.0

func (self ModuleRef) NamedGlobalIFunc(Name *c.Char, NameLen c.SizeT) ValueRef

Obtain a GlobalIFunc value from a Module by its name.

The returned value corresponds to a llvm::GlobalIFunc value.

@see llvm::Module::getNamedIFunc()

llgo:link ModuleRef.NamedGlobalIFunc C.LLVMGetNamedGlobalIFunc

func (ModuleRef) NamedGlobalWithLength added in v0.3.0

func (self ModuleRef) NamedGlobalWithLength(Name *c.Char, Length c.SizeT) ValueRef

llgo:link ModuleRef.NamedGlobalWithLength C.LLVMGetNamedGlobalWithLength

func (ModuleRef) NamedMetadata added in v0.3.0

func (self ModuleRef) NamedMetadata(Name *c.Char, NameLen c.SizeT) NamedMDNodeRef

Retrieve a NamedMDNode with the given name, returning NULL if no such node exists.

@see llvm::Module::getNamedMetadata()

llgo:link ModuleRef.NamedMetadata C.LLVMGetNamedMetadata

func (ModuleRef) NamedMetadataNumOperands added in v0.3.0

func (self ModuleRef) NamedMetadataNumOperands(Name *c.Char) c.Uint

Obtain the number of operands for named metadata in a module.

@see llvm::Module::getNamedMetadata()

llgo:link ModuleRef.NamedMetadataNumOperands C.LLVMGetNamedMetadataNumOperands

func (ModuleRef) NamedMetadataOperands added in v0.3.0

func (self ModuleRef) NamedMetadataOperands(Name *c.Char, Dest *ValueRef)

Obtain the named metadata operands for a module.

The passed LLVMValueRef pointer should refer to an array of LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This array will be populated with the LLVMValueRef instances. Each instance corresponds to a llvm::MDNode.

@see llvm::Module::getNamedMetadata() @see llvm::MDNode::getOperand()

llgo:link ModuleRef.NamedMetadataOperands C.LLVMGetNamedMetadataOperands

func (ModuleRef) OrInsertComdat added in v0.3.0

func (self ModuleRef) OrInsertComdat(Name *c.Char) ComdatRef

Return the Comdat in the module with the specified name. It is created if it didn't already exist.

@see llvm::Module::getOrInsertComdat()

llgo:link ModuleRef.OrInsertComdat C.LLVMGetOrInsertComdat

func (ModuleRef) OrInsertFunction added in v0.3.0

func (self ModuleRef) OrInsertFunction(Name *c.Char, NameLen c.SizeT, FunctionTy TypeRef) ValueRef

Obtain or insert a function into a module.

If a function with the specified name already exists in the module, it is returned. Otherwise, a new function is created in the module with the specified name and type and is returned.

The returned value corresponds to a llvm::Function instance.

@see llvm::Module::getOrInsertFunction()

llgo:link ModuleRef.OrInsertFunction C.LLVMGetOrInsertFunction

func (ModuleRef) OrInsertNamedMetadata added in v0.3.0

func (self ModuleRef) OrInsertNamedMetadata(Name *c.Char, NameLen c.SizeT) NamedMDNodeRef

Retrieve a NamedMDNode with the given name, creating a new node if no such node exists.

@see llvm::Module::getOrInsertNamedMetadata()

llgo:link ModuleRef.OrInsertNamedMetadata C.LLVMGetOrInsertNamedMetadata

func (ModuleRef) OrcCreateNewThreadSafe added in v0.3.1

func (self ModuleRef) OrcCreateNewThreadSafe(TSCtx OrcThreadSafeContextRef) OrcThreadSafeModuleRef

Create a ThreadSafeModule wrapper around the given LLVM module. This takes ownership of the M argument which should not be disposed of or referenced after this function returns.

Ownership of the ThreadSafeModule is unique: If it is transferred to the JIT (e.g. by LLVMOrcLLJITAddLLVMIRModule) then the client is no longer responsible for it. If it is not transferred to the JIT then the client should call LLVMOrcDisposeThreadSafeModule to dispose of it.

llgo:link ModuleRef.OrcCreateNewThreadSafe C.LLVMOrcCreateNewThreadSafeModule

func (ModuleRef) PrintModuleToFile added in v0.3.0

func (self ModuleRef) PrintModuleToFile(Filename *c.Char, ErrorMessage **c.Char) Bool

Print a representation of a module to a file. The ErrorMessage needs to be disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.

@see Module::print()

llgo:link ModuleRef.PrintModuleToFile C.LLVMPrintModuleToFile

func (ModuleRef) PrintModuleToString added in v0.3.0

func (self ModuleRef) PrintModuleToString() *c.Char

Return a string representation of the module. Use LLVMDisposeMessage to free the string.

@see Module::print()

llgo:link ModuleRef.PrintModuleToString C.LLVMPrintModuleToString

func (ModuleRef) RunPasses added in v0.3.0

func (self ModuleRef) RunPasses(Passes *c.Char, TM TargetMachineRef, Options PassBuilderOptionsRef) ErrorRef

Construct and run a set of passes over a module

This function takes a string with the passes that should be used. The format of this string is the same as opt's -passes argument for the new pass manager. Individual passes may be specified, separated by commas. Full pipelines may also be invoked using `default<O3>` and friends. See opt for full reference of the Passes format.

llgo:link ModuleRef.RunPasses C.LLVMRunPasses

func (ModuleRef) SetDataLayout added in v0.3.0

func (self ModuleRef) SetDataLayout(DataLayoutStr *c.Char)

Set the data layout for a module.

@see Module::setDataLayout()

llgo:link ModuleRef.SetDataLayout C.LLVMSetDataLayout

func (ModuleRef) SetIsNewDbgInfoFormat added in v0.3.0

func (self ModuleRef) SetIsNewDbgInfoFormat(UseNewFormat Bool)

Soon to be deprecated. See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes

Convert module into desired debug info format.

llgo:link ModuleRef.SetIsNewDbgInfoFormat C.LLVMSetIsNewDbgInfoFormat

func (ModuleRef) SetModuleDataLayout added in v0.3.0

func (self ModuleRef) SetModuleDataLayout(DL TargetDataRef)

Set the data layout for a module.

@see Module::setDataLayout()

llgo:link ModuleRef.SetModuleDataLayout C.LLVMSetModuleDataLayout

func (ModuleRef) SetModuleIdentifier added in v0.3.0

func (self ModuleRef) SetModuleIdentifier(Ident *c.Char, Len c.SizeT)

Set the identifier of a module to a string Ident with length Len.

@param M The module to set identifier @param Ident The string to set M's identifier to @param Len Length of Ident @see Module::setModuleIdentifier()

llgo:link ModuleRef.SetModuleIdentifier C.LLVMSetModuleIdentifier

func (ModuleRef) SetModuleInlineAsm deprecated added in v0.3.0

func (self ModuleRef) SetModuleInlineAsm(Asm *c.Char)

Deprecated: Use LLVMSetModuleInlineAsm2 instead.

llgo:link ModuleRef.SetModuleInlineAsm C.LLVMSetModuleInlineAsm

func (ModuleRef) SetModuleInlineAsm2 added in v0.3.0

func (self ModuleRef) SetModuleInlineAsm2(Asm *c.Char, Len c.SizeT)

Set inline assembly for a module.

@see Module::setModuleInlineAsm()

llgo:link ModuleRef.SetModuleInlineAsm2 C.LLVMSetModuleInlineAsm2

func (ModuleRef) SetSourceFileName added in v0.3.0

func (self ModuleRef) SetSourceFileName(Name *c.Char, Len c.SizeT)

Set the original source file name of a module to a string Name with length Len.

@param M The module to set the source file name of @param Name The string to set M's source file name to @param Len Length of Name @see Module::setSourceFileName()

llgo:link ModuleRef.SetSourceFileName C.LLVMSetSourceFileName

func (ModuleRef) SetTarget added in v0.3.0

func (self ModuleRef) SetTarget(Triple *c.Char)

Set the target triple for a module.

@see Module::setTargetTriple()

llgo:link ModuleRef.SetTarget C.LLVMSetTarget

func (ModuleRef) SourceFileName added in v0.3.0

func (self ModuleRef) SourceFileName(Len *c.SizeT) *c.Char

Obtain the module's original source file name.

@param M Module to obtain the name of @param Len Out parameter which holds the length of the returned string @return The original source file name of M @see Module::getSourceFileName()

llgo:link ModuleRef.SourceFileName C.LLVMGetSourceFileName

func (ModuleRef) StripModuleDebugInfo added in v0.3.0

func (self ModuleRef) StripModuleDebugInfo() Bool

Strip debug info in the module if it exists. To do this, we remove all calls to the debugger intrinsics and any named metadata for debugging. We also remove debug locations for instructions. Return true if module is modified.

llgo:link ModuleRef.StripModuleDebugInfo C.LLVMStripModuleDebugInfo

func (ModuleRef) Target added in v0.3.0

func (self ModuleRef) Target() *c.Char

Obtain the target triple for a module.

@see Module::getTargetTriple()

llgo:link ModuleRef.Target C.LLVMGetTarget

func (ModuleRef) TypeByName deprecated added in v0.3.0

func (self ModuleRef) TypeByName(Name *c.Char) TypeRef

Deprecated: Use LLVMGetTypeByName2 instead.

llgo:link ModuleRef.TypeByName C.LLVMGetTypeByName

func (ModuleRef) Verify added in v0.3.1

func (self ModuleRef) Verify(Action VerifierFailureAction, OutMessage **c.Char) Bool

Verifies that a module is valid, taking the specified action if not. Optionally returns a human-readable description of any invalid constructs. OutMessage must be disposed with LLVMDisposeMessage.

llgo:link ModuleRef.Verify C.LLVMVerifyModule

func (ModuleRef) WriteBitcodeToFD added in v0.3.0

func (self ModuleRef) WriteBitcodeToFD(FD c.Int, ShouldClose c.Int, Unbuffered c.Int) c.Int

Writes a module to an open file descriptor. Returns 0 on success.

llgo:link ModuleRef.WriteBitcodeToFD C.LLVMWriteBitcodeToFD

func (ModuleRef) WriteBitcodeToFile added in v0.3.0

func (self ModuleRef) WriteBitcodeToFile(Path *c.Char) c.Int

Writes a module to the specified path. Returns 0 on success.

llgo:link ModuleRef.WriteBitcodeToFile C.LLVMWriteBitcodeToFile

func (ModuleRef) WriteBitcodeToFileHandle added in v0.3.0

func (self ModuleRef) WriteBitcodeToFileHandle(Handle c.Int) c.Int

Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file descriptor. Returns 0 on success. Closes the Handle.

llgo:link ModuleRef.WriteBitcodeToFileHandle C.LLVMWriteBitcodeToFileHandle

func (ModuleRef) WriteBitcodeToMemoryBuffer added in v0.3.0

func (self ModuleRef) WriteBitcodeToMemoryBuffer() MemoryBufferRef

Writes a module to a new memory buffer and returns it.

llgo:link ModuleRef.WriteBitcodeToMemoryBuffer C.LLVMWriteBitcodeToMemoryBuffer

type NamedMDNodeRef

type NamedMDNodeRef = *OpaqueNamedMDNode

Represents an LLVM Named Metadata Node.

This models llvm::NamedMDNode.

func (NamedMDNodeRef) NamedMetadataName added in v0.3.0

func (self NamedMDNodeRef) NamedMetadataName(NameLen *c.SizeT) *c.Char

Retrieve the name of a NamedMDNode.

@see llvm::NamedMDNode::getName()

llgo:link NamedMDNodeRef.NamedMetadataName C.LLVMGetNamedMetadataName

func (NamedMDNodeRef) NextNamedMetadata added in v0.3.0

func (self NamedMDNodeRef) NextNamedMetadata() NamedMDNodeRef

Advance a NamedMDNode iterator to the next NamedMDNode.

Returns NULL if the iterator was already at the end and there are no more named metadata nodes.

llgo:link NamedMDNodeRef.NextNamedMetadata C.LLVMGetNextNamedMetadata

func (NamedMDNodeRef) PreviousNamedMetadata added in v0.3.0

func (self NamedMDNodeRef) PreviousNamedMetadata() NamedMDNodeRef

Decrement a NamedMDNode iterator to the previous NamedMDNode.

Returns NULL if the iterator was already at the beginning and there are no previous named metadata nodes.

llgo:link NamedMDNodeRef.PreviousNamedMetadata C.LLVMGetPreviousNamedMetadata

type ObjectFileRef deprecated

type ObjectFileRef = *OpaqueObjectFile

Deprecated: Use LLVMBinaryRef instead.

func (ObjectFileRef) Dispose deprecated added in v0.3.1

func (self ObjectFileRef) Dispose()

Deprecated: Use LLVMDisposeBinary instead.

llgo:link ObjectFileRef.Dispose C.LLVMDisposeObjectFile

func (ObjectFileRef) IsSectionIteratorAtEnd deprecated added in v0.3.0

func (self ObjectFileRef) IsSectionIteratorAtEnd(SI SectionIteratorRef) Bool

Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead.

llgo:link ObjectFileRef.IsSectionIteratorAtEnd C.LLVMIsSectionIteratorAtEnd

func (ObjectFileRef) IsSymbolIteratorAtEnd deprecated added in v0.3.0

func (self ObjectFileRef) IsSymbolIteratorAtEnd(SI SymbolIteratorRef) Bool

Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead.

llgo:link ObjectFileRef.IsSymbolIteratorAtEnd C.LLVMIsSymbolIteratorAtEnd

func (ObjectFileRef) Sections deprecated added in v0.3.0

func (self ObjectFileRef) Sections() SectionIteratorRef

Deprecated: Use LLVMObjectFileCopySectionIterator instead.

llgo:link ObjectFileRef.Sections C.LLVMGetSections

func (ObjectFileRef) Symbols deprecated added in v0.3.0

func (self ObjectFileRef) Symbols() SymbolIteratorRef

Deprecated: Use LLVMObjectFileCopySymbolIterator instead.

llgo:link ObjectFileRef.Symbols C.LLVMGetSymbols

type OpInfo1

type OpInfo1 struct {
	AddSymbol      OpInfoSymbol1
	SubtractSymbol OpInfoSymbol1
	Value          c.Uint64T
	VariantKind    c.Uint64T
}

type OpInfoCallback

type OpInfoCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.Uint64T, _llcppg_param3 c.Uint64T, _llcppg_param4 c.Uint64T, _llcppg_param5 c.Uint64T, _llcppg_param6 c.Int, _llcppg_param7 unsafe.Pointer) c.Int

The type for the operand information call back function. This is called to get the symbolic information for an operand of an instruction. Typically this is from the relocation information, symbol table, etc. That block of information is saved when the disassembler context is created and passed to the call back in the DisInfo parameter. The instruction containing operand is at the PC parameter. For some instruction sets, there can be more than one operand with symbolic information. To determine the symbolic operand information for each operand, the bytes for the specific operand in the instruction are specified by the Offset parameter and its byte widith is the OpSize parameter. For instructions sets with fixed widths and one symbolic operand per instruction, the Offset parameter will be zero and InstSize parameter will be the instruction width. The information is returned in TagBuf and is Triple specific with its specific information defined by the value of TagType for that Triple. If symbolic information is returned the function * returns 1, otherwise it returns 0.

llgo:type C

type OpInfoSymbol1

type OpInfoSymbol1 struct {
	Present c.Uint64T
	Name    *c.Char
	Value   c.Uint64T
}

The initial support in LLVM MC for the most general form of a relocatable expression is "AddSymbol - SubtractSymbol + Offset". For some Darwin targets this full form is encoded in the relocation information so that AddSymbol and SubtractSymbol can be link edited independent of each other. Many other platforms only allow a relocatable expression of the form AddSymbol + Offset to be encoded.

The LLVMOpInfoCallback() for the TagType value of 1 uses the struct LLVMOpInfo1. The value of the relocatable expression for the operand, including any PC adjustment, is passed in to the call back in the Value field. The symbolic information about the operand is returned using all the fields of the structure with the Offset of the relocatable expression returned in the Value field. It is possible that some symbols in the relocatable expression were assembly temporary symbols, for example "Ldata - LpicBase + constant", and only the Values of the symbols without symbol names are present in the relocation information. The VariantKind type is one of the Target specific #defines below and is used to print operands like "_foo@GOT", ":lower16:_foo", etc.

type OpaqueAttributeRef

type OpaqueAttributeRef struct {
}

type OpaqueBasicBlock

type OpaqueBasicBlock struct {
}

type OpaqueBinary

type OpaqueBinary struct {
}

type OpaqueBuilder

type OpaqueBuilder struct {
}

type OpaqueContext

type OpaqueContext struct {
}

type OpaqueDIBuilder

type OpaqueDIBuilder struct {
}

type OpaqueDbgRecord

type OpaqueDbgRecord struct {
}

type OpaqueDiagnosticInfo

type OpaqueDiagnosticInfo struct {
}

type OpaqueError

type OpaqueError struct {
}

type OpaqueExecutionEngine

type OpaqueExecutionEngine struct {
}

type OpaqueGenericValue

type OpaqueGenericValue struct {
}

type OpaqueJITEventListener

type OpaqueJITEventListener struct {
}

type OpaqueLTOCodeGenerator

type OpaqueLTOCodeGenerator struct {
}

type OpaqueLTOInput

type OpaqueLTOInput struct {
}

type OpaqueLTOModule

type OpaqueLTOModule struct {
}

type OpaqueMCJITMemoryManager

type OpaqueMCJITMemoryManager struct {
}

type OpaqueMemoryBuffer

type OpaqueMemoryBuffer struct {
}

type OpaqueMetadata

type OpaqueMetadata struct {
}

type OpaqueModule

type OpaqueModule struct {
}

type OpaqueModuleFlagEntry

type OpaqueModuleFlagEntry struct {
}

type OpaqueModuleProvider

type OpaqueModuleProvider struct {
}

type OpaqueNamedMDNode

type OpaqueNamedMDNode struct {
}

type OpaqueObjectFile

type OpaqueObjectFile struct {
}

type OpaqueOperandBundle

type OpaqueOperandBundle struct {
}

type OpaquePassBuilderOptions added in v0.2.0

type OpaquePassBuilderOptions struct {
}

type OpaquePassManager

type OpaquePassManager struct {
}

type OpaqueRelocationIterator

type OpaqueRelocationIterator struct {
}

type OpaqueSectionIterator

type OpaqueSectionIterator struct {
}

type OpaqueSymbolIterator

type OpaqueSymbolIterator struct {
}

type OpaqueTargetData

type OpaqueTargetData struct {
}

type OpaqueTargetLibraryInfotData

type OpaqueTargetLibraryInfotData struct {
}

type OpaqueTargetMachine

type OpaqueTargetMachine struct {
}

type OpaqueTargetMachineOptions

type OpaqueTargetMachineOptions struct {
}

type OpaqueThinLTOCodeGenerator

type OpaqueThinLTOCodeGenerator struct {
}

type OpaqueType

type OpaqueType struct {
}

type OpaqueUse

type OpaqueUse struct {
}

type OpaqueValue

type OpaqueValue struct {
}

type OpaqueValueMetadataEntry

type OpaqueValueMetadataEntry struct {
}

type Opcode

type Opcode c.Uint

External users depend on the following values being stable. It is not safe to reorder them.

const (
	// Terminator Instructions
	Ret        Opcode = 1
	Br         Opcode = 2
	Switch     Opcode = 3
	IndirectBr Opcode = 4
	Invoke     Opcode = 5
	// removed 6 due to API changes
	Unreachable Opcode = 7
	CallBr      Opcode = 67
	// Standard Unary Operators
	FNeg Opcode = 66
	// Standard Binary Operators
	Add  Opcode = 8
	FAdd Opcode = 9
	Sub  Opcode = 10
	FSub Opcode = 11
	Mul  Opcode = 12
	FMul Opcode = 13
	UDiv Opcode = 14
	SDiv Opcode = 15
	FDiv Opcode = 16
	URem Opcode = 17
	SRem Opcode = 18
	FRem Opcode = 19
	// Logical Operators
	Shl  Opcode = 20
	LShr Opcode = 21
	AShr Opcode = 22
	And  Opcode = 23
	Or   Opcode = 24
	Xor  Opcode = 25
	// Memory Operators
	Alloca        Opcode = 26
	Load          Opcode = 27
	Store         Opcode = 28
	GetElementPtr Opcode = 29
	// Cast Operators
	Trunc         Opcode = 30
	ZExt          Opcode = 31
	SExt          Opcode = 32
	FPToUI        Opcode = 33
	FPToSI        Opcode = 34
	UIToFP        Opcode = 35
	SIToFP        Opcode = 36
	FPTrunc       Opcode = 37
	FPExt         Opcode = 38
	PtrToInt      Opcode = 39
	PtrToAddr     Opcode = 69
	IntToPtr      Opcode = 40
	BitCast       Opcode = 41
	AddrSpaceCast Opcode = 60
	// Other Operators
	ICmp           Opcode = 42
	FCmp           Opcode = 43
	PHI            Opcode = 44
	Call           Opcode = 45
	Select         Opcode = 46
	UserOp1        Opcode = 47
	UserOp2        Opcode = 48
	VAArg          Opcode = 49
	ExtractElement Opcode = 50
	InsertElement  Opcode = 51
	ShuffleVector  Opcode = 52
	ExtractValue   Opcode = 53
	InsertValue    Opcode = 54
	Freeze         Opcode = 68
	// Atomic operators
	Fence         Opcode = 55
	AtomicCmpXchg Opcode = 56
	AtomicRMW     Opcode = 57
	// Exception Handling Operators
	Resume      Opcode = 58
	LandingPad  Opcode = 59
	CleanupRet  Opcode = 61
	CatchRet    Opcode = 62
	CatchPad    Opcode = 63
	CleanupPad  Opcode = 64
	CatchSwitch Opcode = 65
)

type OperandBundleRef

type OperandBundleRef = *OpaqueOperandBundle

@see llvm::OperandBundleDef

func CreateOperandBundle

func CreateOperandBundle(Tag *c.Char, TagLen c.SizeT, Args *ValueRef, NumArgs c.Uint) OperandBundleRef

Create a new operand bundle.

Every invocation should be paired with LLVMDisposeOperandBundle() or memory will be leaked.

@param Tag Tag name of the operand bundle @param TagLen Length of Tag @param Args Memory address of an array of bundle operands @param NumArgs Length of Args

func (OperandBundleRef) ArgAtIndex added in v0.3.1

func (self OperandBundleRef) ArgAtIndex(Index c.Uint) ValueRef

Obtain the operand for an operand bundle at the given index.

@param Bundle Operand bundle to obtain operand of. @param Index An operand index, must be less than LLVMGetNumOperandBundleArgs(). @return The operand.

llgo:link OperandBundleRef.ArgAtIndex C.LLVMGetOperandBundleArgAtIndex

func (OperandBundleRef) Dispose added in v0.3.1

func (self OperandBundleRef) Dispose()

Destroy an operand bundle.

This must be called for every created operand bundle or memory will be leaked.

llgo:link OperandBundleRef.Dispose C.LLVMDisposeOperandBundle

func (OperandBundleRef) NumOperandBundleArgs added in v0.3.0

func (self OperandBundleRef) NumOperandBundleArgs() c.Uint

Obtain the number of operands for an operand bundle.

@param Bundle Operand bundle to obtain operand count of. @return The number of operands. @see OperandBundleDef::input_size()

llgo:link OperandBundleRef.NumOperandBundleArgs C.LLVMGetNumOperandBundleArgs

func (OperandBundleRef) Tag added in v0.3.1

func (self OperandBundleRef) Tag(Len *c.SizeT) *c.Char

Obtain the tag of an operand bundle as a string.

@param Bundle Operand bundle to obtain tag of. @param Len Out parameter which holds the length of the returned string. @return The tag name of Bundle. @see OperandBundleDef::getTag()

llgo:link OperandBundleRef.Tag C.LLVMGetOperandBundleTag

type OrcCAPIDefinitionGeneratorTryToGenerateFunction

type OrcCAPIDefinitionGeneratorTryToGenerateFunction = func(_llcppg_param1 OrcDefinitionGeneratorRef, _llcppg_param2 unsafe.Pointer, _llcppg_param3 *OrcLookupStateRef, _llcppg_param4 OrcLookupKind, _llcppg_param5 OrcJITDylibRef, _llcppg_param6 OrcJITDylibLookupFlags, _llcppg_param7 OrcCLookupSet, _llcppg_param8 c.SizeT) ErrorRef

A custom generator function. This can be used to create a custom generator object using LLVMOrcCreateCustomCAPIDefinitionGenerator. The resulting object can be attached to a JITDylib, via LLVMOrcJITDylibAddGenerator, to receive callbacks when lookups fail to match existing definitions.

GeneratorObj will contain the address of the custom generator object.

Ctx will contain the context object passed to LLVMOrcCreateCustomCAPIDefinitionGenerator.

LookupState will contain a pointer to an LLVMOrcLookupStateRef object. This can optionally be modified to make the definition generation process asynchronous: If the LookupStateRef value is copied, and the original LLVMOrcLookupStateRef set to null, the lookup will be suspended. Once the asynchronous definition process has been completed clients must call LLVMOrcLookupStateContinueLookup to continue the lookup (this should be done unconditionally, even if errors have occurred in the mean time, to free the lookup state memory and notify the query object of the failures). If LookupState is captured this function must return LLVMErrorSuccess.

The Kind argument can be inspected to determine the lookup kind (e.g. as-if-during-static-link, or as-if-during-dlsym).

The JD argument specifies which JITDylib the definitions should be generated into.

The JDLookupFlags argument can be inspected to determine whether the original lookup included non-exported symbols.

Finally, the LookupSet argument contains the set of symbols that could not be found in JD already (the set of generation candidates).

llgo:type C

type OrcCDependenceMapPair

type OrcCDependenceMapPair struct {
	JD    OrcJITDylibRef
	Names OrcCSymbolsList
}

Represents a pair of a JITDylib and LLVMOrcCSymbolsList.

type OrcCDependenceMapPairs

type OrcCDependenceMapPairs = *OrcCDependenceMapPair

Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*, size_t)) pairs that can be used to construct a SymbolDependenceMap.

type OrcCJITDylibSearchOrder

type OrcCJITDylibSearchOrder = *OrcCJITDylibSearchOrderElement

A JITDylib search order.

The list is terminated with an element containing a null pointer for the JD field.

type OrcCJITDylibSearchOrderElement

type OrcCJITDylibSearchOrderElement struct {
	JD            OrcJITDylibRef
	JDLookupFlags OrcJITDylibLookupFlags
}

An element type for a JITDylib search order.

type OrcCLookupSet

type OrcCLookupSet = *OrcCLookupSetElement

A set of symbols to look up / generate.

The list is terminated with an element containing a null pointer for the Name field.

If a client creates an instance of this type then they are responsible for freeing it, and for ensuring that all strings have been retained over the course of its life. Clients receiving a copy from a callback are not responsible for managing lifetime or retain counts.

type OrcCLookupSetElement

type OrcCLookupSetElement struct {
	Name        OrcSymbolStringPoolEntryRef
	LookupFlags OrcSymbolLookupFlags
}

An element type for a symbol lookup set.

type OrcCSymbolAliasMapEntry

type OrcCSymbolAliasMapEntry struct {
	Name  OrcSymbolStringPoolEntryRef
	Flags JITSymbolFlags
}

Represents a SymbolAliasMapEntry

type OrcCSymbolAliasMapPair

type OrcCSymbolAliasMapPair struct {
	Name  OrcSymbolStringPoolEntryRef
	Entry OrcCSymbolAliasMapEntry
}

Represents a pair of a symbol name and SymbolAliasMapEntry.

type OrcCSymbolAliasMapPairs

type OrcCSymbolAliasMapPairs = *OrcCSymbolAliasMapPair

Represents a list of (SymbolStringPtr, (SymbolStringPtr, JITSymbolFlags)) pairs that can be used to construct a SymbolFlagsMap.

type OrcCSymbolDependenceGroup

type OrcCSymbolDependenceGroup struct {
	Symbols         OrcCSymbolsList
	Dependencies    OrcCDependenceMapPairs
	NumDependencies c.SizeT
}

A set of symbols that share dependencies.

type OrcCSymbolFlagsMapPair

type OrcCSymbolFlagsMapPair struct {
	Name  OrcSymbolStringPoolEntryRef
	Flags JITSymbolFlags
}

Represents a pair of a symbol name and LLVMJITSymbolFlags.

type OrcCSymbolFlagsMapPairs

type OrcCSymbolFlagsMapPairs = *OrcCSymbolFlagsMapPair

Represents a list of (SymbolStringPtr, JITSymbolFlags) pairs that can be used to construct a SymbolFlagsMap.

func (OrcCSymbolFlagsMapPairs) OrcDisposeCSymbolFlagsMap added in v0.3.0

func (self OrcCSymbolFlagsMapPairs) OrcDisposeCSymbolFlagsMap()

Disposes of the passed LLVMOrcCSymbolFlagsMap.

Does not release the entries themselves.

llgo:link OrcCSymbolFlagsMapPairs.OrcDisposeCSymbolFlagsMap C.LLVMOrcDisposeCSymbolFlagsMap

type OrcCSymbolMapPair

type OrcCSymbolMapPair struct {
	Name OrcSymbolStringPoolEntryRef
	Sym  JITEvaluatedSymbol
}

Represents a pair of a symbol name and an evaluated symbol.

type OrcCSymbolMapPairs

type OrcCSymbolMapPairs = *OrcCSymbolMapPair

Represents a list of (SymbolStringPtr, JITEvaluatedSymbol) pairs that can be used to construct a SymbolMap.

func (OrcCSymbolMapPairs) OrcAbsoluteSymbols added in v0.3.0

func (self OrcCSymbolMapPairs) OrcAbsoluteSymbols(NumPairs c.SizeT) OrcMaterializationUnitRef

Create a MaterializationUnit to define the given symbols as pointing to the corresponding raw addresses.

This function takes ownership of the elements of the Syms array. The Name fields of the array elements are taken to have been retained for this function. This allows the following pattern...

size_t NumPairs;
LLVMOrcCSymbolMapPairs Sym;
-- Build Syms array --
LLVMOrcMaterializationUnitRef MU =
    LLVMOrcAbsoluteSymbols(Syms, NumPairs);

... without requiring cleanup of the elements of the Sym array afterwards.

The client is still responsible for deleting the Sym array itself.

If a client wishes to reuse elements of the Sym array after this call they must explicitly retain each of the elements for themselves.

llgo:link OrcCSymbolMapPairs.OrcAbsoluteSymbols C.LLVMOrcAbsoluteSymbols

type OrcCSymbolsList

type OrcCSymbolsList struct {
	Symbols *OrcSymbolStringPoolEntryRef
	Length  c.SizeT
}

Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated length.

type OrcDefinitionGeneratorRef

type OrcDefinitionGeneratorRef = *OrcOpaqueDefinitionGenerator

A reference to an orc::DefinitionGenerator.

func OrcCreateCustomCAPIDefinitionGenerator

Create a custom generator.

The F argument will be used to implement the DefinitionGenerator's tryToGenerate method (see LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).

Ctx is a context object that will be passed to F. This argument is permitted to be null.

Dispose is the disposal function for Ctx. This argument is permitted to be null (in which case the client is responsible for the lifetime of Ctx).

func (OrcDefinitionGeneratorRef) Dispose added in v0.3.1

func (self OrcDefinitionGeneratorRef) Dispose()

Dispose of a JITDylib::DefinitionGenerator. This should only be called if ownership has not been passed to a JITDylib (e.g. because some error prevented the client from calling LLVMOrcJITDylibAddGenerator).

llgo:link OrcDefinitionGeneratorRef.Dispose C.LLVMOrcDisposeDefinitionGenerator

type OrcDisposeCAPIDefinitionGeneratorFunction

type OrcDisposeCAPIDefinitionGeneratorFunction = func(_llcppg_param1 unsafe.Pointer)

Disposer for a custom generator.

Will be called by ORC when the JITDylib that the generator is attached to is destroyed.

llgo:type C

type OrcDumpObjectsRef

type OrcDumpObjectsRef = *OrcOpaqueDumpObjects

A reference to an orc::DumpObjects object.

Can be used to dump object files to disk with unique names. Useful as an ObjectTransformLayer transform.

func OrcCreateDumpObjects

func OrcCreateDumpObjects(DumpDir *c.Char, IdentifierOverride *c.Char) OrcDumpObjectsRef

Create a DumpObjects instance.

DumpDir specifies the path to write dumped objects to. DumpDir may be empty in which case files will be dumped to the working directory.

IdentifierOverride specifies a file name stem to use when dumping objects. If empty then each MemoryBuffer's identifier will be used (with a .o suffix added if not already present). If an identifier override is supplied it will be used instead, along with an incrementing counter (since all buffers will use the same identifier, the resulting files will be named <ident>.o, <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain an extension, as a .o suffix will be added by DumpObjects.

func (OrcDumpObjectsRef) Dispose added in v0.3.1

func (self OrcDumpObjectsRef) Dispose()

Dispose of a DumpObjects instance.

llgo:link OrcDumpObjectsRef.Dispose C.LLVMOrcDisposeDumpObjects

func (OrcDumpObjectsRef) OrcDumpObjects_CallOperator added in v0.3.0

func (self OrcDumpObjectsRef) OrcDumpObjects_CallOperator(ObjBuffer *MemoryBufferRef) ErrorRef

Dump the contents of the given MemoryBuffer.

llgo:link OrcDumpObjectsRef.OrcDumpObjects_CallOperator C.LLVMOrcDumpObjects_CallOperator

type OrcErrorReporterFunction

type OrcErrorReporterFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 ErrorRef)

Error reporter function.

llgo:type C

type OrcExecutionSessionLookupHandleResultFunction

type OrcExecutionSessionLookupHandleResultFunction = func(_llcppg_param1 ErrorRef, _llcppg_param2 OrcCSymbolMapPairs, _llcppg_param3 c.SizeT, _llcppg_param4 unsafe.Pointer)

Callback type for ExecutionSession lookups.

If Err is LLVMErrorSuccess then Result will contain a pointer to a list of ( SymbolStringPtr, JITEvaluatedSymbol ) pairs of length NumPairs.

If Err is a failure value then Result and Ctx are undefined and should not be accessed. The Callback is responsible for handling the error value (e.g. by calling LLVMGetErrorMessage + LLVMDisposeErrorMessage).

The caller retains ownership of the Result array and will release all contained symbol names. Clients are responsible for retaining any symbol names that they wish to hold after the function returns.

llgo:type C

type OrcExecutionSessionRef

type OrcExecutionSessionRef = *OrcOpaqueExecutionSession

A reference to an orc::ExecutionSession instance.

func (OrcExecutionSessionRef) CreateBareJITDylib added in v0.3.1

func (self OrcExecutionSessionRef) CreateBareJITDylib(Name *c.Char) OrcJITDylibRef

Create a "bare" JITDylib.

The client is responsible for ensuring that the JITDylib's name is unique, e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.

This call does not install any library code or symbols into the newly created JITDylib. The client is responsible for all configuration.

llgo:link OrcExecutionSessionRef.CreateBareJITDylib C.LLVMOrcExecutionSessionCreateBareJITDylib

func (OrcExecutionSessionRef) CreateJITDylib added in v0.3.1

func (self OrcExecutionSessionRef) CreateJITDylib(Result *OrcJITDylibRef, Name *c.Char) ErrorRef

Create a JITDylib.

The client is responsible for ensuring that the JITDylib's name is unique, e.g. by calling LLVMOrcExecutionSessionGetJTIDylibByName first.

If a Platform is attached to the ExecutionSession then Platform::setupJITDylib will be called to install standard platform symbols (e.g. standard library interposes). If no Platform is installed then this call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will always return success.

llgo:link OrcExecutionSessionRef.CreateJITDylib C.LLVMOrcExecutionSessionCreateJITDylib

func (OrcExecutionSessionRef) Intern added in v0.3.1

Intern a string in the ExecutionSession's SymbolStringPool and return a reference to it. This increments the ref-count of the pool entry, and the returned value should be released once the client is done with it by calling LLVMOrcReleaseSymbolStringPoolEntry.

Since strings are uniqued within the SymbolStringPool LLVMOrcSymbolStringPoolEntryRefs can be compared by value to test string equality.

Note that this function does not perform linker-mangling on the string.

llgo:link OrcExecutionSessionRef.Intern C.LLVMOrcExecutionSessionIntern

func (OrcExecutionSessionRef) JITDylibByName added in v0.3.1

func (self OrcExecutionSessionRef) JITDylibByName(Name *c.Char) OrcJITDylibRef

Returns the JITDylib with the given name, or NULL if no such JITDylib exists.

llgo:link OrcExecutionSessionRef.JITDylibByName C.LLVMOrcExecutionSessionGetJITDylibByName

func (OrcExecutionSessionRef) Lookup added in v0.3.1

func (self OrcExecutionSessionRef) Lookup(K OrcLookupKind, SearchOrder OrcCJITDylibSearchOrder, SearchOrderSize c.SizeT, Symbols OrcCLookupSet, SymbolsSize c.SizeT, HandleResult OrcExecutionSessionLookupHandleResultFunction, Ctx unsafe.Pointer)

Look up symbols in an execution session.

This is a wrapper around the general ExecutionSession::lookup function.

The SearchOrder argument contains a list of (JITDylibs, JITDylibSearchFlags) pairs that describe the search order. The JITDylibs will be searched in the given order to try to find the symbols in the Symbols argument.

The Symbols argument should contain a null-terminated array of (SymbolStringPtr, SymbolLookupFlags) pairs describing the symbols to be searched for. This function takes ownership of the elements of the Symbols array. The Name fields of the Symbols elements are taken to have been retained by the client for this function. The client should *not* release the Name fields, but are still responsible for destroying the array itself.

The HandleResult function will be called once all searched for symbols have been found, or an error occurs. The HandleResult function will be passed an LLVMErrorRef indicating success or failure, and (on success) a null-terminated LLVMOrcCSymbolMapPairs array containing the function result, and the Ctx value passed to the lookup function.

The client is fully responsible for managing the lifetime of the Ctx object. A common idiom is to allocate the context prior to the lookup and deallocate it in the handler.

THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!

llgo:link OrcExecutionSessionRef.Lookup C.LLVMOrcExecutionSessionLookup

func (OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks added in v0.3.0

func (self OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(CreateContextCtx unsafe.Pointer, CreateContext MemoryManagerCreateContextCallback, NotifyTerminating MemoryManagerNotifyTerminatingCallback, AllocateCodeSection MemoryManagerAllocateCodeSectionCallback, AllocateDataSection MemoryManagerAllocateDataSectionCallback, FinalizeMemory MemoryManagerFinalizeMemoryCallback, Destroy MemoryManagerDestroyCallback) OrcObjectLayerRef

Create a RTDyldObjectLinkingLayer instance using MCJIT-memory-manager-like callbacks.

This is intended to simplify transitions for existing MCJIT clients. The callbacks used are similar (but not identical) to the callbacks for LLVMCreateSimpleMCJITMemoryManager: Unlike MCJIT, RTDyldObjectLinkingLayer will create a new memory manager for each object linked by calling the given CreateContext callback. This allows for code removal by destroying each allocator individually. Every allocator will be destroyed (if it has not been already) at RTDyldObjectLinkingLayer destruction time, and the NotifyTerminating callback will be called to indicate that no further allocation contexts will be created.

To implement MCJIT-like behavior clients can implement CreateContext, NotifyTerminating, and Destroy as:

void *CreateContext(void *CtxCtx) { return CtxCtx; }
void NotifyTerminating(void *CtxCtx) { MyOriginalDestroy(CtxCtx); }
void Destroy(void *Ctx) { }

This scheme simply reuses the CreateContextCtx pointer as the one-and-only allocation context.

llgo:link OrcExecutionSessionRef.OrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks C.LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks

func (OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager added in v0.3.0

func (self OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager() OrcObjectLayerRef

Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory management.

llgo:link OrcExecutionSessionRef.OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager C.LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager

func (OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc added in v0.3.0

func (self OrcExecutionSessionRef) OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc(ReserveAlloc Bool) OrcObjectLayerRef

Create a RTDyldObjectLinkingLayer instance using the standard SectionMemoryManager for memory management. If ReserveAlloc is true then a contiguous range of memory will be reserved for each object file.

llgo:link OrcExecutionSessionRef.OrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc C.LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManagerReserveAlloc

func (OrcExecutionSessionRef) SetErrorReporter added in v0.3.1

func (self OrcExecutionSessionRef) SetErrorReporter(ReportError OrcErrorReporterFunction, Ctx unsafe.Pointer)

Attach a custom error reporter function to the ExecutionSession.

The error reporter will be called to deliver failure notices that can not be directly reported to a caller. For example, failure to resolve symbols in the JIT linker is typically reported via the error reporter (callers requesting definitions from the JIT will typically be delivered a FailureToMaterialize error instead).

llgo:link OrcExecutionSessionRef.SetErrorReporter C.LLVMOrcExecutionSessionSetErrorReporter

func (OrcExecutionSessionRef) SymbolStringPool added in v0.3.1

func (self OrcExecutionSessionRef) SymbolStringPool() OrcSymbolStringPoolRef

Return a reference to the SymbolStringPool for an ExecutionSession.

Ownership of the pool remains with the ExecutionSession: The caller is not required to free the pool.

llgo:link OrcExecutionSessionRef.SymbolStringPool C.LLVMOrcExecutionSessionGetSymbolStringPool

type OrcExecutorAddress

type OrcExecutorAddress = c.Uint64T

Represents an address in the executor process.

type OrcGenericIRModuleOperationFunction

type OrcGenericIRModuleOperationFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 ModuleRef) ErrorRef

A function for inspecting/mutating IR modules, suitable for use with LLVMOrcThreadSafeModuleWithModuleDo.

llgo:type C

type OrcIRTransformLayerRef

type OrcIRTransformLayerRef = *OrcOpaqueIRTransformLayer

A reference to an orc::IRTransformLayer instance.

func (OrcIRTransformLayerRef) Emit added in v0.3.1

llgo:link OrcIRTransformLayerRef.Emit C.LLVMOrcIRTransformLayerEmit

func (OrcIRTransformLayerRef) SetTransform added in v0.3.1

func (self OrcIRTransformLayerRef) SetTransform(TransformFunction OrcIRTransformLayerTransformFunction, Ctx unsafe.Pointer)

Set the transform function of the provided transform layer, passing through a pointer to user provided context.

llgo:link OrcIRTransformLayerRef.SetTransform C.LLVMOrcIRTransformLayerSetTransform

type OrcIRTransformLayerTransformFunction

type OrcIRTransformLayerTransformFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 *OrcThreadSafeModuleRef, _llcppg_param3 OrcMaterializationResponsibilityRef) ErrorRef

A function for applying transformations as part of an transform layer.

Implementations of this type are responsible for managing the lifetime of the Module pointed to by ModInOut: If the LLVMModuleRef value is overwritten then the function is responsible for disposing of the incoming module. If the module is simply accessed/mutated in-place then ownership returns to the caller and the function does not need to do any lifetime management.

Clients can call LLVMOrcLLJITGetIRTransformLayer to obtain the transform layer of a LLJIT instance, and use LLVMOrcIRTransformLayerSetTransform to set the function. This can be used to override the default transform layer.

llgo:type C

type OrcIndirectStubsManagerRef

type OrcIndirectStubsManagerRef = *OrcOpaqueIndirectStubsManager

A reference to an orc::IndirectStubsManager instance.

func OrcCreateLocalIndirectStubsManager

func OrcCreateLocalIndirectStubsManager(TargetTriple *c.Char) OrcIndirectStubsManagerRef

Create a LocalIndirectStubsManager from the given target triple.

The resulting IndirectStubsManager is owned by the client and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager.

func (OrcIndirectStubsManagerRef) Dispose added in v0.3.1

func (self OrcIndirectStubsManagerRef) Dispose()

Dispose of an IndirectStubsManager.

llgo:link OrcIndirectStubsManagerRef.Dispose C.LLVMOrcDisposeIndirectStubsManager

type OrcJITDylibLookupFlags

type OrcJITDylibLookupFlags c.Uint

JITDylib lookup flags. This can be used by definition generators when deciding whether to produce a definition for a requested symbol.

This enum should be kept in sync with llvm::orc::JITDylibLookupFlags.

const (
	OrcJITDylibLookupFlagsMatchExportedSymbolsOnly OrcJITDylibLookupFlags = 0
	OrcJITDylibLookupFlagsMatchAllSymbols          OrcJITDylibLookupFlags = 1
)

type OrcJITDylibRef

type OrcJITDylibRef = *OrcOpaqueJITDylib

A reference to an orc::JITDylib instance.

func (OrcJITDylibRef) AddGenerator added in v0.3.1

func (self OrcJITDylibRef) AddGenerator(DG OrcDefinitionGeneratorRef)

Add a DefinitionGenerator to the given JITDylib.

The JITDylib will take ownership of the given generator: The client is no longer responsible for managing its memory.

llgo:link OrcJITDylibRef.AddGenerator C.LLVMOrcJITDylibAddGenerator

func (OrcJITDylibRef) Clear added in v0.3.1

func (self OrcJITDylibRef) Clear() ErrorRef

Calls remove on all trackers associated with this JITDylib, see JITDylib::clear().

llgo:link OrcJITDylibRef.Clear C.LLVMOrcJITDylibClear

func (OrcJITDylibRef) CreateResourceTracker added in v0.3.1

func (self OrcJITDylibRef) CreateResourceTracker() OrcResourceTrackerRef

Return a reference to a newly created resource tracker associated with JD. The tracker is returned with an initial ref-count of 1, and must be released with LLVMOrcReleaseResourceTracker when no longer needed.

llgo:link OrcJITDylibRef.CreateResourceTracker C.LLVMOrcJITDylibCreateResourceTracker

func (OrcJITDylibRef) DefaultResourceTracker added in v0.3.1

func (self OrcJITDylibRef) DefaultResourceTracker() OrcResourceTrackerRef

Return a reference to the default resource tracker for the given JITDylib. This operation will increase the retain count of the tracker: Clients should call LLVMOrcReleaseResourceTracker when the result is no longer needed.

llgo:link OrcJITDylibRef.DefaultResourceTracker C.LLVMOrcJITDylibGetDefaultResourceTracker

func (OrcJITDylibRef) Define added in v0.3.1

Add the given MaterializationUnit to the given JITDylib.

If this operation succeeds then JITDylib JD will take ownership of MU. If the operation fails then ownership remains with the caller who should call LLVMOrcDisposeMaterializationUnit to destroy it.

llgo:link OrcJITDylibRef.Define C.LLVMOrcJITDylibDefine

type OrcJITTargetAddress

type OrcJITTargetAddress = c.Uint64T

Represents an address in the executor process.

type OrcJITTargetMachineBuilderRef

type OrcJITTargetMachineBuilderRef = *OrcOpaqueJITTargetMachineBuilder

A reference to an orc::JITTargetMachineBuilder instance.

func (OrcJITTargetMachineBuilderRef) Dispose added in v0.3.1

func (self OrcJITTargetMachineBuilderRef) Dispose()

Dispose of a JITTargetMachineBuilder.

llgo:link OrcJITTargetMachineBuilderRef.Dispose C.LLVMOrcDisposeJITTargetMachineBuilder

func (OrcJITTargetMachineBuilderRef) SetTargetTriple added in v0.3.1

func (self OrcJITTargetMachineBuilderRef) SetTargetTriple(TargetTriple *c.Char)

Sets the target triple for the given JITTargetMachineBuilder to the given string.

llgo:link OrcJITTargetMachineBuilderRef.SetTargetTriple C.LLVMOrcJITTargetMachineBuilderSetTargetTriple

func (OrcJITTargetMachineBuilderRef) TargetTriple added in v0.3.1

func (self OrcJITTargetMachineBuilderRef) TargetTriple() *c.Char

Returns the target triple for the given JITTargetMachineBuilder as a string.

The caller owns the resulting string as must dispose of it by calling LLVMDisposeMessage

llgo:link OrcJITTargetMachineBuilderRef.TargetTriple C.LLVMOrcJITTargetMachineBuilderGetTargetTriple

type OrcLLJITBuilderObjectLinkingLayerCreatorFunction

type OrcLLJITBuilderObjectLinkingLayerCreatorFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 OrcExecutionSessionRef, _llcppg_param3 *c.Char) OrcObjectLayerRef

A function for constructing an ObjectLinkingLayer instance to be used by an LLJIT instance.

Clients can call LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator to set the creator function to use when constructing an LLJIT instance. This can be used to override the default linking layer implementation that would otherwise be chosen by LLJITBuilder.

Object linking layers returned by this function will become owned by the LLJIT instance. The client is not responsible for managing their lifetimes after the function returns.

llgo:type C

type OrcLLJITBuilderRef

type OrcLLJITBuilderRef = *OrcOpaqueLLJITBuilder

A reference to an orc::LLJITBuilder instance.

func OrcCreateLLJITBuilder

func OrcCreateLLJITBuilder() OrcLLJITBuilderRef

Create an LLVMOrcLLJITBuilder.

The client owns the resulting LLJITBuilder and should dispose of it using LLVMOrcDisposeLLJITBuilder once they are done with it.

func (OrcLLJITBuilderRef) OrcDisposeLLJITBuilder added in v0.3.0

func (self OrcLLJITBuilderRef) OrcDisposeLLJITBuilder()

Dispose of an LLVMOrcLLJITBuilderRef. This should only be called if ownership has not been passed to LLVMOrcCreateLLJIT (e.g. because some error prevented that function from being called).

llgo:link OrcLLJITBuilderRef.OrcDisposeLLJITBuilder C.LLVMOrcDisposeLLJITBuilder

func (OrcLLJITBuilderRef) SetJITTargetMachineBuilder added in v0.3.1

func (self OrcLLJITBuilderRef) SetJITTargetMachineBuilder(JTMB OrcJITTargetMachineBuilderRef)

Set the JITTargetMachineBuilder to be used when constructing the LLJIT instance. Calling this function is optional: if it is not called then the LLJITBuilder will use JITTargeTMachineBuilder::detectHost to construct a JITTargetMachineBuilder.

This function takes ownership of the JTMB argument: clients should not dispose of the JITTargetMachineBuilder after calling this function.

llgo:link OrcLLJITBuilderRef.SetJITTargetMachineBuilder C.LLVMOrcLLJITBuilderSetJITTargetMachineBuilder

func (OrcLLJITBuilderRef) SetObjectLinkingLayerCreator added in v0.3.1

func (self OrcLLJITBuilderRef) SetObjectLinkingLayerCreator(F OrcLLJITBuilderObjectLinkingLayerCreatorFunction, Ctx unsafe.Pointer)

Set an ObjectLinkingLayer creator function for this LLJIT instance.

llgo:link OrcLLJITBuilderRef.SetObjectLinkingLayerCreator C.LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator

type OrcLLJITRef

type OrcLLJITRef = *OrcOpaqueLLJIT

A reference to an orc::LLJIT instance.

func (OrcLLJITRef) AddIRModule added in v0.5.0

func (self OrcLLJITRef) AddIRModule(JD OrcJITDylibRef, TSM OrcThreadSafeModuleRef) ErrorRef

Add an IR module to the given JITDylib in the given LLJIT instance. This operation transfers ownership of the TSM argument to the LLJIT instance. The TSM argument should not be disposed of or referenced once this function returns.

Resources associated with the given Module will be tracked by the given JITDylib's default resource tracker.

llgo:link OrcLLJITRef.AddIRModule C.LLVMOrcLLJITAddLLVMIRModule

func (OrcLLJITRef) AddIRModuleWithRT added in v0.5.0

func (self OrcLLJITRef) AddIRModuleWithRT(JD OrcResourceTrackerRef, TSM OrcThreadSafeModuleRef) ErrorRef

Add an IR module to the given ResourceTracker's JITDylib in the given LLJIT instance. This operation transfers ownership of the TSM argument to the LLJIT instance. The TSM argument should not be disposed of or referenced once this function returns.

Resources associated with the given Module will be tracked by ResourceTracker RT.

llgo:link OrcLLJITRef.AddIRModuleWithRT C.LLVMOrcLLJITAddLLVMIRModuleWithRT

func (OrcLLJITRef) AddObjectFile added in v0.3.1

func (self OrcLLJITRef) AddObjectFile(JD OrcJITDylibRef, ObjBuffer MemoryBufferRef) ErrorRef

Add a buffer representing an object file to the given JITDylib in the given LLJIT instance. This operation transfers ownership of the buffer to the LLJIT instance. The buffer should not be disposed of or referenced once this function returns.

Resources associated with the given object will be tracked by the given JITDylib's default resource tracker.

llgo:link OrcLLJITRef.AddObjectFile C.LLVMOrcLLJITAddObjectFile

func (OrcLLJITRef) AddObjectFileWithRT added in v0.3.1

func (self OrcLLJITRef) AddObjectFileWithRT(RT OrcResourceTrackerRef, ObjBuffer MemoryBufferRef) ErrorRef

Add a buffer representing an object file to the given ResourceTracker's JITDylib in the given LLJIT instance. This operation transfers ownership of the buffer to the LLJIT instance. The buffer should not be disposed of or referenced once this function returns.

Resources associated with the given object will be tracked by ResourceTracker RT.

llgo:link OrcLLJITRef.AddObjectFileWithRT C.LLVMOrcLLJITAddObjectFileWithRT

func (OrcLLJITRef) DataLayoutStr added in v0.3.1

func (self OrcLLJITRef) DataLayoutStr() *c.Char

Get the LLJIT instance's default data layout string.

This string is owned by the LLJIT instance and does not need to be freed by the caller.

llgo:link OrcLLJITRef.DataLayoutStr C.LLVMOrcLLJITGetDataLayoutStr

func (OrcLLJITRef) EnableDebugSupport added in v0.3.1

func (self OrcLLJITRef) EnableDebugSupport() ErrorRef

Install the plugin that submits debug objects to the executor. Executors must expose the llvm_orc_registerJITLoaderGDBAllocAction symbol.

llgo:link OrcLLJITRef.EnableDebugSupport C.LLVMOrcLLJITEnableDebugSupport

func (OrcLLJITRef) ExecutionSession added in v0.3.1

func (self OrcLLJITRef) ExecutionSession() OrcExecutionSessionRef

Get a reference to the ExecutionSession for this LLJIT instance.

The ExecutionSession is owned by the LLJIT instance. The client is not responsible for managing its memory.

llgo:link OrcLLJITRef.ExecutionSession C.LLVMOrcLLJITGetExecutionSession

func (OrcLLJITRef) GlobalPrefix added in v0.3.1

func (self OrcLLJITRef) GlobalPrefix() c.Char

Returns the global prefix character according to the LLJIT's DataLayout.

llgo:link OrcLLJITRef.GlobalPrefix C.LLVMOrcLLJITGetGlobalPrefix

func (OrcLLJITRef) IRTransformLayer added in v0.3.1

func (self OrcLLJITRef) IRTransformLayer() OrcIRTransformLayerRef

Returns a non-owning reference to the LLJIT instance's IR transform layer.

llgo:link OrcLLJITRef.IRTransformLayer C.LLVMOrcLLJITGetIRTransformLayer

func (OrcLLJITRef) Lookup added in v0.3.1

func (self OrcLLJITRef) Lookup(Result *OrcExecutorAddress, Name *c.Char) ErrorRef

Look up the given symbol in the main JITDylib of the given LLJIT instance.

This operation does not take ownership of the Name argument.

llgo:link OrcLLJITRef.Lookup C.LLVMOrcLLJITLookup

func (OrcLLJITRef) MainJITDylib added in v0.3.1

func (self OrcLLJITRef) MainJITDylib() OrcJITDylibRef

Return a reference to the Main JITDylib.

The JITDylib is owned by the LLJIT instance. The client is not responsible for managing its memory.

llgo:link OrcLLJITRef.MainJITDylib C.LLVMOrcLLJITGetMainJITDylib

func (OrcLLJITRef) MangleAndIntern added in v0.3.1

func (self OrcLLJITRef) MangleAndIntern(UnmangledName *c.Char) OrcSymbolStringPoolEntryRef

Mangles the given string according to the LLJIT instance's DataLayout, then interns the result in the SymbolStringPool and returns a reference to the pool entry. Clients should call LLVMOrcReleaseSymbolStringPoolEntry to decrement the ref-count on the pool entry once they are finished with this value.

llgo:link OrcLLJITRef.MangleAndIntern C.LLVMOrcLLJITMangleAndIntern

func (OrcLLJITRef) ObjLinkingLayer added in v0.3.1

func (self OrcLLJITRef) ObjLinkingLayer() OrcObjectLayerRef

Returns a non-owning reference to the LLJIT instance's object linking layer.

llgo:link OrcLLJITRef.ObjLinkingLayer C.LLVMOrcLLJITGetObjLinkingLayer

func (OrcLLJITRef) ObjTransformLayer added in v0.3.1

func (self OrcLLJITRef) ObjTransformLayer() OrcObjectTransformLayerRef

Returns a non-owning reference to the LLJIT instance's object linking layer.

llgo:link OrcLLJITRef.ObjTransformLayer C.LLVMOrcLLJITGetObjTransformLayer

func (OrcLLJITRef) OrcDisposeLLJIT added in v0.3.0

func (self OrcLLJITRef) OrcDisposeLLJIT() ErrorRef

Dispose of an LLJIT instance.

llgo:link OrcLLJITRef.OrcDisposeLLJIT C.LLVMOrcDisposeLLJIT

func (OrcLLJITRef) TripleString added in v0.3.1

func (self OrcLLJITRef) TripleString() *c.Char

Return the target triple for this LLJIT instance. This string is owned by the LLJIT instance and should not be freed by the client.

llgo:link OrcLLJITRef.TripleString C.LLVMOrcLLJITGetTripleString

type OrcLazyCallThroughManagerRef

type OrcLazyCallThroughManagerRef = *OrcOpaqueLazyCallThroughManager

A reference to an orc::LazyCallThroughManager instance.

func (OrcLazyCallThroughManagerRef) Dispose added in v0.3.1

func (self OrcLazyCallThroughManagerRef) Dispose()

Dispose of an LazyCallThroughManager.

llgo:link OrcLazyCallThroughManagerRef.Dispose C.LLVMOrcDisposeLazyCallThroughManager

func (OrcLazyCallThroughManagerRef) OrcLazyReexports added in v0.3.0

Create a MaterializationUnit to define lazy re-expots. These are callable entry points that call through to the given symbols.

This function takes ownership of the CallableAliases array. The Name fields of the array elements are taken to have been retained for this function. This allows the following pattern...

size_t NumPairs;
LLVMOrcCSymbolAliasMapPairs CallableAliases;
-- Build CallableAliases array --
LLVMOrcMaterializationUnitRef MU =
   LLVMOrcLazyReexports(LCTM, ISM, JD, CallableAliases, NumPairs);

... without requiring cleanup of the elements of the CallableAliases array afterwards.

The client is still responsible for deleting the CallableAliases array itself.

If a client wishes to reuse elements of the CallableAliases array after this call they must explicitly retain each of the elements for themselves.

llgo:link OrcLazyCallThroughManagerRef.OrcLazyReexports C.LLVMOrcLazyReexports

type OrcLookupKind

type OrcLookupKind c.Uint

Lookup kind. This can be used by definition generators when deciding whether to produce a definition for a requested symbol.

This enum should be kept in sync with llvm::orc::LookupKind.

const (
	OrcLookupKindStatic OrcLookupKind = 0
	OrcLookupKindDLSym  OrcLookupKind = 1
)

type OrcLookupStateRef

type OrcLookupStateRef = *OrcOpaqueLookupState

An opaque lookup state object. Instances of this type can be captured to suspend a lookup while a custom generator function attempts to produce a definition.

If a client captures a lookup state object then they must eventually call LLVMOrcLookupStateContinueLookup to restart the lookup. This is required in order to release memory allocated for the lookup state, even if errors have occurred while the lookup was suspended (if these errors have made the lookup impossible to complete then it will issue its own error before destruction).

func (OrcLookupStateRef) ContinueLookup added in v0.3.1

func (self OrcLookupStateRef) ContinueLookup(Err ErrorRef)

Continue a lookup that was suspended in a generator (see LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).

llgo:link OrcLookupStateRef.ContinueLookup C.LLVMOrcLookupStateContinueLookup

type OrcMaterializationResponsibilityRef

type OrcMaterializationResponsibilityRef = *OrcOpaqueMaterializationResponsibility

A reference to a uniquely owned orc::MaterializationResponsibility instance.

Ownership must be passed to a lower-level layer in a JIT stack.

func (OrcMaterializationResponsibilityRef) DefineMaterializing added in v0.3.1

func (self OrcMaterializationResponsibilityRef) DefineMaterializing(Pairs OrcCSymbolFlagsMapPairs, NumPairs c.SizeT) ErrorRef

Attempt to claim responsibility for new definitions. This method can be used to claim responsibility for symbols that are added to a materialization unit during the compilation process (e.g. literal pool symbols). Symbol linkage rules are the same as for symbols that are defined up front: duplicate strong definitions will result in errors. Duplicate weak definitions will be discarded (in which case they will not be added to this responsibility instance).

This method can be used by materialization units that want to add additional symbols at materialization time (e.g. stubs, compile callbacks, metadata)

llgo:link OrcMaterializationResponsibilityRef.DefineMaterializing C.LLVMOrcMaterializationResponsibilityDefineMaterializing

func (OrcMaterializationResponsibilityRef) Delegate added in v0.3.1

Delegates responsibility for the given symbols to the returned materialization responsibility. Useful for breaking up work between threads, or different kinds of materialization processes.

The caller retains responsibility of the the passed MaterializationResponsibility.

llgo:link OrcMaterializationResponsibilityRef.Delegate C.LLVMOrcMaterializationResponsibilityDelegate

func (OrcMaterializationResponsibilityRef) Dispose added in v0.3.1

func (self OrcMaterializationResponsibilityRef) Dispose()

Disposes of the passed MaterializationResponsibility object.

This should only be done after the symbols covered by the object have either been resolved and emitted (via LLVMOrcMaterializationResponsibilityNotifyResolved and LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via LLVMOrcMaterializationResponsibilityFailMaterialization).

llgo:link OrcMaterializationResponsibilityRef.Dispose C.LLVMOrcDisposeMaterializationResponsibility

func (OrcMaterializationResponsibilityRef) ExecutionSession added in v0.3.1

Returns the ExecutionSession for this MaterializationResponsibility.

llgo:link OrcMaterializationResponsibilityRef.ExecutionSession C.LLVMOrcMaterializationResponsibilityGetExecutionSession

func (OrcMaterializationResponsibilityRef) FailMaterialization added in v0.3.1

func (self OrcMaterializationResponsibilityRef) FailMaterialization()

Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has occurred. This will remove all symbols covered by this MaterializationResponsibility from the target JITDylib, and send an error to any queries waiting on these symbols.

llgo:link OrcMaterializationResponsibilityRef.FailMaterialization C.LLVMOrcMaterializationResponsibilityFailMaterialization

func (OrcMaterializationResponsibilityRef) InitializerSymbol added in v0.3.1

Returns the initialization pseudo-symbol, if any. This symbol will also be present in the SymbolFlagsMap for this MaterializationResponsibility object.

The returned symbol is not retained over any mutating operation of the MaterializationResponsbility or beyond the lifetime thereof.

llgo:link OrcMaterializationResponsibilityRef.InitializerSymbol C.LLVMOrcMaterializationResponsibilityGetInitializerSymbol

func (OrcMaterializationResponsibilityRef) NotifyEmitted added in v0.3.1

func (self OrcMaterializationResponsibilityRef) NotifyEmitted(SymbolDepGroups *OrcCSymbolDependenceGroup, NumSymbolDepGroups c.SizeT) ErrorRef

Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by this MaterializationResponsibility instance have been emitted.

This function takes ownership of the symbols in the Dependencies struct. This allows the following pattern...

LLVMOrcSymbolStringPoolEntryRef Names[] = {...};
LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}}
LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence,

1);

... without requiring cleanup of the elements of the Names array afterwards.

The client is still responsible for deleting the Dependencies.Names arrays, and the Dependencies array itself.

This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies have been registered for the symbols covered by this MaterializationResponsibility then this method is guaranteed to return LLVMErrorSuccess.

llgo:link OrcMaterializationResponsibilityRef.NotifyEmitted C.LLVMOrcMaterializationResponsibilityNotifyEmitted

func (OrcMaterializationResponsibilityRef) NotifyResolved added in v0.3.1

func (self OrcMaterializationResponsibilityRef) NotifyResolved(Symbols OrcCSymbolMapPairs, NumPairs c.SizeT) ErrorRef

Notifies the target JITDylib that the given symbols have been resolved. This will update the given symbols' addresses in the JITDylib, and notify any pending queries on the given symbols of their resolution. The given symbols must be ones covered by this MaterializationResponsibility instance. Individual calls to this method may resolve a subset of the symbols, but all symbols must have been resolved prior to calling emit.

This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call LLVMOrcMaterializationResponsibilityFailMaterialization. If no dependencies have been registered for the symbols covered by this MaterializationResponsibility then this method is guaranteed to return LLVMErrorSuccess.

llgo:link OrcMaterializationResponsibilityRef.NotifyResolved C.LLVMOrcMaterializationResponsibilityNotifyResolved

func (OrcMaterializationResponsibilityRef) Replace added in v0.3.1

Transfers responsibility to the given MaterializationUnit for all symbols defined by that MaterializationUnit. This allows materializers to break up work based on run-time information (e.g. by introspecting which symbols have actually been looked up and materializing only those).

llgo:link OrcMaterializationResponsibilityRef.Replace C.LLVMOrcMaterializationResponsibilityReplace

func (OrcMaterializationResponsibilityRef) RequestedSymbols added in v0.3.1

func (self OrcMaterializationResponsibilityRef) RequestedSymbols(NumSymbols *c.SizeT) *OrcSymbolStringPoolEntryRef

Returns the names of any symbols covered by this MaterializationResponsibility object that have queries pending. This information can be used to return responsibility for unrequested symbols back to the JITDylib via the delegate method.

llgo:link OrcMaterializationResponsibilityRef.RequestedSymbols C.LLVMOrcMaterializationResponsibilityGetRequestedSymbols

func (OrcMaterializationResponsibilityRef) Symbols added in v0.3.1

Returns the symbol flags map for this responsibility instance.

The length of the array is returned in NumPairs and the caller is responsible for the returned memory and needs to call LLVMOrcDisposeCSymbolFlagsMap.

To use the returned symbols beyond the livetime of the MaterializationResponsibility requires the caller to retain the symbols explicitly.

llgo:link OrcMaterializationResponsibilityRef.Symbols C.LLVMOrcMaterializationResponsibilityGetSymbols

func (OrcMaterializationResponsibilityRef) TargetDylib added in v0.3.1

Returns the target JITDylib that these symbols are being materialized into.

llgo:link OrcMaterializationResponsibilityRef.TargetDylib C.LLVMOrcMaterializationResponsibilityGetTargetDylib

type OrcMaterializationUnitDestroyFunction

type OrcMaterializationUnitDestroyFunction = func(_llcppg_param1 unsafe.Pointer)

A MaterializationUnit destruction callback.

If a custom MaterializationUnit is destroyed before its Materialize function is called then this function will be called to provide an opportunity for the underlying program representation to be destroyed.

llgo:type C

type OrcMaterializationUnitDiscardFunction

type OrcMaterializationUnitDiscardFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 OrcJITDylibRef, _llcppg_param3 OrcSymbolStringPoolEntryRef)

A MaterializationUnit discard callback.

Ownership of JD and Symbol remain with the caller: These arguments should not be disposed of or released.

llgo:type C

type OrcMaterializationUnitMaterializeFunction

type OrcMaterializationUnitMaterializeFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 OrcMaterializationResponsibilityRef)

A MaterializationUnit materialize callback.

Ownership of the Ctx and MR arguments passes to the callback which must adhere to the LLVMOrcMaterializationResponsibilityRef contract (see comment for that type).

If this callback is called then the LLVMOrcMaterializationUnitDestroy callback will NOT be called.

llgo:type C

type OrcMaterializationUnitRef

type OrcMaterializationUnitRef = *OrcOpaqueMaterializationUnit

A reference to a uniquely owned orc::MaterializationUnit instance.

func OrcCreateCustomMaterializationUnit

Create a custom MaterializationUnit.

Name is a name for this MaterializationUnit to be used for identification and logging purposes (e.g. if this MaterializationUnit produces an object buffer then the name of that buffer will be derived from this name).

The Syms list contains the names and linkages of the symbols provided by this unit. This function takes ownership of the elements of the Syms array. The Name fields of the array elements are taken to have been retained for this function. The client should *not* release the elements of the array, but is still responsible for destroying the array itself.

The InitSym argument indicates whether or not this MaterializationUnit contains static initializers. If three are no static initializers (the common case) then this argument should be null. If there are static initializers then InitSym should be set to a unique name that also appears in the Syms list with the LLVMJITSymbolGenericFlagsMaterializationSideEffectsOnly flag set. This function takes ownership of the InitSym, which should have been retained twice on behalf of this function: once for the Syms entry and once for InitSym. If clients wish to use the InitSym value after this function returns they must retain it once more for themselves.

If any of the symbols in the Syms list is looked up then the Materialize function will be called.

If any of the symbols in the Syms list is overridden then the Discard function will be called.

The caller owns the underling MaterializationUnit and is responsible for either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing of it by calling LLVMOrcDisposeMaterializationUnit.

func (OrcMaterializationUnitRef) Dispose added in v0.3.1

func (self OrcMaterializationUnitRef) Dispose()

Dispose of a MaterializationUnit.

llgo:link OrcMaterializationUnitRef.Dispose C.LLVMOrcDisposeMaterializationUnit

type OrcObjectLayerRef

type OrcObjectLayerRef = *OrcOpaqueObjectLayer

A reference to an orc::ObjectLayer instance.

func (OrcObjectLayerRef) AddObjectFile added in v0.3.1

func (self OrcObjectLayerRef) AddObjectFile(JD OrcJITDylibRef, ObjBuffer MemoryBufferRef) ErrorRef

Add an object to an ObjectLayer to the given JITDylib.

Adds a buffer representing an object file to the given JITDylib using the given ObjectLayer instance. This operation transfers ownership of the buffer to the ObjectLayer instance. The buffer should not be disposed of or referenced once this function returns.

Resources associated with the given object will be tracked by the given JITDylib's default ResourceTracker.

llgo:link OrcObjectLayerRef.AddObjectFile C.LLVMOrcObjectLayerAddObjectFile

func (OrcObjectLayerRef) AddObjectFileWithRT added in v0.3.1

func (self OrcObjectLayerRef) AddObjectFileWithRT(RT OrcResourceTrackerRef, ObjBuffer MemoryBufferRef) ErrorRef

Add an object to an ObjectLayer using the given ResourceTracker.

Adds a buffer representing an object file to the given ResourceTracker's JITDylib using the given ObjectLayer instance. This operation transfers ownership of the buffer to the ObjectLayer instance. The buffer should not be disposed of or referenced once this function returns.

Resources associated with the given object will be tracked by ResourceTracker RT.

llgo:link OrcObjectLayerRef.AddObjectFileWithRT C.LLVMOrcObjectLayerAddObjectFileWithRT

func (OrcObjectLayerRef) Dispose added in v0.3.1

func (self OrcObjectLayerRef) Dispose()

Dispose of an ObjectLayer.

llgo:link OrcObjectLayerRef.Dispose C.LLVMOrcDisposeObjectLayer

func (OrcObjectLayerRef) Emit added in v0.3.1

Emit an object buffer to an ObjectLayer.

Ownership of the responsibility object and object buffer pass to this function. The client is not responsible for cleanup.

llgo:link OrcObjectLayerRef.Emit C.LLVMOrcObjectLayerEmit

func (OrcObjectLayerRef) OrcRTDyldObjectLinkingLayerRegisterJITEventListener added in v0.3.0

func (self OrcObjectLayerRef) OrcRTDyldObjectLinkingLayerRegisterJITEventListener(Listener JITEventListenerRef)

Add the given listener to the given RTDyldObjectLinkingLayer.

Note: Layer must be an RTDyldObjectLinkingLayer instance or behavior is undefined.

llgo:link OrcObjectLayerRef.OrcRTDyldObjectLinkingLayerRegisterJITEventListener C.LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener

type OrcObjectLinkingLayerRef

type OrcObjectLinkingLayerRef = *OrcOpaqueObjectLinkingLayer

A reference to an orc::ObjectLinkingLayer instance.

type OrcObjectTransformLayerRef

type OrcObjectTransformLayerRef = *OrcOpaqueObjectTransformLayer

A reference to an orc::ObjectTransformLayer instance.

func (OrcObjectTransformLayerRef) SetTransform added in v0.3.1

func (self OrcObjectTransformLayerRef) SetTransform(TransformFunction OrcObjectTransformLayerTransformFunction, Ctx unsafe.Pointer)

Set the transform function on an LLVMOrcObjectTransformLayer.

llgo:link OrcObjectTransformLayerRef.SetTransform C.LLVMOrcObjectTransformLayerSetTransform

type OrcObjectTransformLayerTransformFunction

type OrcObjectTransformLayerTransformFunction = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 *MemoryBufferRef) ErrorRef

A function for applying transformations to an object file buffer.

Implementations of this type are responsible for managing the lifetime of the memory buffer pointed to by ObjInOut: If the LLVMMemoryBufferRef value is overwritten then the function is responsible for disposing of the incoming buffer. If the buffer is simply accessed/mutated in-place then ownership returns to the caller and the function does not need to do any lifetime management.

The transform is allowed to return an error, in which case the ObjInOut buffer should be disposed of and set to null.

llgo:type C

type OrcOpaqueDefinitionGenerator

type OrcOpaqueDefinitionGenerator struct {
}

type OrcOpaqueDumpObjects

type OrcOpaqueDumpObjects struct {
}

type OrcOpaqueExecutionSession

type OrcOpaqueExecutionSession struct {
}

type OrcOpaqueIRTransformLayer

type OrcOpaqueIRTransformLayer struct {
}

type OrcOpaqueIndirectStubsManager

type OrcOpaqueIndirectStubsManager struct {
}

type OrcOpaqueJITDylib

type OrcOpaqueJITDylib struct {
}

type OrcOpaqueJITTargetMachineBuilder

type OrcOpaqueJITTargetMachineBuilder struct {
}

type OrcOpaqueLLJIT

type OrcOpaqueLLJIT struct {
}

type OrcOpaqueLLJITBuilder

type OrcOpaqueLLJITBuilder struct {
}

type OrcOpaqueLazyCallThroughManager

type OrcOpaqueLazyCallThroughManager struct {
}

type OrcOpaqueLookupState

type OrcOpaqueLookupState struct {
}

type OrcOpaqueMaterializationResponsibility

type OrcOpaqueMaterializationResponsibility struct {
}

type OrcOpaqueMaterializationUnit

type OrcOpaqueMaterializationUnit struct {
}

type OrcOpaqueObjectLayer

type OrcOpaqueObjectLayer struct {
}

type OrcOpaqueObjectLinkingLayer

type OrcOpaqueObjectLinkingLayer struct {
}

type OrcOpaqueObjectTransformLayer

type OrcOpaqueObjectTransformLayer struct {
}

type OrcOpaqueResourceTracker

type OrcOpaqueResourceTracker struct {
}

type OrcOpaqueSymbolStringPool

type OrcOpaqueSymbolStringPool struct {
}

type OrcOpaqueSymbolStringPoolEntry

type OrcOpaqueSymbolStringPoolEntry struct {
}

type OrcOpaqueThreadSafeContext

type OrcOpaqueThreadSafeContext struct {
}

type OrcOpaqueThreadSafeModule

type OrcOpaqueThreadSafeModule struct {
}

type OrcResourceTrackerRef

type OrcResourceTrackerRef = *OrcOpaqueResourceTracker

A reference to an orc::ResourceTracker instance.

func (OrcResourceTrackerRef) Release added in v0.3.1

func (self OrcResourceTrackerRef) Release()

Reduces the ref-count of a ResourceTracker.

llgo:link OrcResourceTrackerRef.Release C.LLVMOrcReleaseResourceTracker

func (OrcResourceTrackerRef) Remove added in v0.3.1

func (self OrcResourceTrackerRef) Remove() ErrorRef

Remove all resources associated with the given tracker. See ResourceTracker::remove().

llgo:link OrcResourceTrackerRef.Remove C.LLVMOrcResourceTrackerRemove

type OrcSymbolLookupFlags

type OrcSymbolLookupFlags c.Uint

Symbol lookup flags for lookup sets. This should be kept in sync with llvm::orc::SymbolLookupFlags.

const (
	OrcSymbolLookupFlagsRequiredSymbol         OrcSymbolLookupFlags = 0
	OrcSymbolLookupFlagsWeaklyReferencedSymbol OrcSymbolLookupFlags = 1
)

type OrcSymbolPredicate

type OrcSymbolPredicate = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 OrcSymbolStringPoolEntryRef) c.Int

Predicate function for SymbolStringPoolEntries.

llgo:type C

type OrcSymbolStringPoolEntryRef

type OrcSymbolStringPoolEntryRef = *OrcOpaqueSymbolStringPoolEntry

A reference to an orc::SymbolStringPool table entry.

func (OrcSymbolStringPoolEntryRef) Release added in v0.3.1

func (self OrcSymbolStringPoolEntryRef) Release()

Reduces the ref-count for of a SymbolStringPool entry.

llgo:link OrcSymbolStringPoolEntryRef.Release C.LLVMOrcReleaseSymbolStringPoolEntry

func (OrcSymbolStringPoolEntryRef) Retain added in v0.3.1

func (self OrcSymbolStringPoolEntryRef) Retain()

Increments the ref-count for a SymbolStringPool entry.

llgo:link OrcSymbolStringPoolEntryRef.Retain C.LLVMOrcRetainSymbolStringPoolEntry

func (OrcSymbolStringPoolEntryRef) Str added in v0.3.1

func (self OrcSymbolStringPoolEntryRef) Str() *c.Char

Return the c-string for the given symbol. This string will remain valid until the entry is freed (once all LLVMOrcSymbolStringPoolEntryRefs have been released).

llgo:link OrcSymbolStringPoolEntryRef.Str C.LLVMOrcSymbolStringPoolEntryStr

type OrcSymbolStringPoolRef

type OrcSymbolStringPoolRef = *OrcOpaqueSymbolStringPool

A reference to an orc::SymbolStringPool.

func (OrcSymbolStringPoolRef) ClearDeadEntries added in v0.3.1

func (self OrcSymbolStringPoolRef) ClearDeadEntries()

Clear all unreferenced symbol string pool entries.

This can be called at any time to release unused entries in the ExecutionSession's string pool. Since it locks the pool (preventing interning of any new strings) it is recommended that it only be called infrequently, ideally when the caller has reason to believe that some entries will have become unreferenced, e.g. after removing a module or closing a JITDylib.

llgo:link OrcSymbolStringPoolRef.ClearDeadEntries C.LLVMOrcSymbolStringPoolClearDeadEntries

type OrcThreadSafeContextRef

type OrcThreadSafeContextRef = *OrcOpaqueThreadSafeContext

A reference to an orc::ThreadSafeContext instance.

func OrcCreateNewThreadSafeContext

func OrcCreateNewThreadSafeContext() OrcThreadSafeContextRef

Create a ThreadSafeContextRef containing a new LLVMContext.

Ownership of the underlying ThreadSafeContext data is shared: Clients can and should dispose of their ThreadSafeContextRef as soon as they no longer need to refer to it directly. Other references (e.g. from ThreadSafeModules) will keep the underlying data alive as long as it is needed.

func (OrcThreadSafeContextRef) Dispose added in v0.3.1

func (self OrcThreadSafeContextRef) Dispose()

Dispose of a ThreadSafeContext.

llgo:link OrcThreadSafeContextRef.Dispose C.LLVMOrcDisposeThreadSafeContext

type OrcThreadSafeModuleRef

type OrcThreadSafeModuleRef = *OrcOpaqueThreadSafeModule

A reference to an orc::ThreadSafeModule instance.

func (OrcThreadSafeModuleRef) Dispose added in v0.3.1

func (self OrcThreadSafeModuleRef) Dispose()

Dispose of a ThreadSafeModule. This should only be called if ownership has not been passed to LLJIT (e.g. because some error prevented the client from adding this to the JIT).

llgo:link OrcThreadSafeModuleRef.Dispose C.LLVMOrcDisposeThreadSafeModule

func (OrcThreadSafeModuleRef) WithModuleDo added in v0.3.1

Apply the given function to the module contained in this ThreadSafeModule.

llgo:link OrcThreadSafeModuleRef.WithModuleDo C.LLVMOrcThreadSafeModuleWithModuleDo

type PassBuilderOptionsRef added in v0.2.0

type PassBuilderOptionsRef = *OpaquePassBuilderOptions

A set of options passed which are attached to the Pass Manager upon run.

This corresponds to an llvm::LLVMPassBuilderOptions instance

The details for how the different properties of this structure are used can be found in the source for LLVMRunPasses

func CreatePassBuilderOptions added in v0.2.0

func CreatePassBuilderOptions() PassBuilderOptionsRef

Create a new set of options for a PassBuilder

Ownership of the returned instance is given to the client, and they are responsible for it. The client should call LLVMDisposePassBuilderOptions to free the pass builder options.

func (PassBuilderOptionsRef) Dispose added in v0.3.1

func (self PassBuilderOptionsRef) Dispose()

Dispose of a heap-allocated PassBuilderOptions instance

llgo:link PassBuilderOptionsRef.Dispose C.LLVMDisposePassBuilderOptions

func (PassBuilderOptionsRef) SetAAPipeline added in v0.3.1

func (self PassBuilderOptionsRef) SetAAPipeline(AAPipeline *c.Char)

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one. The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

llgo:link PassBuilderOptionsRef.SetAAPipeline C.LLVMPassBuilderOptionsSetAAPipeline

func (PassBuilderOptionsRef) SetCallGraphProfile added in v0.3.1

func (self PassBuilderOptionsRef) SetCallGraphProfile(CallGraphProfile Bool)

llgo:link PassBuilderOptionsRef.SetCallGraphProfile C.LLVMPassBuilderOptionsSetCallGraphProfile

func (PassBuilderOptionsRef) SetDebugLogging added in v0.3.1

func (self PassBuilderOptionsRef) SetDebugLogging(DebugLogging Bool)

Toggle debug logging when running the PassBuilder

llgo:link PassBuilderOptionsRef.SetDebugLogging C.LLVMPassBuilderOptionsSetDebugLogging

func (PassBuilderOptionsRef) SetForgetAllSCEVInLoopUnroll added in v0.3.1

func (self PassBuilderOptionsRef) SetForgetAllSCEVInLoopUnroll(ForgetAllSCEVInLoopUnroll Bool)

llgo:link PassBuilderOptionsRef.SetForgetAllSCEVInLoopUnroll C.LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll

func (PassBuilderOptionsRef) SetInlinerThreshold added in v0.3.1

func (self PassBuilderOptionsRef) SetInlinerThreshold(Threshold c.Int)

llgo:link PassBuilderOptionsRef.SetInlinerThreshold C.LLVMPassBuilderOptionsSetInlinerThreshold

func (PassBuilderOptionsRef) SetLicmMssaNoAccForPromotionCap added in v0.3.1

func (self PassBuilderOptionsRef) SetLicmMssaNoAccForPromotionCap(LicmMssaNoAccForPromotionCap c.Uint)

llgo:link PassBuilderOptionsRef.SetLicmMssaNoAccForPromotionCap C.LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap

func (PassBuilderOptionsRef) SetLicmMssaOptCap added in v0.3.1

func (self PassBuilderOptionsRef) SetLicmMssaOptCap(LicmMssaOptCap c.Uint)

llgo:link PassBuilderOptionsRef.SetLicmMssaOptCap C.LLVMPassBuilderOptionsSetLicmMssaOptCap

func (PassBuilderOptionsRef) SetLoopInterleaving added in v0.3.1

func (self PassBuilderOptionsRef) SetLoopInterleaving(LoopInterleaving Bool)

llgo:link PassBuilderOptionsRef.SetLoopInterleaving C.LLVMPassBuilderOptionsSetLoopInterleaving

func (PassBuilderOptionsRef) SetLoopUnrolling added in v0.3.1

func (self PassBuilderOptionsRef) SetLoopUnrolling(LoopUnrolling Bool)

llgo:link PassBuilderOptionsRef.SetLoopUnrolling C.LLVMPassBuilderOptionsSetLoopUnrolling

func (PassBuilderOptionsRef) SetLoopVectorization added in v0.3.1

func (self PassBuilderOptionsRef) SetLoopVectorization(LoopVectorization Bool)

llgo:link PassBuilderOptionsRef.SetLoopVectorization C.LLVMPassBuilderOptionsSetLoopVectorization

func (PassBuilderOptionsRef) SetMergeFunctions added in v0.3.1

func (self PassBuilderOptionsRef) SetMergeFunctions(MergeFunctions Bool)

llgo:link PassBuilderOptionsRef.SetMergeFunctions C.LLVMPassBuilderOptionsSetMergeFunctions

func (PassBuilderOptionsRef) SetSLPVectorization added in v0.3.1

func (self PassBuilderOptionsRef) SetSLPVectorization(SLPVectorization Bool)

llgo:link PassBuilderOptionsRef.SetSLPVectorization C.LLVMPassBuilderOptionsSetSLPVectorization

func (PassBuilderOptionsRef) SetVerifyEach added in v0.3.1

func (self PassBuilderOptionsRef) SetVerifyEach(VerifyEach Bool)

Toggle adding the VerifierPass for the PassBuilder, ensuring all functions inside the module is valid.

llgo:link PassBuilderOptionsRef.SetVerifyEach C.LLVMPassBuilderOptionsSetVerifyEach

type PassManagerRef

type PassManagerRef = *OpaquePassManager

@see llvm::PassManagerBase

func CreatePassManager

func CreatePassManager() PassManagerRef

Constructs a new whole-module pass pipeline. This type of pipeline is suitable for link-time optimization and whole-module transformations. @see llvm::PassManager::PassManager

func (PassManagerRef) Dispose added in v0.3.1

func (self PassManagerRef) Dispose()

Frees the memory of a pass pipeline. For function pipelines, does not free the module provider. @see llvm::PassManagerBase::~PassManagerBase.

llgo:link PassManagerRef.Dispose C.LLVMDisposePassManager

func (PassManagerRef) FinalizeFunction added in v0.3.1

func (self PassManagerRef) FinalizeFunction() Bool

Finalizes all of the function passes scheduled in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doFinalization

llgo:link PassManagerRef.FinalizeFunction C.LLVMFinalizeFunctionPassManager

func (PassManagerRef) InitializeFunction added in v0.3.1

func (self PassManagerRef) InitializeFunction() Bool

Initializes all of the function passes scheduled in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doInitialization

llgo:link PassManagerRef.InitializeFunction C.LLVMInitializeFunctionPassManager

func (PassManagerRef) Run added in v0.3.1

func (self PassManagerRef) Run(M ModuleRef) Bool

Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::PassManager::run(Module&)

llgo:link PassManagerRef.Run C.LLVMRunPassManager

func (PassManagerRef) RunFunction added in v0.3.1

func (self PassManagerRef) RunFunction(F ValueRef) Bool

Executes all of the function passes scheduled in the function pass manager on the provided function. Returns 1 if any of the passes modified the function, false otherwise. @see llvm::FunctionPassManager::run(Function&)

llgo:link PassManagerRef.RunFunction C.LLVMRunFunctionPassManager

type RealPredicate

type RealPredicate c.Uint
const (
	RealPredicateFalse RealPredicate = 0
	RealOEQ            RealPredicate = 1
	RealOGT            RealPredicate = 2
	RealOGE            RealPredicate = 3
	RealOLT            RealPredicate = 4
	RealOLE            RealPredicate = 5
	RealONE            RealPredicate = 6
	RealORD            RealPredicate = 7
	RealUNO            RealPredicate = 8
	RealUEQ            RealPredicate = 9
	RealUGT            RealPredicate = 10
	RealUGE            RealPredicate = 11
	RealULT            RealPredicate = 12
	RealULE            RealPredicate = 13
	RealUNE            RealPredicate = 14
	// < Always true (always folded)
	RealPredicateTrue RealPredicate = 15
)

type RelocMode

type RelocMode c.Uint
const (
	RelocDefault      RelocMode = 0
	RelocStatic       RelocMode = 1
	RelocPIC          RelocMode = 2
	RelocDynamicNoPic RelocMode = 3
	RelocROPI         RelocMode = 4
	RelocRWPI         RelocMode = 5
	RelocROPI_RWPI    RelocMode = 6
)

type RelocationIteratorRef

type RelocationIteratorRef = *OpaqueRelocationIterator

func (RelocationIteratorRef) Dispose added in v0.3.1

func (self RelocationIteratorRef) Dispose()

llgo:link RelocationIteratorRef.Dispose C.LLVMDisposeRelocationIterator

func (RelocationIteratorRef) MoveToNext added in v0.3.1

func (self RelocationIteratorRef) MoveToNext()

llgo:link RelocationIteratorRef.MoveToNext C.LLVMMoveToNextRelocation

func (RelocationIteratorRef) Offset added in v0.3.1

func (self RelocationIteratorRef) Offset() c.Uint64T

RelocationRef accessors

llgo:link RelocationIteratorRef.Offset C.LLVMGetRelocationOffset

func (RelocationIteratorRef) Symbol added in v0.3.1

llgo:link RelocationIteratorRef.Symbol C.LLVMGetRelocationSymbol

func (RelocationIteratorRef) Type added in v0.3.1

func (self RelocationIteratorRef) Type() c.Uint64T

NOTE: Caller takes ownership of returned string of the two following functions.

llgo:link RelocationIteratorRef.Type C.LLVMGetRelocationType

func (RelocationIteratorRef) TypeName added in v0.3.1

func (self RelocationIteratorRef) TypeName() *c.Char

NOTE: Caller takes ownership of returned string of the two following functions.

llgo:link RelocationIteratorRef.TypeName C.LLVMGetRelocationTypeName

func (RelocationIteratorRef) ValueString added in v0.3.1

func (self RelocationIteratorRef) ValueString() *c.Char

llgo:link RelocationIteratorRef.ValueString C.LLVMGetRelocationValueString

type RemarkArgRef

type RemarkArgRef = *RemarkOpaqueArg

Element of the "Args" list. The key might give more information about what the semantics of the value are, e.g. "Callee" will tell you that the value is a symbol that names a function.

\since REMARKS_API_VERSION=0

func (RemarkArgRef) DebugLoc added in v0.3.1

func (self RemarkArgRef) DebugLoc() RemarkDebugLocRef

Returns the debug location that is attached to the value of this argument.

If there is no debug location, the return value will be `NULL`.

\since REMARKS_API_VERSION=0

llgo:link RemarkArgRef.DebugLoc C.LLVMRemarkArgGetDebugLoc

func (RemarkArgRef) Key added in v0.3.1

func (self RemarkArgRef) Key() RemarkStringRef

Returns the key of an argument. The key defines what the value is, and the same key can appear multiple times in the list of arguments.

\since REMARKS_API_VERSION=0

llgo:link RemarkArgRef.Key C.LLVMRemarkArgGetKey

func (RemarkArgRef) RemarkEntryGetNextArg added in v0.3.0

func (self RemarkArgRef) RemarkEntryGetNextArg(Remark RemarkEntryRef) RemarkArgRef

Get the next argument in \p Remark from the position of \p It.

Returns `NULL` if there are no more arguments available.

The lifetime of the returned value is bound to the lifetime of \p Remark.

\since REMARKS_API_VERSION=0

llgo:link RemarkArgRef.RemarkEntryGetNextArg C.LLVMRemarkEntryGetNextArg

func (RemarkArgRef) Value added in v0.3.1

func (self RemarkArgRef) Value() RemarkStringRef

Returns the value of an argument. This is a string that can contain newlines.

\since REMARKS_API_VERSION=0

llgo:link RemarkArgRef.Value C.LLVMRemarkArgGetValue

type RemarkDebugLocRef

type RemarkDebugLocRef = *RemarkOpaqueDebugLoc

DebugLoc containing File, Line and Column.

\since REMARKS_API_VERSION=0

func (RemarkDebugLocRef) SourceColumn added in v0.3.1

func (self RemarkDebugLocRef) SourceColumn() c.Uint32T

Return the column in the source file for a debug location.

\since REMARKS_API_VERSION=0

llgo:link RemarkDebugLocRef.SourceColumn C.LLVMRemarkDebugLocGetSourceColumn

func (RemarkDebugLocRef) SourceFilePath added in v0.3.1

func (self RemarkDebugLocRef) SourceFilePath() RemarkStringRef

Return the path to the source file for a debug location.

\since REMARKS_API_VERSION=0

llgo:link RemarkDebugLocRef.SourceFilePath C.LLVMRemarkDebugLocGetSourceFilePath

func (RemarkDebugLocRef) SourceLine added in v0.3.1

func (self RemarkDebugLocRef) SourceLine() c.Uint32T

Return the line in the source file for a debug location.

\since REMARKS_API_VERSION=0

llgo:link RemarkDebugLocRef.SourceLine C.LLVMRemarkDebugLocGetSourceLine

type RemarkEntryRef

type RemarkEntryRef = *RemarkOpaqueEntry

A remark emitted by the compiler.

\since REMARKS_API_VERSION=0

func (RemarkEntryRef) DebugLoc added in v0.3.1

func (self RemarkEntryRef) DebugLoc() RemarkDebugLocRef

Returns the debug location that is attached to this remark.

If there is no debug location, the return value will be `NULL`.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.DebugLoc C.LLVMRemarkEntryGetDebugLoc

func (RemarkEntryRef) Dispose added in v0.3.1

func (self RemarkEntryRef) Dispose()

Free the resources used by the remark entry.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.Dispose C.LLVMRemarkEntryDispose

func (RemarkEntryRef) FirstArg added in v0.3.1

func (self RemarkEntryRef) FirstArg() RemarkArgRef

Get a new iterator to iterate over a remark's argument.

If there are no arguments in \p Remark, the return value will be `NULL`.

The lifetime of the returned value is bound to the lifetime of \p Remark.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.FirstArg C.LLVMRemarkEntryGetFirstArg

func (RemarkEntryRef) FunctionName added in v0.3.1

func (self RemarkEntryRef) FunctionName() RemarkStringRef

Get the name of the function being processed when the remark was emitted.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.FunctionName C.LLVMRemarkEntryGetFunctionName

func (RemarkEntryRef) Hotness added in v0.3.1

func (self RemarkEntryRef) Hotness() c.Uint64T

Return the hotness of the remark.

A hotness of `0` means this value is not set.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.Hotness C.LLVMRemarkEntryGetHotness

func (RemarkEntryRef) NumArgs added in v0.3.1

func (self RemarkEntryRef) NumArgs() c.Uint32T

The number of arguments the remark holds.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.NumArgs C.LLVMRemarkEntryGetNumArgs

func (RemarkEntryRef) PassName added in v0.3.1

func (self RemarkEntryRef) PassName() RemarkStringRef

Get the name of the pass that emitted this remark.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.PassName C.LLVMRemarkEntryGetPassName

func (RemarkEntryRef) RemarkName added in v0.3.1

func (self RemarkEntryRef) RemarkName() RemarkStringRef

Get an identifier of the remark.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.RemarkName C.LLVMRemarkEntryGetRemarkName

func (RemarkEntryRef) Type added in v0.3.1

func (self RemarkEntryRef) Type() RemarkType

The type of the remark. For example, it can allow users to only keep the missed optimizations from the compiler.

\since REMARKS_API_VERSION=0

llgo:link RemarkEntryRef.Type C.LLVMRemarkEntryGetType

type RemarkOpaqueArg

type RemarkOpaqueArg struct {
}

type RemarkOpaqueDebugLoc

type RemarkOpaqueDebugLoc struct {
}

type RemarkOpaqueEntry

type RemarkOpaqueEntry struct {
}

type RemarkOpaqueParser

type RemarkOpaqueParser struct {
}

type RemarkOpaqueString

type RemarkOpaqueString struct {
}

type RemarkParserRef

type RemarkParserRef = *RemarkOpaqueParser

func RemarkParserCreateBitstream

func RemarkParserCreateBitstream(Buf unsafe.Pointer, Size c.Uint64T) RemarkParserRef

Creates a remark parser that can be used to parse the buffer located in \p Buf of size \p Size bytes.

\p Buf cannot be `NULL`.

This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.

\since REMARKS_API_VERSION=1

func RemarkParserCreateYAML

func RemarkParserCreateYAML(Buf unsafe.Pointer, Size c.Uint64T) RemarkParserRef

Creates a remark parser that can be used to parse the buffer located in \p Buf of size \p Size bytes.

\p Buf cannot be `NULL`.

This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.

\since REMARKS_API_VERSION=0

func (RemarkParserRef) Dispose added in v0.3.1

func (self RemarkParserRef) Dispose()

Releases all the resources used by \p Parser.

\since REMARKS_API_VERSION=0

llgo:link RemarkParserRef.Dispose C.LLVMRemarkParserDispose

func (RemarkParserRef) ErrorMessage added in v0.3.1

func (self RemarkParserRef) ErrorMessage() *c.Char

Returns a null-terminated string containing an error message.

In case of no error, the result is `NULL`.

The memory of the string is bound to the lifetime of \p Parser. If LLVMRemarkParserDispose() is called, the memory of the string will be released.

\since REMARKS_API_VERSION=0

llgo:link RemarkParserRef.ErrorMessage C.LLVMRemarkParserGetErrorMessage

func (RemarkParserRef) HasError added in v0.3.1

func (self RemarkParserRef) HasError() Bool

Returns `1` if the parser encountered an error while parsing the buffer.

\since REMARKS_API_VERSION=0

llgo:link RemarkParserRef.HasError C.LLVMRemarkParserHasError

func (RemarkParserRef) Next added in v0.3.1

func (self RemarkParserRef) Next() RemarkEntryRef

Returns the next remark in the file.

The value pointed to by the return value needs to be disposed using a call to LLVMRemarkEntryDispose().

All the entries in the returned value that are of LLVMRemarkStringRef type will become invalidated once a call to LLVMRemarkParserDispose is made.

If the parser reaches the end of the buffer, the return value will be `NULL`.

In the case of an error, the return value will be `NULL`, and:

1) LLVMRemarkParserHasError() will return `1`.

  1. LLVMRemarkParserGetErrorMessage() will return a descriptive error message.

An error may occur if:

1) An argument is invalid.

2) There is a parsing error. This can occur on things like malformed YAML.

  1. There is a Remark semantic error. This can occur on well-formed files with missing or extra fields.

Here is a quick example of the usage:

``` LLVMRemarkParserRef Parser = LLVMRemarkParserCreateYAML(Buf, Size); LLVMRemarkEntryRef Remark = NULL;

while ((Remark = LLVMRemarkParserGetNext(Parser))) {
   // use Remark
   LLVMRemarkEntryDispose(Remark); // Release memory.
}

bool HasError = LLVMRemarkParserHasError(Parser); LLVMRemarkParserDispose(Parser); ```

\since REMARKS_API_VERSION=0

llgo:link RemarkParserRef.Next C.LLVMRemarkParserGetNext

type RemarkStringRef

type RemarkStringRef = *RemarkOpaqueString

String containing a buffer and a length. The buffer is not guaranteed to be zero-terminated.

\since REMARKS_API_VERSION=0

func (RemarkStringRef) Data added in v0.3.1

func (self RemarkStringRef) Data() *c.Char

Returns the buffer holding the string.

\since REMARKS_API_VERSION=0

llgo:link RemarkStringRef.Data C.LLVMRemarkStringGetData

func (RemarkStringRef) Len added in v0.3.1

func (self RemarkStringRef) Len() c.Uint32T

Returns the size of the string.

\since REMARKS_API_VERSION=0

llgo:link RemarkStringRef.Len C.LLVMRemarkStringGetLen

type RemarkType

type RemarkType c.Uint

The type of the emitted remark.

const (
	RemarkTypeUnknown           RemarkType = 0
	RemarkTypePassed            RemarkType = 1
	RemarkTypeMissed            RemarkType = 2
	RemarkTypeAnalysis          RemarkType = 3
	RemarkTypeAnalysisFPCommute RemarkType = 4
	RemarkTypeAnalysisAliasing  RemarkType = 5
	RemarkTypeFailure           RemarkType = 6
)

type SectionIteratorRef

type SectionIteratorRef = *OpaqueSectionIterator

Opaque type wrappers

func (SectionIteratorRef) Address added in v0.6.0

func (self SectionIteratorRef) Address() c.Uint64T

llgo:link SectionIteratorRef.Address C.LLVMGetSectionAddress

func (SectionIteratorRef) ContainsSymbol added in v0.6.0

func (self SectionIteratorRef) ContainsSymbol(Sym SymbolIteratorRef) Bool

llgo:link SectionIteratorRef.ContainsSymbol C.LLVMGetSectionContainsSymbol

func (SectionIteratorRef) Contents added in v0.6.0

func (self SectionIteratorRef) Contents() *c.Char

llgo:link SectionIteratorRef.Contents C.LLVMGetSectionContents

func (SectionIteratorRef) Dispose added in v0.3.1

func (self SectionIteratorRef) Dispose()

llgo:link SectionIteratorRef.Dispose C.LLVMDisposeSectionIterator

func (SectionIteratorRef) IsRelocationIteratorAtEnd added in v0.3.0

func (self SectionIteratorRef) IsRelocationIteratorAtEnd(RI RelocationIteratorRef) Bool

llgo:link SectionIteratorRef.IsRelocationIteratorAtEnd C.LLVMIsRelocationIteratorAtEnd

func (SectionIteratorRef) MoveToContaining added in v0.6.0

func (self SectionIteratorRef) MoveToContaining(Sym SymbolIteratorRef)

llgo:link SectionIteratorRef.MoveToContaining C.LLVMMoveToContainingSection

func (SectionIteratorRef) MoveToNext added in v0.6.0

func (self SectionIteratorRef) MoveToNext()

llgo:link SectionIteratorRef.MoveToNext C.LLVMMoveToNextSection

func (SectionIteratorRef) Name added in v0.6.0

func (self SectionIteratorRef) Name() *c.Char

SectionRef accessors

llgo:link SectionIteratorRef.Name C.LLVMGetSectionName

func (SectionIteratorRef) Relocations added in v0.3.0

func (self SectionIteratorRef) Relocations() RelocationIteratorRef

Section Relocation iterators

llgo:link SectionIteratorRef.Relocations C.LLVMGetRelocations

func (SectionIteratorRef) Size added in v0.6.0

func (self SectionIteratorRef) Size() c.Uint64T

llgo:link SectionIteratorRef.Size C.LLVMGetSectionSize

type SymbolIteratorRef

type SymbolIteratorRef = *OpaqueSymbolIterator

func (SymbolIteratorRef) Address added in v0.3.1

func (self SymbolIteratorRef) Address() c.Uint64T

llgo:link SymbolIteratorRef.Address C.LLVMGetSymbolAddress

func (SymbolIteratorRef) Dispose added in v0.3.1

func (self SymbolIteratorRef) Dispose()

ObjectFile Symbol iterators

llgo:link SymbolIteratorRef.Dispose C.LLVMDisposeSymbolIterator

func (SymbolIteratorRef) MoveToNext added in v0.3.1

func (self SymbolIteratorRef) MoveToNext()

llgo:link SymbolIteratorRef.MoveToNext C.LLVMMoveToNextSymbol

func (SymbolIteratorRef) Name added in v0.3.1

func (self SymbolIteratorRef) Name() *c.Char

SymbolRef accessors

llgo:link SymbolIteratorRef.Name C.LLVMGetSymbolName

func (SymbolIteratorRef) Size added in v0.3.1

func (self SymbolIteratorRef) Size() c.Uint64T

llgo:link SymbolIteratorRef.Size C.LLVMGetSymbolSize

type SymbolLookupCallback

type SymbolLookupCallback = func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.Uint64T, _llcppg_param3 *c.Uint64T, _llcppg_param4 c.Uint64T, _llcppg_param5 **c.Char) *c.Char

The type for the symbol lookup function. This may be called by the disassembler for things like adding a comment for a PC plus a constant offset load instruction to use a symbol name instead of a load address value. It is passed the block information is saved when the disassembler context is created and the ReferenceValue to look up as a symbol. If no symbol is found for the ReferenceValue NULL is returned. The ReferenceType of the instruction is passed indirectly as is the PC of the instruction in ReferencePC. If the output reference can be determined its type is returned indirectly in ReferenceType along with ReferenceName if any, or that is set to NULL.

llgo:type C

type TailCallKind

type TailCallKind c.Uint

Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.

Note that 'musttail' implies 'tail'.

@see CallInst::TailCallKind

const (
	TailCallKindNone     TailCallKind = 0
	TailCallKindTail     TailCallKind = 1
	TailCallKindMustTail TailCallKind = 2
	TailCallKindNoTail   TailCallKind = 3
)

type Target

type Target struct {
}

type TargetDataRef

type TargetDataRef = *OpaqueTargetData

func CreateTargetData

func CreateTargetData(StringRep *c.Char) TargetDataRef

Creates target data from a target layout string. See the constructor llvm::DataLayout::DataLayout.

func (TargetDataRef) ABIAlignmentOfType added in v0.3.0

func (self TargetDataRef) ABIAlignmentOfType(Ty TypeRef) c.Uint

Computes the ABI alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize.

llgo:link TargetDataRef.ABIAlignmentOfType C.LLVMABIAlignmentOfType

func (TargetDataRef) ABISizeOfType added in v0.3.0

func (self TargetDataRef) ABISizeOfType(Ty TypeRef) c.UlongLong

Computes the ABI size of a type in bytes for a target. See the method llvm::DataLayout::getTypeAllocSize.

llgo:link TargetDataRef.ABISizeOfType C.LLVMABISizeOfType

func (TargetDataRef) ByteOrder added in v0.3.0

func (self TargetDataRef) ByteOrder() ByteOrdering

Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian. See the method llvm::DataLayout::isLittleEndian.

llgo:link TargetDataRef.ByteOrder C.LLVMByteOrder

func (TargetDataRef) CallFrameAlignmentOfType added in v0.3.0

func (self TargetDataRef) CallFrameAlignmentOfType(Ty TypeRef) c.Uint

Computes the call frame alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize.

llgo:link TargetDataRef.CallFrameAlignmentOfType C.LLVMCallFrameAlignmentOfType

func (TargetDataRef) CopyStringRepOf added in v0.3.1

func (self TargetDataRef) CopyStringRepOf() *c.Char

Converts target data to a target layout string. The string must be disposed with LLVMDisposeMessage. See the constructor llvm::DataLayout::DataLayout.

llgo:link TargetDataRef.CopyStringRepOf C.LLVMCopyStringRepOfTargetData

func (TargetDataRef) Dispose added in v0.3.1

func (self TargetDataRef) Dispose()

Deallocates a TargetData. See the destructor llvm::DataLayout::~DataLayout.

llgo:link TargetDataRef.Dispose C.LLVMDisposeTargetData

func (TargetDataRef) ElementAtOffset added in v0.3.0

func (self TargetDataRef) ElementAtOffset(StructTy TypeRef, Offset c.UlongLong) c.Uint

Computes the structure element that contains the byte offset for a target. See the method llvm::StructLayout::getElementContainingOffset.

llgo:link TargetDataRef.ElementAtOffset C.LLVMElementAtOffset

func (TargetDataRef) IntPtrType added in v0.3.0

func (self TargetDataRef) IntPtrType() TypeRef

Returns the integer type that is the same size as a pointer on a target. See the method llvm::DataLayout::getIntPtrType.

llgo:link TargetDataRef.IntPtrType C.LLVMIntPtrType

func (TargetDataRef) IntPtrTypeForAS added in v0.3.0

func (self TargetDataRef) IntPtrTypeForAS(AS c.Uint) TypeRef

Returns the integer type that is the same size as a pointer on a target. This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType.

llgo:link TargetDataRef.IntPtrTypeForAS C.LLVMIntPtrTypeForAS

func (TargetDataRef) OffsetOfElement added in v0.3.0

func (self TargetDataRef) OffsetOfElement(StructTy TypeRef, Element c.Uint) c.UlongLong

Computes the byte offset of the indexed struct element for a target. See the method llvm::StructLayout::getElementContainingOffset.

llgo:link TargetDataRef.OffsetOfElement C.LLVMOffsetOfElement

func (TargetDataRef) PointerSize added in v0.3.0

func (self TargetDataRef) PointerSize() c.Uint

Returns the pointer size in bytes for a target. See the method llvm::DataLayout::getPointerSize.

llgo:link TargetDataRef.PointerSize C.LLVMPointerSize

func (TargetDataRef) PointerSizeForAS added in v0.3.0

func (self TargetDataRef) PointerSizeForAS(AS c.Uint) c.Uint

Returns the pointer size in bytes for a target for a specified address space. See the method llvm::DataLayout::getPointerSize.

llgo:link TargetDataRef.PointerSizeForAS C.LLVMPointerSizeForAS

func (TargetDataRef) PreferredAlignmentOfGlobal added in v0.3.0

func (self TargetDataRef) PreferredAlignmentOfGlobal(GlobalVar ValueRef) c.Uint

Computes the preferred alignment of a global variable in bytes for a target. See the method llvm::DataLayout::getPreferredAlignment.

llgo:link TargetDataRef.PreferredAlignmentOfGlobal C.LLVMPreferredAlignmentOfGlobal

func (TargetDataRef) PreferredAlignmentOfType added in v0.3.0

func (self TargetDataRef) PreferredAlignmentOfType(Ty TypeRef) c.Uint

Computes the preferred alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize.

llgo:link TargetDataRef.PreferredAlignmentOfType C.LLVMPreferredAlignmentOfType

func (TargetDataRef) SizeOfTypeInBits added in v0.3.0

func (self TargetDataRef) SizeOfTypeInBits(Ty TypeRef) c.UlongLong

Computes the size of a type in bits for a target. See the method llvm::DataLayout::getTypeSizeInBits.

llgo:link TargetDataRef.SizeOfTypeInBits C.LLVMSizeOfTypeInBits

func (TargetDataRef) StoreSizeOfType added in v0.3.0

func (self TargetDataRef) StoreSizeOfType(Ty TypeRef) c.UlongLong

Computes the storage size of a type in bytes for a target. See the method llvm::DataLayout::getTypeStoreSize.

llgo:link TargetDataRef.StoreSizeOfType C.LLVMStoreSizeOfType

type TargetLibraryInfoRef

type TargetLibraryInfoRef = *OpaqueTargetLibraryInfotData

func (TargetLibraryInfoRef) Add added in v0.3.1

func (self TargetLibraryInfoRef) Add(PM PassManagerRef)

Adds target library information to a pass manager. This does not take ownership of the target library info. See the method llvm::PassManagerBase::add.

llgo:link TargetLibraryInfoRef.Add C.LLVMAddTargetLibraryInfo

type TargetMachineOptionsRef

type TargetMachineOptionsRef = *OpaqueTargetMachineOptions

func CreateTargetMachineOptions

func CreateTargetMachineOptions() TargetMachineOptionsRef

Create a new set of options for an llvm::TargetMachine.

The returned option structure must be released with LLVMDisposeTargetMachineOptions() after the call to LLVMCreateTargetMachineWithOptions().

func (TargetMachineOptionsRef) Dispose added in v0.3.1

func (self TargetMachineOptionsRef) Dispose()

Dispose of an LLVMTargetMachineOptionsRef instance.

llgo:link TargetMachineOptionsRef.Dispose C.LLVMDisposeTargetMachineOptions

func (TargetMachineOptionsRef) SetABI added in v0.3.1

func (self TargetMachineOptionsRef) SetABI(ABI *c.Char)

llgo:link TargetMachineOptionsRef.SetABI C.LLVMTargetMachineOptionsSetABI

func (TargetMachineOptionsRef) SetCPU added in v0.3.1

func (self TargetMachineOptionsRef) SetCPU(CPU *c.Char)

llgo:link TargetMachineOptionsRef.SetCPU C.LLVMTargetMachineOptionsSetCPU

func (TargetMachineOptionsRef) SetCodeGenOptLevel added in v0.3.1

func (self TargetMachineOptionsRef) SetCodeGenOptLevel(Level CodeGenOptLevel)

llgo:link TargetMachineOptionsRef.SetCodeGenOptLevel C.LLVMTargetMachineOptionsSetCodeGenOptLevel

func (TargetMachineOptionsRef) SetCodeModel added in v0.3.1

func (self TargetMachineOptionsRef) SetCodeModel(CodeModel CodeModel)

llgo:link TargetMachineOptionsRef.SetCodeModel C.LLVMTargetMachineOptionsSetCodeModel

func (TargetMachineOptionsRef) SetFeatures added in v0.3.1

func (self TargetMachineOptionsRef) SetFeatures(Features *c.Char)

Set the list of features for the target machine.

\param Features a comma-separated list of features.

llgo:link TargetMachineOptionsRef.SetFeatures C.LLVMTargetMachineOptionsSetFeatures

func (TargetMachineOptionsRef) SetRelocMode added in v0.3.1

func (self TargetMachineOptionsRef) SetRelocMode(Reloc RelocMode)

llgo:link TargetMachineOptionsRef.SetRelocMode C.LLVMTargetMachineOptionsSetRelocMode

type TargetMachineRef

type TargetMachineRef = *OpaqueTargetMachine

func (TargetMachineRef) AddAnalysisPasses added in v0.3.0

func (self TargetMachineRef) AddAnalysisPasses(PM PassManagerRef)

Adds the target-specific analysis passes to the pass manager.

llgo:link TargetMachineRef.AddAnalysisPasses C.LLVMAddAnalysisPasses

func (TargetMachineRef) CPU added in v0.3.1

func (self TargetMachineRef) CPU() *c.Char

Returns the cpu used creating this target machine. See llvm::TargetMachine::getCPU. The result needs to be disposed with LLVMDisposeMessage.

llgo:link TargetMachineRef.CPU C.LLVMGetTargetMachineCPU

func (TargetMachineRef) CreateTargetDataLayout added in v0.3.0

func (self TargetMachineRef) CreateTargetDataLayout() TargetDataRef

Create a DataLayout based on the targetMachine.

llgo:link TargetMachineRef.CreateTargetDataLayout C.LLVMCreateTargetDataLayout

func (TargetMachineRef) Dispose added in v0.3.1

func (self TargetMachineRef) Dispose()

Dispose the LLVMTargetMachineRef instance generated by LLVMCreateTargetMachine.

llgo:link TargetMachineRef.Dispose C.LLVMDisposeTargetMachine

func (TargetMachineRef) EmitToFile added in v0.3.1

func (self TargetMachineRef) EmitToFile(M ModuleRef, Filename *c.Char, codegen CodeGenFileType, ErrorMessage **c.Char) Bool

Emits an asm or object file for the given module to the filename. This wraps several c++ only classes (among them a file stream). Returns any error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.

llgo:link TargetMachineRef.EmitToFile C.LLVMTargetMachineEmitToFile

func (TargetMachineRef) EmitToMemoryBuffer added in v0.3.1

func (self TargetMachineRef) EmitToMemoryBuffer(M ModuleRef, codegen CodeGenFileType, ErrorMessage **c.Char, OutMemBuf *MemoryBufferRef) Bool

Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf.

llgo:link TargetMachineRef.EmitToMemoryBuffer C.LLVMTargetMachineEmitToMemoryBuffer

func (TargetMachineRef) FeatureString added in v0.3.1

func (self TargetMachineRef) FeatureString() *c.Char

Returns the feature string used creating this target machine. See llvm::TargetMachine::getFeatureString. The result needs to be disposed with LLVMDisposeMessage.

llgo:link TargetMachineRef.FeatureString C.LLVMGetTargetMachineFeatureString

func (TargetMachineRef) OrcJITTargetMachineBuilderCreateFrom added in v0.3.1

func (self TargetMachineRef) OrcJITTargetMachineBuilderCreateFrom() OrcJITTargetMachineBuilderRef

Create a JITTargetMachineBuilder from the given TargetMachine template.

This operation takes ownership of the given TargetMachine and destroys it before returing. The resulting JITTargetMachineBuilder is owned by the client and must be passed to a consuming operation (e.g. LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.

llgo:link TargetMachineRef.OrcJITTargetMachineBuilderCreateFrom C.LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine

func (TargetMachineRef) SetTargetMachineAsmVerbosity added in v0.3.0

func (self TargetMachineRef) SetTargetMachineAsmVerbosity(VerboseAsm Bool)

Set the target machine's ASM verbosity.

llgo:link TargetMachineRef.SetTargetMachineAsmVerbosity C.LLVMSetTargetMachineAsmVerbosity

func (TargetMachineRef) SetTargetMachineFastISel added in v0.3.0

func (self TargetMachineRef) SetTargetMachineFastISel(Enable Bool)

Enable fast-path instruction selection.

llgo:link TargetMachineRef.SetTargetMachineFastISel C.LLVMSetTargetMachineFastISel

func (TargetMachineRef) SetTargetMachineGlobalISel added in v0.3.0

func (self TargetMachineRef) SetTargetMachineGlobalISel(Enable Bool)

Enable global instruction selection.

llgo:link TargetMachineRef.SetTargetMachineGlobalISel C.LLVMSetTargetMachineGlobalISel

func (TargetMachineRef) SetTargetMachineGlobalISelAbort added in v0.3.0

func (self TargetMachineRef) SetTargetMachineGlobalISelAbort(Mode GlobalISelAbortMode)

Set abort behaviour when global instruction selection fails to lower/select an instruction.

llgo:link TargetMachineRef.SetTargetMachineGlobalISelAbort C.LLVMSetTargetMachineGlobalISelAbort

func (TargetMachineRef) SetTargetMachineMachineOutliner added in v0.3.0

func (self TargetMachineRef) SetTargetMachineMachineOutliner(Enable Bool)

Enable the MachineOutliner pass.

llgo:link TargetMachineRef.SetTargetMachineMachineOutliner C.LLVMSetTargetMachineMachineOutliner

func (TargetMachineRef) Target added in v0.3.1

func (self TargetMachineRef) Target() TargetRef

Returns the Target used in a TargetMachine

llgo:link TargetMachineRef.Target C.LLVMGetTargetMachineTarget

func (TargetMachineRef) Triple added in v0.3.1

func (self TargetMachineRef) Triple() *c.Char

Returns the triple used creating this target machine. See llvm::TargetMachine::getTriple. The result needs to be disposed with LLVMDisposeMessage.

llgo:link TargetMachineRef.Triple C.LLVMGetTargetMachineTriple

type TargetRef

type TargetRef = *Target

func GetFirstTarget

func GetFirstTarget() TargetRef

Returns the first llvm::Target in the registered targets list.

func GetTargetFromName

func GetTargetFromName(Name *c.Char) TargetRef

Finds the target corresponding to the given name and stores it in \p T. Returns 0 on success.

func (TargetRef) CreateTargetMachine added in v0.3.0

func (self TargetRef) CreateTargetMachine(Triple *c.Char, CPU *c.Char, Features *c.Char, Level CodeGenOptLevel, Reloc RelocMode, CodeModel CodeModel) TargetMachineRef

Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine

llgo:link TargetRef.CreateTargetMachine C.LLVMCreateTargetMachine

func (TargetRef) CreateTargetMachineWithOptions added in v0.3.0

func (self TargetRef) CreateTargetMachineWithOptions(Triple *c.Char, Options TargetMachineOptionsRef) TargetMachineRef

Create a new llvm::TargetMachine.

\param T the target to create a machine for. \param Triple a triple describing the target machine. \param Options additional configuration (see

LLVMCreateTargetMachineOptions()).

llgo:link TargetRef.CreateTargetMachineWithOptions C.LLVMCreateTargetMachineWithOptions

func (TargetRef) Description added in v0.3.1

func (self TargetRef) Description() *c.Char

Returns the description of a target. See llvm::Target::getDescription

llgo:link TargetRef.Description C.LLVMGetTargetDescription

func (TargetRef) HasAsmBackend added in v0.3.1

func (self TargetRef) HasAsmBackend() Bool

Returns if the target as an ASM backend (required for emitting output)

llgo:link TargetRef.HasAsmBackend C.LLVMTargetHasAsmBackend

func (TargetRef) HasJIT added in v0.3.1

func (self TargetRef) HasJIT() Bool

Returns if the target has a JIT

llgo:link TargetRef.HasJIT C.LLVMTargetHasJIT

func (TargetRef) HasTargetMachine added in v0.3.1

func (self TargetRef) HasTargetMachine() Bool

Returns if the target has a TargetMachine associated

llgo:link TargetRef.HasTargetMachine C.LLVMTargetHasTargetMachine

func (TargetRef) Name added in v0.3.1

func (self TargetRef) Name() *c.Char

Returns the name of a target. See llvm::Target::getName

llgo:link TargetRef.Name C.LLVMGetTargetName

func (TargetRef) Next added in v0.3.1

func (self TargetRef) Next() TargetRef

Returns the next llvm::Target given a previous one (or null if there's none)

llgo:link TargetRef.Next C.LLVMGetNextTarget

type ThinltoCodeGenT

type ThinltoCodeGenT = *OpaqueThinLTOCodeGenerator

opaque reference to a thin code generator

func ThinltoCreateCodegen

func ThinltoCreateCodegen() ThinltoCodeGenT

Instantiates a ThinLTO code generator. Returns NULL on error (check lto_get_error_message() for details).

The ThinLTOCodeGenerator is not intended to be reuse for multiple compilation: the model is that the client adds modules to the generator and ask to perform the ThinLTO optimizations / codegen, and finally destroys the codegenerator.

\since LTO_API_VERSION=18

func (ThinltoCodeGenT) ThinltoCodegenAddCrossReferencedSymbol added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenAddCrossReferencedSymbol(name *c.Char, length c.Int)

Adds a symbol to the list of global symbols that are cross-referenced between ThinLTO files. If the ThinLTO CodeGenerator can ensure that every references from a ThinLTO module to this symbol is optimized away, then the symbol can be discarded.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenAddCrossReferencedSymbol C.thinlto_codegen_add_cross_referenced_symbol

func (ThinltoCodeGenT) ThinltoCodegenAddModule added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenAddModule(identifier *c.Char, data *c.Char, length c.Int)

Add a module to a ThinLTO code generator. Identifier has to be unique among all the modules in a code generator. The data buffer stays owned by the client, and is expected to be available for the entire lifetime of the thinlto_code_gen_t it is added to.

On failure, returns NULL (check lto_get_error_message() for details).

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenAddModule C.thinlto_codegen_add_module

func (ThinltoCodeGenT) ThinltoCodegenAddMustPreserveSymbol added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenAddMustPreserveSymbol(name *c.Char, length c.Int)

Adds a symbol to the list of global symbols that must exist in the final generated code. If a function is not listed there, it might be inlined into every usage and optimized away. For every single module, the functions referenced from code outside of the ThinLTO modules need to be added here.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenAddMustPreserveSymbol C.thinlto_codegen_add_must_preserve_symbol

func (ThinltoCodeGenT) ThinltoCodegenDisableCodegen added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenDisableCodegen(disable LtoBoolT)

Disable CodeGen, only run the stages till codegen and stop. The output will be bitcode.

\since LTO_API_VERSION=19

llgo:link ThinltoCodeGenT.ThinltoCodegenDisableCodegen C.thinlto_codegen_disable_codegen

func (ThinltoCodeGenT) ThinltoCodegenDispose added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenDispose()

Frees the generator and all memory it internally allocated. Upon return the thinlto_code_gen_t is no longer valid.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenDispose C.thinlto_codegen_dispose

func (ThinltoCodeGenT) ThinltoCodegenProcess added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenProcess()

Optimize and codegen all the modules added to the codegenerator using ThinLTO. Resulting objects are accessible using thinlto_module_get_object().

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenProcess C.thinlto_codegen_process

func (ThinltoCodeGenT) ThinltoCodegenSetCacheDir added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCacheDir(cache_dir *c.Char)

Sets the path to a directory to use as a cache storage for incremental build. Setting this activates caching.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCacheDir C.thinlto_codegen_set_cache_dir

func (ThinltoCodeGenT) ThinltoCodegenSetCacheEntryExpiration added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCacheEntryExpiration(expiration c.Uint)

Sets the expiration (in seconds) for an entry in the cache. An unspecified default value will be applied. A value of 0 will be ignored.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCacheEntryExpiration C.thinlto_codegen_set_cache_entry_expiration

func (ThinltoCodeGenT) ThinltoCodegenSetCachePruningInterval added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCachePruningInterval(interval c.Int)

Sets the cache pruning interval (in seconds). A negative value disables the pruning. An unspecified default value will be applied, and a value of 0 will force prunning to occur.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCachePruningInterval C.thinlto_codegen_set_cache_pruning_interval

func (ThinltoCodeGenT) ThinltoCodegenSetCacheSizeBytes added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCacheSizeBytes(max_size_bytes c.Uint)

Sets the maximum size of the cache directory (in bytes). A value over the amount of available space on the disk will be reduced to the amount of available space. An unspecified default value will be applied. A value of 0 will be ignored.

\since LTO_API_VERSION=22

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCacheSizeBytes C.thinlto_codegen_set_cache_size_bytes

func (ThinltoCodeGenT) ThinltoCodegenSetCacheSizeFiles added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCacheSizeFiles(max_size_files c.Uint)

Sets the maximum number of files in the cache directory. An unspecified default value will be applied. A value of 0 will be ignored.

\since LTO_API_VERSION=22

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCacheSizeFiles C.thinlto_codegen_set_cache_size_files

func (ThinltoCodeGenT) ThinltoCodegenSetCacheSizeMegabytes added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCacheSizeMegabytes(max_size_megabytes c.Uint)

Same as thinlto_codegen_set_cache_size_bytes, except the maximum size is in megabytes (2^20 bytes).

\since LTO_API_VERSION=23

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCacheSizeMegabytes C.thinlto_codegen_set_cache_size_megabytes

func (ThinltoCodeGenT) ThinltoCodegenSetCodegenOnly added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCodegenOnly(codegen_only LtoBoolT)

Perform CodeGen only: disable all other stages.

\since LTO_API_VERSION=19

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCodegenOnly C.thinlto_codegen_set_codegen_only

func (ThinltoCodeGenT) ThinltoCodegenSetCpu added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetCpu(cpu *c.Char)

Sets the cpu to generate code for.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetCpu C.thinlto_codegen_set_cpu

func (ThinltoCodeGenT) ThinltoCodegenSetFinalCacheSizeRelativeToAvailableSpace added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetFinalCacheSizeRelativeToAvailableSpace(percentage c.Uint)

Sets the maximum cache size that can be persistent across build, in terms of percentage of the available space on the disk. Set to 100 to indicate no limit, 50 to indicate that the cache size will not be left over half the available space. A value over 100 will be reduced to 100, a value of 0 will be ignored. An unspecified default value will be applied.

The formula looks like:

AvailableSpace = FreeSpace + ExistingCacheSize
NewCacheSize = AvailableSpace * P/100

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetFinalCacheSizeRelativeToAvailableSpace C.thinlto_codegen_set_final_cache_size_relative_to_available_space

func (ThinltoCodeGenT) ThinltoCodegenSetPicModel added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetPicModel(_llcppg_param2 LtoCodegenModel) LtoBoolT

Sets which PIC code model to generate. Returns true on error (check lto_get_error_message() for details).

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetPicModel C.thinlto_codegen_set_pic_model

func (ThinltoCodeGenT) ThinltoCodegenSetSavetempsDir added in v0.3.0

func (self ThinltoCodeGenT) ThinltoCodegenSetSavetempsDir(save_temps_dir *c.Char)

Sets the path to a directory to use as a storage for temporary bitcode files. The intention is to make the bitcode files available for debugging at various stage of the pipeline.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoCodegenSetSavetempsDir C.thinlto_codegen_set_savetemps_dir

func (ThinltoCodeGenT) ThinltoModuleGetNumObjectFiles added in v0.3.0

func (self ThinltoCodeGenT) ThinltoModuleGetNumObjectFiles() c.Uint

Returns the number of object files produced by the ThinLTO CodeGenerator.

It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.

\since LTO_API_VERSION=21

llgo:link ThinltoCodeGenT.ThinltoModuleGetNumObjectFiles C.thinlto_module_get_num_object_files

func (ThinltoCodeGenT) ThinltoModuleGetNumObjects added in v0.3.0

func (self ThinltoCodeGenT) ThinltoModuleGetNumObjects() c.Uint

Returns the number of object files produced by the ThinLTO CodeGenerator.

It usually matches the number of input files, but this is not a guarantee of the API and may change in future implementation, so the client should not assume it.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoModuleGetNumObjects C.thinlto_module_get_num_objects

func (ThinltoCodeGenT) ThinltoModuleGetObject added in v0.3.0

func (self ThinltoCodeGenT) ThinltoModuleGetObject(index c.Uint) LTOObjectBuffer

Returns a reference to the ith object file produced by the ThinLTO CodeGenerator.

Client should use \p thinlto_module_get_num_objects() to get the number of available objects.

\since LTO_API_VERSION=18

llgo:link ThinltoCodeGenT.ThinltoModuleGetObject C.thinlto_module_get_object

func (ThinltoCodeGenT) ThinltoModuleGetObjectFile added in v0.3.0

func (self ThinltoCodeGenT) ThinltoModuleGetObjectFile(index c.Uint) *c.Char

Returns the path to the ith object file produced by the ThinLTO CodeGenerator.

Client should use \p thinlto_module_get_num_object_files() to get the number of available objects.

\since LTO_API_VERSION=21

llgo:link ThinltoCodeGenT.ThinltoModuleGetObjectFile C.thinlto_module_get_object_file

func (ThinltoCodeGenT) ThinltoSetGeneratedObjectsDir added in v0.3.0

func (self ThinltoCodeGenT) ThinltoSetGeneratedObjectsDir(save_temps_dir *c.Char)

Set the path to a directory where to save generated object files. This path can be used by a linker to request on-disk files instead of in-memory buffers. When set, results are available through thinlto_module_get_object_file() instead of thinlto_module_get_object().

\since LTO_API_VERSION=21

llgo:link ThinltoCodeGenT.ThinltoSetGeneratedObjectsDir C.thinlto_set_generated_objects_dir

type ThreadLocalMode

type ThreadLocalMode c.Uint
const (
	NotThreadLocal         ThreadLocalMode = 0
	GeneralDynamicTLSModel ThreadLocalMode = 1
	LocalDynamicTLSModel   ThreadLocalMode = 2
	InitialExecTLSModel    ThreadLocalMode = 3
	LocalExecTLSModel      ThreadLocalMode = 4
)

type TypeKind

type TypeKind c.Uint
const (
	VoidTypeKind      TypeKind = 0
	HalfTypeKind      TypeKind = 1
	FloatTypeKind     TypeKind = 2
	DoubleTypeKind    TypeKind = 3
	X86_FP80TypeKind  TypeKind = 4
	FP128TypeKind     TypeKind = 5
	PPC_FP128TypeKind TypeKind = 6
	LabelTypeKind     TypeKind = 7
	IntegerTypeKind   TypeKind = 8
	FunctionTypeKind  TypeKind = 9
	StructTypeKind    TypeKind = 10
	ArrayTypeKind     TypeKind = 11
	PointerTypeKind   TypeKind = 12
	VectorTypeKind    TypeKind = 13
	MetadataTypeKind  TypeKind = 14
	// 15 previously used by LLVMX86_MMXTypeKind
	TokenTypeKind          TypeKind = 16
	ScalableVectorTypeKind TypeKind = 17
	BFloatTypeKind         TypeKind = 18
	X86_AMXTypeKind        TypeKind = 19
	TargetExtTypeKind      TypeKind = 20
)

type TypeRef

type TypeRef = *OpaqueType

Each value in the LLVM IR has a type, an LLVMTypeRef.

@see llvm::Type

func BFloatType

func BFloatType() TypeRef

func DoubleType

func DoubleType() TypeRef

func FP128Type

func FP128Type() TypeRef

func FloatType

func FloatType() TypeRef

func HalfType

func HalfType() TypeRef

Obtain a floating point type from the global context.

These map to the functions in this group of the same name.

func Int1Type

func Int1Type() TypeRef

Obtain an integer type from the global context with a specified bit width.

func Int8Type

func Int8Type() TypeRef

func Int16Type

func Int16Type() TypeRef

func Int32Type

func Int32Type() TypeRef

func Int64Type

func Int64Type() TypeRef

func Int128Type

func Int128Type() TypeRef

func IntType

func IntType(NumBits c.Uint) TypeRef

func LabelType

func LabelType() TypeRef

func PPCFP128Type

func PPCFP128Type() TypeRef

func StructType added in v0.3.0

func StructType(ElementTypes *TypeRef, ElementCount c.Uint, Packed Bool) TypeRef

Create a new structure type in the global context.

@see llvm::StructType::create()

func VoidType

func VoidType() TypeRef

These are similar to the above functions except they operate on the global context.

func X86AMXType

func X86AMXType() TypeRef

func X86FP80Type

func X86FP80Type() TypeRef

func (TypeRef) AlignOf added in v0.3.0

func (self TypeRef) AlignOf() ValueRef

llgo:link TypeRef.AlignOf C.LLVMAlignOf

func (TypeRef) Array added in v0.3.1

func (self TypeRef) Array(ElementCount c.Uint) TypeRef

Create a fixed size array type that refers to a specific type.

The created type will exist in the context that its element type exists in.

@deprecated LLVMArrayType is deprecated in favor of the API accurate LLVMArrayType2 @see llvm::ArrayType::get()

llgo:link TypeRef.Array C.LLVMArrayType

func (TypeRef) ArrayLength added in v0.3.0

func (self TypeRef) ArrayLength() c.Uint

Obtain the length of an array type.

This only works on types that represent arrays.

@deprecated LLVMGetArrayLength is deprecated in favor of the API accurate LLVMGetArrayLength2 @see llvm::ArrayType::getNumElements()

llgo:link TypeRef.ArrayLength C.LLVMGetArrayLength

func (TypeRef) ArrayLength2 added in v0.3.0

func (self TypeRef) ArrayLength2() c.Uint64T

Obtain the length of an array type.

This only works on types that represent arrays.

@see llvm::ArrayType::getNumElements()

llgo:link TypeRef.ArrayLength2 C.LLVMGetArrayLength2

func (TypeRef) ArrayType2 added in v0.3.0

func (self TypeRef) ArrayType2(ElementCount c.Uint64T) TypeRef

Create a fixed size array type that refers to a specific type.

The created type will exist in the context that its element type exists in.

@see llvm::ArrayType::get()

llgo:link TypeRef.ArrayType2 C.LLVMArrayType2

func (TypeRef) ConstAllOnes added in v0.3.0

func (self TypeRef) ConstAllOnes() ValueRef

Obtain a constant value referring to the instance of a type consisting of all ones.

This is only valid for integer types.

@see llvm::Constant::getAllOnesValue()

llgo:link TypeRef.ConstAllOnes C.LLVMConstAllOnes

func (TypeRef) ConstArray added in v0.3.0

func (self TypeRef) ConstArray(ConstantVals *ValueRef, Length c.Uint) ValueRef

Create a ConstantArray from values.

@deprecated LLVMConstArray is deprecated in favor of the API accurate LLVMConstArray2 @see llvm::ConstantArray::get()

llgo:link TypeRef.ConstArray C.LLVMConstArray

func (TypeRef) ConstArray2 added in v0.3.0

func (self TypeRef) ConstArray2(ConstantVals *ValueRef, Length c.Uint64T) ValueRef

Create a ConstantArray from values.

@see llvm::ConstantArray::get()

llgo:link TypeRef.ConstArray2 C.LLVMConstArray2

func (TypeRef) ConstDataArray added in v0.3.0

func (self TypeRef) ConstDataArray(Data *c.Char, SizeInBytes c.SizeT) ValueRef

Create a ConstantDataArray from raw values.

ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double. Data points to a contiguous buffer of raw values in the host endianness. The element count is inferred from the element type and the data size in bytes.

@see llvm::ConstantDataArray::getRaw()

llgo:link TypeRef.ConstDataArray C.LLVMConstDataArray

func (TypeRef) ConstFPFromBits added in v0.3.0

func (self TypeRef) ConstFPFromBits(N *c.Uint64T) ValueRef

llgo:link TypeRef.ConstFPFromBits C.LLVMConstFPFromBits

func (TypeRef) ConstGEP2 added in v0.3.0

func (self TypeRef) ConstGEP2(ConstantVal ValueRef, ConstantIndices *ValueRef, NumIndices c.Uint) ValueRef

llgo:link TypeRef.ConstGEP2 C.LLVMConstGEP2

func (TypeRef) ConstGEPWithNoWrapFlags added in v0.3.0

func (self TypeRef) ConstGEPWithNoWrapFlags(ConstantVal ValueRef, ConstantIndices *ValueRef, NumIndices c.Uint, NoWrapFlags GEPNoWrapFlags) ValueRef

Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but allows specifying the no-wrap flags.

@see llvm::ConstantExpr::getGetElementPtr()

llgo:link TypeRef.ConstGEPWithNoWrapFlags C.LLVMConstGEPWithNoWrapFlags

func (TypeRef) ConstInBoundsGEP2 added in v0.3.0

func (self TypeRef) ConstInBoundsGEP2(ConstantVal ValueRef, ConstantIndices *ValueRef, NumIndices c.Uint) ValueRef

Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but allows specifying the no-wrap flags.

@see llvm::ConstantExpr::getGetElementPtr()

llgo:link TypeRef.ConstInBoundsGEP2 C.LLVMConstInBoundsGEP2

func (TypeRef) ConstInlineAsm deprecated added in v0.3.0

func (self TypeRef) ConstInlineAsm(AsmString *c.Char, Constraints *c.Char, HasSideEffects Bool, IsAlignStack Bool) ValueRef

Deprecated: Use LLVMGetInlineAsm instead.

llgo:link TypeRef.ConstInlineAsm C.LLVMConstInlineAsm

func (TypeRef) ConstInt added in v0.3.0

func (self TypeRef) ConstInt(N c.UlongLong, SignExtend Bool) ValueRef

Obtain a constant value for an integer type.

The returned value corresponds to a llvm::ConstantInt.

@see llvm::ConstantInt::get()

@param IntTy Integer type to obtain value of. @param N The value the returned instance should refer to. @param SignExtend Whether to sign extend the produced value.

llgo:link TypeRef.ConstInt C.LLVMConstInt

func (TypeRef) ConstIntOfArbitraryPrecision added in v0.3.0

func (self TypeRef) ConstIntOfArbitraryPrecision(NumWords c.Uint, Words *c.Uint64T) ValueRef

Obtain a constant value for an integer of arbitrary precision.

@see llvm::ConstantInt::get()

llgo:link TypeRef.ConstIntOfArbitraryPrecision C.LLVMConstIntOfArbitraryPrecision

func (TypeRef) ConstIntOfString added in v0.3.0

func (self TypeRef) ConstIntOfString(Text *c.Char, Radix c.Uint8T) ValueRef

Obtain a constant value for an integer parsed from a string.

A similar API, LLVMConstIntOfStringAndSize is also available. If the string's length is available, it is preferred to call that function instead.

@see llvm::ConstantInt::get()

llgo:link TypeRef.ConstIntOfString C.LLVMConstIntOfString

func (TypeRef) ConstIntOfStringAndSize added in v0.3.0

func (self TypeRef) ConstIntOfStringAndSize(Text *c.Char, SLen c.Uint, Radix c.Uint8T) ValueRef

Obtain a constant value for an integer parsed from a string with specified length.

@see llvm::ConstantInt::get()

llgo:link TypeRef.ConstIntOfStringAndSize C.LLVMConstIntOfStringAndSize

func (TypeRef) ConstNamedStruct added in v0.3.0

func (self TypeRef) ConstNamedStruct(ConstantVals *ValueRef, Count c.Uint) ValueRef

Create a non-anonymous ConstantStruct from values.

@see llvm::ConstantStruct::get()

llgo:link TypeRef.ConstNamedStruct C.LLVMConstNamedStruct

func (TypeRef) ConstNull added in v0.3.0

func (self TypeRef) ConstNull() ValueRef

Obtain a constant value referring to the null instance of a type.

@see llvm::Constant::getNullValue()

llgo:link TypeRef.ConstNull C.LLVMConstNull

func (TypeRef) ConstPointerNull added in v0.3.0

func (self TypeRef) ConstPointerNull() ValueRef

Obtain a constant that is a constant pointer pointing to NULL for a specified type.

llgo:link TypeRef.ConstPointerNull C.LLVMConstPointerNull

func (TypeRef) ConstReal added in v0.3.0

func (self TypeRef) ConstReal(N c.Double) ValueRef

Obtain a constant value referring to a double floating point value.

llgo:link TypeRef.ConstReal C.LLVMConstReal

func (TypeRef) ConstRealOfString added in v0.3.0

func (self TypeRef) ConstRealOfString(Text *c.Char) ValueRef

Obtain a constant for a floating point value parsed from a string.

A similar API, LLVMConstRealOfStringAndSize is also available. It should be used if the input string's length is known.

llgo:link TypeRef.ConstRealOfString C.LLVMConstRealOfString

func (TypeRef) ConstRealOfStringAndSize added in v0.3.0

func (self TypeRef) ConstRealOfStringAndSize(Text *c.Char, SLen c.Uint) ValueRef

Obtain a constant for a floating point value parsed from a string.

llgo:link TypeRef.ConstRealOfStringAndSize C.LLVMConstRealOfStringAndSize

func (TypeRef) Context added in v0.3.1

func (self TypeRef) Context() ContextRef

Obtain the context to which this type instance is associated.

@see llvm::Type::getContext()

llgo:link TypeRef.Context C.LLVMGetTypeContext

func (TypeRef) CountParamTypes added in v0.3.0

func (self TypeRef) CountParamTypes() c.Uint

Obtain the number of parameters this function accepts.

llgo:link TypeRef.CountParamTypes C.LLVMCountParamTypes

func (TypeRef) CountStructElementTypes added in v0.3.0

func (self TypeRef) CountStructElementTypes() c.Uint

Get the number of elements defined inside the structure.

@see llvm::StructType::getNumElements()

llgo:link TypeRef.CountStructElementTypes C.LLVMCountStructElementTypes

func (TypeRef) CreateGenericValueOfFloat added in v0.3.0

func (self TypeRef) CreateGenericValueOfFloat(N c.Double) GenericValueRef

llgo:link TypeRef.CreateGenericValueOfFloat C.LLVMCreateGenericValueOfFloat

func (TypeRef) CreateGenericValueOfInt added in v0.3.0

func (self TypeRef) CreateGenericValueOfInt(N c.UlongLong, IsSigned Bool) GenericValueRef

llgo:link TypeRef.CreateGenericValueOfInt C.LLVMCreateGenericValueOfInt

func (TypeRef) Dump added in v0.3.1

func (self TypeRef) Dump()

Dump a representation of a type to stderr.

@see llvm::Type::dump()

llgo:link TypeRef.Dump C.LLVMDumpType

func (TypeRef) Element added in v0.3.1

func (self TypeRef) Element() TypeRef

Obtain the element type of an array or vector type.

@see llvm::SequentialType::getElementType()

llgo:link TypeRef.Element C.LLVMGetElementType

func (TypeRef) Function added in v0.3.1

func (self TypeRef) Function(ParamTypes *TypeRef, ParamCount c.Uint, IsVarArg Bool) TypeRef

Obtain a function type consisting of a specified signature.

The function is defined as a tuple of a return Type, a list of parameter types, and whether the function is variadic.

llgo:link TypeRef.Function C.LLVMFunctionType

func (TypeRef) GenericValueToFloat added in v0.3.0

func (self TypeRef) GenericValueToFloat(GenVal GenericValueRef) c.Double

llgo:link TypeRef.GenericValueToFloat C.LLVMGenericValueToFloat

func (TypeRef) InlineAsm added in v0.3.0

func (self TypeRef) InlineAsm(AsmString *c.Char, AsmStringSize c.SizeT, Constraints *c.Char, ConstraintsSize c.SizeT, HasSideEffects Bool, IsAlignStack Bool, Dialect InlineAsmDialect, CanThrow Bool) ValueRef

Create the specified uniqued inline asm string.

@see InlineAsm::get()

llgo:link TypeRef.InlineAsm C.LLVMGetInlineAsm

func (TypeRef) IntTypeWidth added in v0.3.0

func (self TypeRef) IntTypeWidth() c.Uint

llgo:link TypeRef.IntTypeWidth C.LLVMGetIntTypeWidth

func (TypeRef) IsFunctionVarArg added in v0.3.0

func (self TypeRef) IsFunctionVarArg() Bool

Returns whether a function type is variadic.

llgo:link TypeRef.IsFunctionVarArg C.LLVMIsFunctionVarArg

func (TypeRef) IsLiteralStruct added in v0.3.0

func (self TypeRef) IsLiteralStruct() Bool

Determine whether a structure is literal.

@see llvm::StructType::isLiteral()

llgo:link TypeRef.IsLiteralStruct C.LLVMIsLiteralStruct

func (TypeRef) IsOpaqueStruct added in v0.3.0

func (self TypeRef) IsOpaqueStruct() Bool

Determine whether a structure is opaque.

@see llvm::StructType::isOpaque()

llgo:link TypeRef.IsOpaqueStruct C.LLVMIsOpaqueStruct

func (TypeRef) IsPackedStruct added in v0.3.0

func (self TypeRef) IsPackedStruct() Bool

Determine whether a structure is packed.

@see llvm::StructType::isPacked()

llgo:link TypeRef.IsPackedStruct C.LLVMIsPackedStruct

func (TypeRef) IsSized added in v0.3.1

func (self TypeRef) IsSized() Bool

Whether the type has a known size.

Things that don't have a size are abstract types, labels, and void.a

@see llvm::Type::isSized()

llgo:link TypeRef.IsSized C.LLVMTypeIsSized

func (TypeRef) Kind added in v0.3.1

func (self TypeRef) Kind() TypeKind

Obtain the enumerated type of a Type instance.

@see llvm::Type:getTypeID()

llgo:link TypeRef.Kind C.LLVMGetTypeKind

func (TypeRef) NumContainedTypes added in v0.3.0

func (self TypeRef) NumContainedTypes() c.Uint
Return the number of types in the derived type.

@see llvm::Type::getNumContainedTypes()

llgo:link TypeRef.NumContainedTypes C.LLVMGetNumContainedTypes

func (TypeRef) ParamTypes added in v0.3.0

func (self TypeRef) ParamTypes(Dest *TypeRef)

Obtain the types of a function's parameters.

The Dest parameter should point to a pre-allocated array of LLVMTypeRef at least LLVMCountParamTypes() large. On return, the first LLVMCountParamTypes() entries in the array will be populated with LLVMTypeRef instances.

@param FunctionTy The function type to operate on. @param Dest Memory address of an array to be filled with result.

llgo:link TypeRef.ParamTypes C.LLVMGetParamTypes

func (TypeRef) Pointer added in v0.3.1

func (self TypeRef) Pointer(AddressSpace c.Uint) TypeRef

Create a pointer type that points to a defined type.

The created type will exist in the context that its pointee type exists in.

@see llvm::PointerType::get()

llgo:link TypeRef.Pointer C.LLVMPointerType

func (TypeRef) PointerAddressSpace added in v0.3.0

func (self TypeRef) PointerAddressSpace() c.Uint

Obtain the address space of a pointer type.

This only works on types that represent pointers.

@see llvm::PointerType::getAddressSpace()

llgo:link TypeRef.PointerAddressSpace C.LLVMGetPointerAddressSpace

func (TypeRef) PointerTypeIsOpaque added in v0.3.0

func (self TypeRef) PointerTypeIsOpaque() Bool

Determine whether a pointer is opaque.

True if this is an instance of an opaque PointerType.

@see llvm::Type::isOpaquePointerTy()

llgo:link TypeRef.PointerTypeIsOpaque C.LLVMPointerTypeIsOpaque

func (TypeRef) Poison added in v0.3.0

func (self TypeRef) Poison() ValueRef

Obtain a constant value referring to a poison value of a type.

@see llvm::PoisonValue::get()

llgo:link TypeRef.Poison C.LLVMGetPoison

func (TypeRef) PrintTypeToString added in v0.3.0

func (self TypeRef) PrintTypeToString() *c.Char

Return a string representation of the type. Use LLVMDisposeMessage to free the string.

@see llvm::Type::print()

llgo:link TypeRef.PrintTypeToString C.LLVMPrintTypeToString

func (TypeRef) Return added in v0.3.1

func (self TypeRef) Return() TypeRef

Obtain the Type this function Type returns.

llgo:link TypeRef.Return C.LLVMGetReturnType

func (TypeRef) ScalableVector added in v0.3.1

func (self TypeRef) ScalableVector(ElementCount c.Uint) TypeRef

Create a vector type that contains a defined type and has a scalable number of elements.

The created type will exist in the context thats its element type exists in.

@see llvm::ScalableVectorType::get()

llgo:link TypeRef.ScalableVector C.LLVMScalableVectorType

func (TypeRef) SizeOf added in v0.3.0

func (self TypeRef) SizeOf() ValueRef

llgo:link TypeRef.SizeOf C.LLVMSizeOf

func (TypeRef) StructElementTypes added in v0.3.0

func (self TypeRef) StructElementTypes(Dest *TypeRef)

Get the elements within a structure.

The function is passed the address of a pre-allocated array of LLVMTypeRef at least LLVMCountStructElementTypes() long. After invocation, this array will be populated with the structure's elements. The objects in the destination array will have a lifetime of the structure type itself, which is the lifetime of the context it is contained in.

llgo:link TypeRef.StructElementTypes C.LLVMGetStructElementTypes

func (TypeRef) StructGetTypeAtIndex added in v0.3.0

func (self TypeRef) StructGetTypeAtIndex(i c.Uint) TypeRef

Get the type of the element at a given index in the structure.

@see llvm::StructType::getTypeAtIndex()

llgo:link TypeRef.StructGetTypeAtIndex C.LLVMStructGetTypeAtIndex

func (TypeRef) StructName added in v0.3.0

func (self TypeRef) StructName() *c.Char

Obtain the name of a structure.

@see llvm::StructType::getName()

llgo:link TypeRef.StructName C.LLVMGetStructName

func (TypeRef) StructSetBody added in v0.3.0

func (self TypeRef) StructSetBody(ElementTypes *TypeRef, ElementCount c.Uint, Packed Bool)

Set the contents of a structure type.

@see llvm::StructType::setBody()

llgo:link TypeRef.StructSetBody C.LLVMStructSetBody

func (TypeRef) Subtypes added in v0.3.0

func (self TypeRef) Subtypes(Arr *TypeRef)

Returns type's subtypes

@see llvm::Type::subtypes()

llgo:link TypeRef.Subtypes C.LLVMGetSubtypes

func (TypeRef) TargetExtTypeIntParam added in v0.3.0

func (self TypeRef) TargetExtTypeIntParam(Idx c.Uint) c.Uint

Get the int parameter at the given index for the target extension type.

@see llvm::TargetExtType::getIntParameter()

llgo:link TypeRef.TargetExtTypeIntParam C.LLVMGetTargetExtTypeIntParam

func (TypeRef) TargetExtTypeName added in v0.3.0

func (self TypeRef) TargetExtTypeName() *c.Char

Obtain the name for this target extension type.

@see llvm::TargetExtType::getName()

llgo:link TypeRef.TargetExtTypeName C.LLVMGetTargetExtTypeName

func (TypeRef) TargetExtTypeNumIntParams added in v0.3.0

func (self TypeRef) TargetExtTypeNumIntParams() c.Uint

Obtain the number of int parameters for this target extension type.

@see llvm::TargetExtType::getNumIntParameters()

llgo:link TypeRef.TargetExtTypeNumIntParams C.LLVMGetTargetExtTypeNumIntParams

func (TypeRef) TargetExtTypeNumTypeParams added in v0.3.0

func (self TypeRef) TargetExtTypeNumTypeParams() c.Uint

Obtain the number of type parameters for this target extension type.

@see llvm::TargetExtType::getNumTypeParameters()

llgo:link TypeRef.TargetExtTypeNumTypeParams C.LLVMGetTargetExtTypeNumTypeParams

func (TypeRef) TargetExtTypeTypeParam added in v0.3.0

func (self TypeRef) TargetExtTypeTypeParam(Idx c.Uint) TypeRef

Get the type parameter at the given index for the target extension type.

@see llvm::TargetExtType::getTypeParameter()

llgo:link TypeRef.TargetExtTypeTypeParam C.LLVMGetTargetExtTypeTypeParam

func (TypeRef) Undef added in v0.3.0

func (self TypeRef) Undef() ValueRef

Obtain a constant value referring to an undefined value of a type.

@see llvm::UndefValue::get()

llgo:link TypeRef.Undef C.LLVMGetUndef

func (TypeRef) Vector added in v0.3.1

func (self TypeRef) Vector(ElementCount c.Uint) TypeRef

Create a vector type that contains a defined type and has a specific number of elements.

The created type will exist in the context thats its element type exists in.

@see llvm::VectorType::get()

llgo:link TypeRef.Vector C.LLVMVectorType

func (TypeRef) VectorSize added in v0.3.0

func (self TypeRef) VectorSize() c.Uint

Obtain the (possibly scalable) number of elements in a vector type.

This only works on types that represent vectors (fixed or scalable).

@see llvm::VectorType::getNumElements()

llgo:link TypeRef.VectorSize C.LLVMGetVectorSize

type UnnamedAddr

type UnnamedAddr c.Uint
const (
	NoUnnamedAddr    UnnamedAddr = 0
	LocalUnnamedAddr UnnamedAddr = 1
	// < Address of the GV is globally insignificant.
	GlobalUnnamedAddr UnnamedAddr = 2
)

type UseRef

type UseRef = *OpaqueUse

Used to get the users and usees of a Value.

@see llvm::Use

func (UseRef) Next added in v0.3.1

func (self UseRef) Next() UseRef

Obtain the next use of a value.

This effectively advances the iterator. It returns NULL if you are on the final use and no more are available.

llgo:link UseRef.Next C.LLVMGetNextUse

func (UseRef) UsedValue added in v0.3.0

func (self UseRef) UsedValue() ValueRef

Obtain the value this use corresponds to.

@see llvm::Use::get().

llgo:link UseRef.UsedValue C.LLVMGetUsedValue

func (UseRef) User added in v0.3.0

func (self UseRef) User() ValueRef

Obtain the user value for a user.

The returned value corresponds to a llvm::User type.

@see llvm::Use::getUser()

llgo:link UseRef.User C.LLVMGetUser

type ValueKind

type ValueKind c.Uint
const (
	ArgumentValueKind              ValueKind = 0
	BasicBlockValueKind            ValueKind = 1
	MemoryUseValueKind             ValueKind = 2
	MemoryDefValueKind             ValueKind = 3
	MemoryPhiValueKind             ValueKind = 4
	FunctionValueKind              ValueKind = 5
	GlobalAliasValueKind           ValueKind = 6
	GlobalIFuncValueKind           ValueKind = 7
	GlobalVariableValueKind        ValueKind = 8
	BlockAddressValueKind          ValueKind = 9
	ConstantExprValueKind          ValueKind = 10
	ConstantArrayValueKind         ValueKind = 11
	ConstantStructValueKind        ValueKind = 12
	ConstantVectorValueKind        ValueKind = 13
	UndefValueValueKind            ValueKind = 14
	ConstantAggregateZeroValueKind ValueKind = 15
	ConstantDataArrayValueKind     ValueKind = 16
	ConstantDataVectorValueKind    ValueKind = 17
	ConstantIntValueKind           ValueKind = 18
	ConstantFPValueKind            ValueKind = 19
	ConstantPointerNullValueKind   ValueKind = 20
	ConstantTokenNoneValueKind     ValueKind = 21
	MetadataAsValueValueKind       ValueKind = 22
	InlineAsmValueKind             ValueKind = 23
	InstructionValueKind           ValueKind = 24
	PoisonValueValueKind           ValueKind = 25
	ConstantTargetNoneValueKind    ValueKind = 26
	ConstantPtrAuthValueKind       ValueKind = 27
)

type ValueMetadataEntry

type ValueMetadataEntry = OpaqueValueMetadataEntry

Represents an entry in a Global Object's metadata attachments.

This models std::pair<unsigned, MDNode *>

func (*ValueMetadataEntry) DisposeValueMetadataEntries added in v0.3.0

func (self *ValueMetadataEntry) DisposeValueMetadataEntries()

Destroys value metadata entries.

llgo:link (*ValueMetadataEntry).DisposeValueMetadataEntries C.LLVMDisposeValueMetadataEntries

func (*ValueMetadataEntry) ValueMetadataEntriesGetKind added in v0.3.0

func (self *ValueMetadataEntry) ValueMetadataEntriesGetKind(Index c.Uint) c.Uint

Returns the kind of a value metadata entry at a specific index.

llgo:link (*ValueMetadataEntry).ValueMetadataEntriesGetKind C.LLVMValueMetadataEntriesGetKind

func (*ValueMetadataEntry) ValueMetadataEntriesGetMetadata added in v0.3.0

func (self *ValueMetadataEntry) ValueMetadataEntriesGetMetadata(Index c.Uint) MetadataRef

Returns the underlying metadata node of a value metadata entry at a specific index.

llgo:link (*ValueMetadataEntry).ValueMetadataEntriesGetMetadata C.LLVMValueMetadataEntriesGetMetadata

type ValueRef

type ValueRef = *OpaqueValue

Represents an individual value in LLVM IR.

This models llvm::Value.

func ConstAdd

func ConstAdd(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstExtractElement

func ConstExtractElement(VectorConstant ValueRef, IndexConstant ValueRef) ValueRef

func ConstNSWAdd

func ConstNSWAdd(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstNSWSub

func ConstNSWSub(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstNUWAdd

func ConstNUWAdd(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstNUWSub

func ConstNUWSub(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstString

func ConstString(Str *c.Char, Length c.Uint, DontNullTerminate Bool) ValueRef

Create a ConstantDataSequential with string content in the global context.

This is the same as LLVMConstStringInContext except it operates on the global context.

@see LLVMConstStringInContext() @see llvm::ConstantDataArray::getString()

func ConstStruct added in v0.3.0

func ConstStruct(ConstantVals *ValueRef, Count c.Uint, Packed Bool) ValueRef

Create a ConstantStruct in the global Context.

This is the same as LLVMConstStructInContext except it operates on the global Context.

@see LLVMConstStructInContext()

func ConstSub

func ConstSub(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func ConstVector added in v0.3.0

func ConstVector(ScalarConstantVals *ValueRef, Size c.Uint) ValueRef

Create a ConstantVector from values.

@see llvm::ConstantVector::get()

func ConstXor

func ConstXor(LHSConstant ValueRef, RHSConstant ValueRef) ValueRef

func MDNode deprecated added in v0.3.0

func MDNode(Vals *ValueRef, Count c.Uint) ValueRef

Deprecated: Use LLVMMDNodeInContext2 instead.

func MDString deprecated

func MDString(Str *c.Char, SLen c.Uint) ValueRef

Deprecated: Use LLVMMDStringInContext2 instead.

func (ValueRef) AddAttributeAtIndex added in v0.3.0

func (self ValueRef) AddAttributeAtIndex(Idx AttributeIndex, A AttributeRef)

Add an attribute to a function.

@see llvm::Function::addAttribute()

llgo:link ValueRef.AddAttributeAtIndex C.LLVMAddAttributeAtIndex

func (ValueRef) AddCallSiteAttribute added in v0.3.0

func (self ValueRef) AddCallSiteAttribute(Idx AttributeIndex, A AttributeRef)

llgo:link ValueRef.AddCallSiteAttribute C.LLVMAddCallSiteAttribute

func (ValueRef) AddCase added in v0.3.0

func (self ValueRef) AddCase(OnVal ValueRef, Dest BasicBlockRef)

Add a case to the switch instruction

llgo:link ValueRef.AddCase C.LLVMAddCase

func (ValueRef) AddDestination added in v0.3.0

func (self ValueRef) AddDestination(Dest BasicBlockRef)

Add a destination to the indirectbr instruction

llgo:link ValueRef.AddDestination C.LLVMAddDestination

func (ValueRef) AddHandler added in v0.3.0

func (self ValueRef) AddHandler(Dest BasicBlockRef)

Add a destination to the catchswitch instruction

llgo:link ValueRef.AddHandler C.LLVMAddHandler

func (ValueRef) AddIncoming added in v0.3.0

func (self ValueRef) AddIncoming(IncomingValues *ValueRef, IncomingBlocks *BasicBlockRef, Count c.Uint)

Add an incoming value to the end of a PHI list.

llgo:link ValueRef.AddIncoming C.LLVMAddIncoming

func (ValueRef) AddTargetDependentFunctionAttr added in v0.3.0

func (self ValueRef) AddTargetDependentFunctionAttr(A *c.Char, V *c.Char)

Add a target-dependent attribute to a function @see llvm::AttrBuilder::addAttribute()

llgo:link ValueRef.AddTargetDependentFunctionAttr C.LLVMAddTargetDependentFunctionAttr

func (ValueRef) AggregateElement added in v0.3.0

func (self ValueRef) AggregateElement(Idx c.Uint) ValueRef

Get element of a constant aggregate (struct, array or vector) at the specified index. Returns null if the index is out of range, or it's not possible to determine the element (e.g., because the constant is a constant expression.)

@see llvm::Constant::getAggregateElement()

llgo:link ValueRef.AggregateElement C.LLVMGetAggregateElement

func (ValueRef) AliasGetAliasee added in v0.3.0

func (self ValueRef) AliasGetAliasee() ValueRef

Retrieve the target value of an alias.

llgo:link ValueRef.AliasGetAliasee C.LLVMAliasGetAliasee

func (ValueRef) Alignment added in v0.3.0

func (self ValueRef) Alignment() c.Uint

Obtain the preferred alignment of the value. @see llvm::AllocaInst::getAlignment() @see llvm::LoadInst::getAlignment() @see llvm::StoreInst::getAlignment() @see llvm::AtomicRMWInst::setAlignment() @see llvm::AtomicCmpXchgInst::setAlignment() @see llvm::GlobalValue::getAlignment()

llgo:link ValueRef.Alignment C.LLVMGetAlignment

func (ValueRef) AllocatedType added in v0.3.0

func (self ValueRef) AllocatedType() TypeRef

Obtain the type that is being allocated by the alloca instruction.

llgo:link ValueRef.AllocatedType C.LLVMGetAllocatedType

func (ValueRef) AppendBasicBlock added in v0.3.0

func (self ValueRef) AppendBasicBlock(Name *c.Char) BasicBlockRef

Append a basic block to the end of a function using the global context.

@see llvm::BasicBlock::Create()

llgo:link ValueRef.AppendBasicBlock C.LLVMAppendBasicBlock

func (ValueRef) AppendExistingBasicBlock added in v0.3.0

func (self ValueRef) AppendExistingBasicBlock(BB BasicBlockRef)

Append the given basic block to the basic block list of the given function.

@see llvm::Function::BasicBlockListType::push_back()

llgo:link ValueRef.AppendExistingBasicBlock C.LLVMAppendExistingBasicBlock

func (ValueRef) ArgOperand added in v0.3.0

func (self ValueRef) ArgOperand(i c.Uint) ValueRef

Get the number of funcletpad arguments.

llgo:link ValueRef.ArgOperand C.LLVMGetArgOperand

func (ValueRef) AsBasicBlock added in v0.3.1

func (self ValueRef) AsBasicBlock() BasicBlockRef

Convert an LLVMValueRef to an LLVMBasicBlockRef instance.

llgo:link ValueRef.AsBasicBlock C.LLVMValueAsBasicBlock

func (ValueRef) AsMetadata added in v0.3.1

func (self ValueRef) AsMetadata() MetadataRef

Obtain a Value as a Metadata.

llgo:link ValueRef.AsMetadata C.LLVMValueAsMetadata

func (ValueRef) AsString added in v0.3.0

func (self ValueRef) AsString(Length *c.SizeT) *c.Char

Get the given constant data sequential as a string.

@see ConstantDataSequential::getAsString()

llgo:link ValueRef.AsString C.LLVMGetAsString

func (ValueRef) AtomicRMWBinOp added in v0.3.0

func (self ValueRef) AtomicRMWBinOp() AtomicRMWBinOp

llgo:link ValueRef.AtomicRMWBinOp C.LLVMGetAtomicRMWBinOp

func (ValueRef) AtomicSyncScopeID added in v0.3.0

func (self ValueRef) AtomicSyncScopeID() c.Uint

Returns the synchronization scope ID of an atomic instruction.

llgo:link ValueRef.AtomicSyncScopeID C.LLVMGetAtomicSyncScopeID

func (ValueRef) AttributeCountAtIndex added in v0.3.0

func (self ValueRef) AttributeCountAtIndex(Idx AttributeIndex) c.Uint

llgo:link ValueRef.AttributeCountAtIndex C.LLVMGetAttributeCountAtIndex

func (ValueRef) AttributesAtIndex added in v0.3.0

func (self ValueRef) AttributesAtIndex(Idx AttributeIndex, Attrs *AttributeRef)

llgo:link ValueRef.AttributesAtIndex C.LLVMGetAttributesAtIndex

func (ValueRef) BasicBlocks added in v0.3.0

func (self ValueRef) BasicBlocks(BasicBlocks *BasicBlockRef)

Obtain all of the basic blocks in a function.

This operates on a function value. The BasicBlocks parameter is a pointer to a pre-allocated array of LLVMBasicBlockRef of at least LLVMCountBasicBlocks() in length. This array is populated with LLVMBasicBlockRef instances.

llgo:link ValueRef.BasicBlocks C.LLVMGetBasicBlocks

func (ValueRef) BlockAddress added in v0.3.0

func (self ValueRef) BlockAddress(BB BasicBlockRef) ValueRef

llgo:link ValueRef.BlockAddress C.LLVMBlockAddress

func (ValueRef) BlockAddressBasicBlock added in v0.3.0

func (self ValueRef) BlockAddressBasicBlock() BasicBlockRef

Gets the basic block associated with a given BlockAddress constant value.

llgo:link ValueRef.BlockAddressBasicBlock C.LLVMGetBlockAddressBasicBlock

func (ValueRef) BlockAddressFunction added in v0.3.0

func (self ValueRef) BlockAddressFunction() ValueRef

Gets the function associated with a given BlockAddress constant value.

llgo:link ValueRef.BlockAddressFunction C.LLVMGetBlockAddressFunction

func (ValueRef) CallBrDefaultDest added in v0.3.0

func (self ValueRef) CallBrDefaultDest() BasicBlockRef

Get the default destination of a CallBr instruction.

@see llvm::CallBrInst::getDefaultDest()

llgo:link ValueRef.CallBrDefaultDest C.LLVMGetCallBrDefaultDest

func (ValueRef) CallBrIndirectDest added in v0.3.0

func (self ValueRef) CallBrIndirectDest(Idx c.Uint) BasicBlockRef

Get the indirect destination of a CallBr instruction at the given index.

@see llvm::CallBrInst::getIndirectDest()

llgo:link ValueRef.CallBrIndirectDest C.LLVMGetCallBrIndirectDest

func (ValueRef) CallBrNumIndirectDests added in v0.3.0

func (self ValueRef) CallBrNumIndirectDests() c.Uint

Get the number of indirect destinations of a CallBr instruction.

@see llvm::CallBrInst::getNumIndirectDests()

llgo:link ValueRef.CallBrNumIndirectDests C.LLVMGetCallBrNumIndirectDests

func (ValueRef) CallSiteAttributeCount added in v0.3.0

func (self ValueRef) CallSiteAttributeCount(Idx AttributeIndex) c.Uint

llgo:link ValueRef.CallSiteAttributeCount C.LLVMGetCallSiteAttributeCount

func (ValueRef) CallSiteAttributes added in v0.3.0

func (self ValueRef) CallSiteAttributes(Idx AttributeIndex, Attrs *AttributeRef)

llgo:link ValueRef.CallSiteAttributes C.LLVMGetCallSiteAttributes

func (ValueRef) CallSiteEnumAttribute added in v0.3.0

func (self ValueRef) CallSiteEnumAttribute(Idx AttributeIndex, KindID c.Uint) AttributeRef

llgo:link ValueRef.CallSiteEnumAttribute C.LLVMGetCallSiteEnumAttribute

func (ValueRef) CallSiteStringAttribute added in v0.3.0

func (self ValueRef) CallSiteStringAttribute(Idx AttributeIndex, K *c.Char, KLen c.Uint) AttributeRef

llgo:link ValueRef.CallSiteStringAttribute C.LLVMGetCallSiteStringAttribute

func (ValueRef) Called added in v0.3.1

func (self ValueRef) Called() ValueRef

Obtain the pointer to the function invoked by this instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst or llvm::InvokeInst.

@see llvm::CallInst::getCalledOperand() @see llvm::InvokeInst::getCalledOperand()

llgo:link ValueRef.Called C.LLVMGetCalledValue

func (ValueRef) CalledFunctionType added in v0.3.0

func (self ValueRef) CalledFunctionType() TypeRef

Obtain the function type called by this instruction.

@see llvm::CallBase::getFunctionType()

llgo:link ValueRef.CalledFunctionType C.LLVMGetCalledFunctionType

func (ValueRef) CanValueUseFastMathFlags added in v0.3.0

func (self ValueRef) CanValueUseFastMathFlags() Bool

Check if a given value can potentially have fast math flags.

Will return true for floating point arithmetic instructions, and for select, phi, and call instructions whose type is a floating point type, or a vector or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags

llgo:link ValueRef.CanValueUseFastMathFlags C.LLVMCanValueUseFastMathFlags

func (ValueRef) CastOpcode added in v0.3.0

func (self ValueRef) CastOpcode(SrcIsSigned Bool, DestTy TypeRef, DestIsSigned Bool) Opcode

llgo:link ValueRef.CastOpcode C.LLVMGetCastOpcode

func (ValueRef) Clause added in v0.3.0

func (self ValueRef) Clause(Idx c.Uint) ValueRef

Get the value of the clause at index Idx on the landingpad instruction

llgo:link ValueRef.Clause C.LLVMGetClause

func (ValueRef) CmpXchgFailureOrdering added in v0.3.0

func (self ValueRef) CmpXchgFailureOrdering() AtomicOrdering

llgo:link ValueRef.CmpXchgFailureOrdering C.LLVMGetCmpXchgFailureOrdering

func (ValueRef) CmpXchgSuccessOrdering added in v0.3.0

func (self ValueRef) CmpXchgSuccessOrdering() AtomicOrdering

llgo:link ValueRef.CmpXchgSuccessOrdering C.LLVMGetCmpXchgSuccessOrdering

func (ValueRef) Comdat added in v0.3.0

func (self ValueRef) Comdat() ComdatRef

Get the Comdat assigned to the given global object.

@see llvm::GlobalObject::getComdat()

llgo:link ValueRef.Comdat C.LLVMGetComdat

func (ValueRef) Condition added in v0.3.0

func (self ValueRef) Condition() ValueRef

Return the condition of a branch instruction.

This only works on llvm::BranchInst instructions.

@see llvm::BranchInst::getCondition

llgo:link ValueRef.Condition C.LLVMGetCondition

func (ValueRef) ConstAddrSpaceCast added in v0.3.0

func (self ValueRef) ConstAddrSpaceCast(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstAddrSpaceCast C.LLVMConstAddrSpaceCast

func (ValueRef) ConstBitCast added in v0.3.0

func (self ValueRef) ConstBitCast(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstBitCast C.LLVMConstBitCast

func (ValueRef) ConstInsertElement added in v0.3.0

func (self ValueRef) ConstInsertElement(ElementValueConstant ValueRef, IndexConstant ValueRef) ValueRef

llgo:link ValueRef.ConstInsertElement C.LLVMConstInsertElement

func (ValueRef) ConstIntGetSExt added in v0.3.1

func (self ValueRef) ConstIntGetSExt() c.LongLong

Obtain the sign extended value for an integer constant value.

@see llvm::ConstantInt::getSExtValue()

llgo:link ValueRef.ConstIntGetSExt C.LLVMConstIntGetSExtValue

func (ValueRef) ConstIntGetZExt added in v0.3.1

func (self ValueRef) ConstIntGetZExt() c.UlongLong

Obtain the zero extended value for an integer constant value.

@see llvm::ConstantInt::getZExtValue()

llgo:link ValueRef.ConstIntGetZExt C.LLVMConstIntGetZExtValue

func (ValueRef) ConstIntToPtr added in v0.3.0

func (self ValueRef) ConstIntToPtr(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstIntToPtr C.LLVMConstIntToPtr

func (ValueRef) ConstNSWNeg added in v0.3.0

func (self ValueRef) ConstNSWNeg() ValueRef

llgo:link ValueRef.ConstNSWNeg C.LLVMConstNSWNeg

func (ValueRef) ConstNUWNeg added in v0.3.0

func (self ValueRef) ConstNUWNeg() ValueRef

llgo:link ValueRef.ConstNUWNeg C.LLVMConstNUWNeg

func (ValueRef) ConstNeg added in v0.3.0

func (self ValueRef) ConstNeg() ValueRef

llgo:link ValueRef.ConstNeg C.LLVMConstNeg

func (ValueRef) ConstNot added in v0.3.0

func (self ValueRef) ConstNot() ValueRef

llgo:link ValueRef.ConstNot C.LLVMConstNot

func (ValueRef) ConstOpcode added in v0.3.0

func (self ValueRef) ConstOpcode() Opcode

@defgroup LLVMCCoreValueConstantExpressions Constant Expressions

Functions in this group correspond to APIs on llvm::ConstantExpr.

@see llvm::ConstantExpr.

@{

llgo:link ValueRef.ConstOpcode C.LLVMGetConstOpcode

func (ValueRef) ConstPointerCast added in v0.3.0

func (self ValueRef) ConstPointerCast(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstPointerCast C.LLVMConstPointerCast

func (ValueRef) ConstPtrToInt added in v0.3.0

func (self ValueRef) ConstPtrToInt(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstPtrToInt C.LLVMConstPtrToInt

func (ValueRef) ConstRealGetDouble added in v0.3.0

func (self ValueRef) ConstRealGetDouble(losesInfo *Bool) c.Double

Obtain the double value for an floating point constant value. losesInfo indicates if some precision was lost in the conversion.

@see llvm::ConstantFP::getDoubleValue

llgo:link ValueRef.ConstRealGetDouble C.LLVMConstRealGetDouble

func (ValueRef) ConstShuffleVector added in v0.3.0

func (self ValueRef) ConstShuffleVector(VectorBConstant ValueRef, MaskConstant ValueRef) ValueRef

llgo:link ValueRef.ConstShuffleVector C.LLVMConstShuffleVector

func (ValueRef) ConstTrunc added in v0.3.0

func (self ValueRef) ConstTrunc(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstTrunc C.LLVMConstTrunc

func (ValueRef) ConstTruncOrBitCast added in v0.3.0

func (self ValueRef) ConstTruncOrBitCast(ToType TypeRef) ValueRef

llgo:link ValueRef.ConstTruncOrBitCast C.LLVMConstTruncOrBitCast

func (ValueRef) ConstantPtrAuth added in v0.3.0

func (self ValueRef) ConstantPtrAuth(Key ValueRef, Disc ValueRef, AddrDisc ValueRef) ValueRef

Create a ConstantPtrAuth constant with the given values.

@see llvm::ConstantPtrAuth::get()

llgo:link ValueRef.ConstantPtrAuth C.LLVMConstantPtrAuth

func (ValueRef) ConstantPtrAuthAddrDiscriminator added in v0.3.0

func (self ValueRef) ConstantPtrAuthAddrDiscriminator() ValueRef

Get the address discriminator value for the associated ConstantPtrAuth constant.

@see llvm::ConstantPtrAuth::getAddrDiscriminator

llgo:link ValueRef.ConstantPtrAuthAddrDiscriminator C.LLVMGetConstantPtrAuthAddrDiscriminator

func (ValueRef) ConstantPtrAuthDiscriminator added in v0.3.0

func (self ValueRef) ConstantPtrAuthDiscriminator() ValueRef

Get the discriminator value for the associated ConstantPtrAuth constant.

@see llvm::ConstantPtrAuth::getDiscriminator

llgo:link ValueRef.ConstantPtrAuthDiscriminator C.LLVMGetConstantPtrAuthDiscriminator

func (ValueRef) ConstantPtrAuthKey added in v0.3.0

func (self ValueRef) ConstantPtrAuthKey() ValueRef

Get the key value for the associated ConstantPtrAuth constant.

@see llvm::ConstantPtrAuth::getKey

llgo:link ValueRef.ConstantPtrAuthKey C.LLVMGetConstantPtrAuthKey

func (ValueRef) ConstantPtrAuthPointer added in v0.3.0

func (self ValueRef) ConstantPtrAuthPointer() ValueRef

Get the pointer value for the associated ConstantPtrAuth constant.

@see llvm::ConstantPtrAuth::getPointer

llgo:link ValueRef.ConstantPtrAuthPointer C.LLVMGetConstantPtrAuthPointer

func (ValueRef) Context added in v0.3.1

func (self ValueRef) Context() ContextRef

Obtain the context to which this value is associated.

@see llvm::Value::getContext()

llgo:link ValueRef.Context C.LLVMGetValueContext

func (ValueRef) CountBasicBlocks added in v0.3.0

func (self ValueRef) CountBasicBlocks() c.Uint

Obtain the number of basic blocks in a function.

@param Fn Function value to operate on.

llgo:link ValueRef.CountBasicBlocks C.LLVMCountBasicBlocks

func (ValueRef) CountIncoming added in v0.3.0

func (self ValueRef) CountIncoming() c.Uint

Obtain the number of incoming basic blocks to a PHI node.

llgo:link ValueRef.CountIncoming C.LLVMCountIncoming

func (ValueRef) CountParams added in v0.3.0

func (self ValueRef) CountParams() c.Uint

Obtain the number of parameters in a function.

@see llvm::Function::arg_size()

llgo:link ValueRef.CountParams C.LLVMCountParams

func (ValueRef) DLLStorageClass added in v0.3.0

func (self ValueRef) DLLStorageClass() DLLStorageClass

llgo:link ValueRef.DLLStorageClass C.LLVMGetDLLStorageClass

func (ValueRef) DebugLocColumn added in v0.3.0

func (self ValueRef) DebugLocColumn() c.Uint

Return the column number of the debug location for this value, which must be an llvm::Instruction.

@see llvm::Instruction::getDebugLoc()

llgo:link ValueRef.DebugLocColumn C.LLVMGetDebugLocColumn

func (ValueRef) DebugLocDirectory added in v0.3.0

func (self ValueRef) DebugLocDirectory(Length *c.Uint) *c.Char

Return the directory of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

@see llvm::Instruction::getDebugLoc() @see llvm::GlobalVariable::getDebugInfo() @see llvm::Function::getSubprogram()

llgo:link ValueRef.DebugLocDirectory C.LLVMGetDebugLocDirectory

func (ValueRef) DebugLocFilename added in v0.3.0

func (self ValueRef) DebugLocFilename(Length *c.Uint) *c.Char

Return the filename of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

@see llvm::Instruction::getDebugLoc() @see llvm::GlobalVariable::getDebugInfo() @see llvm::Function::getSubprogram()

llgo:link ValueRef.DebugLocFilename C.LLVMGetDebugLocFilename

func (ValueRef) DebugLocLine added in v0.3.0

func (self ValueRef) DebugLocLine() c.Uint

Return the line number of the debug location for this value, which must be an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.

@see llvm::Instruction::getDebugLoc() @see llvm::GlobalVariable::getDebugInfo() @see llvm::Function::getSubprogram()

llgo:link ValueRef.DebugLocLine C.LLVMGetDebugLocLine

func (ValueRef) DeleteFunction added in v0.3.0

func (self ValueRef) DeleteFunction()

Remove a function from its containing module and deletes it.

@see llvm::Function::eraseFromParent()

llgo:link ValueRef.DeleteFunction C.LLVMDeleteFunction

func (ValueRef) DeleteGlobal added in v0.3.0

func (self ValueRef) DeleteGlobal()

llgo:link ValueRef.DeleteGlobal C.LLVMDeleteGlobal

func (ValueRef) DeleteInstruction added in v0.3.0

func (self ValueRef) DeleteInstruction()

Delete an instruction.

The instruction specified is deleted. It must have previously been removed from its containing building block.

@see llvm::Value::deleteValue()

llgo:link ValueRef.DeleteInstruction C.LLVMDeleteInstruction

func (ValueRef) Dump added in v0.3.1

func (self ValueRef) Dump()

Dump a representation of a value to stderr.

@see llvm::Value::dump()

llgo:link ValueRef.Dump C.LLVMDumpValue

func (ValueRef) ElementAsConstant added in v0.3.0

func (self ValueRef) ElementAsConstant(idx c.Uint) ValueRef

Get an element at specified index as a constant.

@see ConstantDataSequential::getElementAsConstant()

llgo:link ValueRef.ElementAsConstant C.LLVMGetElementAsConstant

func (ValueRef) EntryBasicBlock added in v0.3.0

func (self ValueRef) EntryBasicBlock() BasicBlockRef

Obtain the basic block that corresponds to the entry point of a function.

@see llvm::Function::getEntryBlock()

llgo:link ValueRef.EntryBasicBlock C.LLVMGetEntryBasicBlock

func (ValueRef) EnumAttributeAtIndex added in v0.3.0

func (self ValueRef) EnumAttributeAtIndex(Idx AttributeIndex, KindID c.Uint) AttributeRef

llgo:link ValueRef.EnumAttributeAtIndex C.LLVMGetEnumAttributeAtIndex

func (ValueRef) EraseGlobalIFunc added in v0.3.0

func (self ValueRef) EraseGlobalIFunc()

Remove a global indirect function from its parent module and delete it.

@see llvm::GlobalIFunc::eraseFromParent()

llgo:link ValueRef.EraseGlobalIFunc C.LLVMEraseGlobalIFunc

func (ValueRef) Exact added in v0.3.0

func (self ValueRef) Exact() Bool

llgo:link ValueRef.Exact C.LLVMGetExact

func (ValueRef) FCmpPredicate added in v0.3.0

func (self ValueRef) FCmpPredicate() RealPredicate

Obtain the float predicate of an instruction.

This is only valid for instructions that correspond to llvm::FCmpInst.

@see llvm::FCmpInst::getPredicate()

llgo:link ValueRef.FCmpPredicate C.LLVMGetFCmpPredicate

func (ValueRef) FastMathFlags added in v0.3.0

func (self ValueRef) FastMathFlags() FastMathFlags

Get the flags for which fast-math-style optimizations are allowed for this value.

Only valid on floating point instructions. @see LLVMCanValueUseFastMathFlags

llgo:link ValueRef.FastMathFlags C.LLVMGetFastMathFlags

func (ValueRef) FirstBasicBlock added in v0.3.0

func (self ValueRef) FirstBasicBlock() BasicBlockRef

Obtain the first basic block in a function.

The returned basic block can be used as an iterator. You will likely eventually call into LLVMGetNextBasicBlock() with it.

@see llvm::Function::begin()

llgo:link ValueRef.FirstBasicBlock C.LLVMGetFirstBasicBlock

func (ValueRef) FirstDbgRecord added in v0.3.0

func (self ValueRef) FirstDbgRecord() DbgRecordRef

Obtain the first debug record attached to an instruction.

Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the sequence of DbgRecords.

Return the first DbgRecord attached to Inst or NULL if there are none.

@see llvm::Instruction::getDbgRecordRange()

llgo:link ValueRef.FirstDbgRecord C.LLVMGetFirstDbgRecord

func (ValueRef) FirstParam added in v0.3.0

func (self ValueRef) FirstParam() ValueRef

Obtain the first parameter to a function.

@see llvm::Function::arg_begin()

llgo:link ValueRef.FirstParam C.LLVMGetFirstParam

func (ValueRef) FirstUse added in v0.3.0

func (self ValueRef) FirstUse() UseRef

Obtain the first use of a value.

Uses are obtained in an iterator fashion. First, call this function to obtain a reference to the first use. Then, call LLVMGetNextUse() on that instance and all subsequently obtained instances until LLVMGetNextUse() returns NULL.

@see llvm::Value::use_begin()

llgo:link ValueRef.FirstUse C.LLVMGetFirstUse

func (ValueRef) FunctionCallConv added in v0.3.0

func (self ValueRef) FunctionCallConv() c.Uint

Obtain the calling function of a function.

The returned value corresponds to the LLVMCallConv enumeration.

@see llvm::Function::getCallingConv()

llgo:link ValueRef.FunctionCallConv C.LLVMGetFunctionCallConv

func (ValueRef) GC added in v0.3.0

func (self ValueRef) GC() *c.Char

Obtain the name of the garbage collector to use during code generation.

@see llvm::Function::getGC()

llgo:link ValueRef.GC C.LLVMGetGC

func (ValueRef) GEPGetNoWrapFlags added in v0.3.0

func (self ValueRef) GEPGetNoWrapFlags() GEPNoWrapFlags

Get the no-wrap related flags for the given GEP instruction.

@see llvm::GetElementPtrInst::getNoWrapFlags

llgo:link ValueRef.GEPGetNoWrapFlags C.LLVMGEPGetNoWrapFlags

func (ValueRef) GEPSetNoWrapFlags added in v0.3.0

func (self ValueRef) GEPSetNoWrapFlags(NoWrapFlags GEPNoWrapFlags)

Set the no-wrap related flags for the given GEP instruction.

@see llvm::GetElementPtrInst::setNoWrapFlags

llgo:link ValueRef.GEPSetNoWrapFlags C.LLVMGEPSetNoWrapFlags

func (ValueRef) GEPSourceElementType added in v0.3.0

func (self ValueRef) GEPSourceElementType() TypeRef

Get the source element type of the given GEP operator.

llgo:link ValueRef.GEPSourceElementType C.LLVMGetGEPSourceElementType

func (ValueRef) GlobalAddDebugInfo added in v0.3.0

func (self ValueRef) GlobalAddDebugInfo(GVE MetadataRef)

Add debuginfo metadata to this global.

@see llvm::GlobalVariable::addDebugInfo()

llgo:link ValueRef.GlobalAddDebugInfo C.LLVMGlobalAddDebugInfo

func (ValueRef) GlobalAddMetadata added in v0.3.0

func (self ValueRef) GlobalAddMetadata(Kind c.Uint, MD MetadataRef)

Adds a metadata attachment.

@see llvm::GlobalObject::addMetadata()

llgo:link ValueRef.GlobalAddMetadata C.LLVMGlobalAddMetadata

func (ValueRef) GlobalClearMetadata added in v0.3.0

func (self ValueRef) GlobalClearMetadata()

Removes all metadata attachments from this value.

@see llvm::GlobalObject::clearMetadata()

llgo:link ValueRef.GlobalClearMetadata C.LLVMGlobalClearMetadata

func (ValueRef) GlobalCopyAllMetadata added in v0.3.0

func (self ValueRef) GlobalCopyAllMetadata(NumEntries *c.SizeT) *ValueMetadataEntry

Retrieves an array of metadata entries representing the metadata attached to this value. The caller is responsible for freeing this array by calling \c LLVMDisposeValueMetadataEntries.

@see llvm::GlobalObject::getAllMetadata()

llgo:link ValueRef.GlobalCopyAllMetadata C.LLVMGlobalCopyAllMetadata

func (ValueRef) GlobalEraseMetadata added in v0.3.0

func (self ValueRef) GlobalEraseMetadata(Kind c.Uint)

Erases a metadata attachment of the given kind if it exists.

@see llvm::GlobalObject::eraseMetadata()

llgo:link ValueRef.GlobalEraseMetadata C.LLVMGlobalEraseMetadata

func (ValueRef) GlobalGetValueType added in v0.3.0

func (self ValueRef) GlobalGetValueType() TypeRef

Returns the "value type" of a global value. This differs from the formal type of a global value which is always a pointer type.

@see llvm::GlobalValue::getValueType() @see llvm::Function::getFunctionType()

llgo:link ValueRef.GlobalGetValueType C.LLVMGlobalGetValueType

func (ValueRef) GlobalIFuncResolver added in v0.3.0

func (self ValueRef) GlobalIFuncResolver() ValueRef

Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exist.

@see llvm::GlobalIFunc::getResolver()

llgo:link ValueRef.GlobalIFuncResolver C.LLVMGetGlobalIFuncResolver

func (ValueRef) GlobalParent added in v0.3.0

func (self ValueRef) GlobalParent() ModuleRef

llgo:link ValueRef.GlobalParent C.LLVMGetGlobalParent

func (ValueRef) GlobalSetMetadata added in v0.3.0

func (self ValueRef) GlobalSetMetadata(Kind c.Uint, MD MetadataRef)

Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the given kind.

@see llvm::GlobalObject::setMetadata()

llgo:link ValueRef.GlobalSetMetadata C.LLVMGlobalSetMetadata

func (ValueRef) Handlers added in v0.3.0

func (self ValueRef) Handlers(Handlers *BasicBlockRef)

Obtain the basic blocks acting as handlers for a catchswitch instruction.

The Handlers parameter should point to a pre-allocated array of LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the first LLVMGetNumHandlers() entries in the array will be populated with LLVMBasicBlockRef instances.

@param CatchSwitch The catchswitch instruction to operate on. @param Handlers Memory address of an array to be filled with basic blocks.

llgo:link ValueRef.Handlers C.LLVMGetHandlers

func (ValueRef) HasMetadata added in v0.3.0

func (self ValueRef) HasMetadata() c.Int

Determine whether an instruction has any metadata attached.

llgo:link ValueRef.HasMetadata C.LLVMHasMetadata

func (ValueRef) HasPersonalityFn added in v0.3.0

func (self ValueRef) HasPersonalityFn() Bool

Check whether the given function has a personality function.

@see llvm::Function::hasPersonalityFn()

llgo:link ValueRef.HasPersonalityFn C.LLVMHasPersonalityFn

func (ValueRef) HasPrefixData added in v0.3.0

func (self ValueRef) HasPrefixData() Bool

Check if a given function has prefix data. Only valid on functions. See https://llvm.org/docs/LangRef.html#prefix-data

llgo:link ValueRef.HasPrefixData C.LLVMHasPrefixData

func (ValueRef) HasPrologueData added in v0.3.0

func (self ValueRef) HasPrologueData() Bool

Check if a given function has prologue data. Only valid on functions. See https://llvm.org/docs/LangRef.html#prologue-data

llgo:link ValueRef.HasPrologueData C.LLVMHasPrologueData

func (ValueRef) HasUnnamedAddr deprecated added in v0.3.0

func (self ValueRef) HasUnnamedAddr() Bool

Deprecated: Use LLVMGetUnnamedAddress instead.

llgo:link ValueRef.HasUnnamedAddr C.LLVMHasUnnamedAddr

func (ValueRef) ICmpPredicate added in v0.3.0

func (self ValueRef) ICmpPredicate() IntPredicate

Obtain the predicate of an instruction.

This is only valid for instructions that correspond to llvm::ICmpInst.

@see llvm::ICmpInst::getPredicate()

llgo:link ValueRef.ICmpPredicate C.LLVMGetICmpPredicate

func (ValueRef) ICmpSameSign added in v0.3.0

func (self ValueRef) ICmpSameSign() Bool

Get whether or not an icmp instruction has the samesign flag.

This is only valid for instructions that correspond to llvm::ICmpInst.

@see llvm::ICmpInst::hasSameSign()

llgo:link ValueRef.ICmpSameSign C.LLVMGetICmpSameSign

func (ValueRef) Incoming added in v0.3.1

func (self ValueRef) Incoming(Index c.Uint) ValueRef

Obtain an incoming value to a PHI node as an LLVMValueRef.

llgo:link ValueRef.Incoming C.LLVMGetIncomingValue

func (ValueRef) IncomingBlock added in v0.3.0

func (self ValueRef) IncomingBlock(Index c.Uint) BasicBlockRef

Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.

llgo:link ValueRef.IncomingBlock C.LLVMGetIncomingBlock

func (ValueRef) Indices added in v0.3.0

func (self ValueRef) Indices() *c.Uint

Obtain the indices as an array.

llgo:link ValueRef.Indices C.LLVMGetIndices

func (ValueRef) Initializer added in v0.3.0

func (self ValueRef) Initializer() ValueRef

llgo:link ValueRef.Initializer C.LLVMGetInitializer

func (ValueRef) InlineAsmAsmString added in v0.3.0

func (self ValueRef) InlineAsmAsmString(Len *c.SizeT) *c.Char

Get the template string used for an inline assembly snippet

llgo:link ValueRef.InlineAsmAsmString C.LLVMGetInlineAsmAsmString

func (ValueRef) InlineAsmCanUnwind added in v0.3.0

func (self ValueRef) InlineAsmCanUnwind() Bool

Get if the inline asm snippet may unwind the stack

llgo:link ValueRef.InlineAsmCanUnwind C.LLVMGetInlineAsmCanUnwind

func (ValueRef) InlineAsmConstraintString added in v0.3.0

func (self ValueRef) InlineAsmConstraintString(Len *c.SizeT) *c.Char

Get the raw constraint string for an inline assembly snippet

llgo:link ValueRef.InlineAsmConstraintString C.LLVMGetInlineAsmConstraintString

func (ValueRef) InlineAsmDialect added in v0.3.0

func (self ValueRef) InlineAsmDialect() InlineAsmDialect

Get the dialect used by the inline asm snippet

llgo:link ValueRef.InlineAsmDialect C.LLVMGetInlineAsmDialect

func (ValueRef) InlineAsmFunctionType added in v0.3.0

func (self ValueRef) InlineAsmFunctionType() TypeRef

Get the function type of the inline assembly snippet. The same type that was passed into LLVMGetInlineAsm originally

@see LLVMGetInlineAsm

llgo:link ValueRef.InlineAsmFunctionType C.LLVMGetInlineAsmFunctionType

func (ValueRef) InlineAsmHasSideEffects added in v0.3.0

func (self ValueRef) InlineAsmHasSideEffects() Bool

Get if the inline asm snippet has side effects

llgo:link ValueRef.InlineAsmHasSideEffects C.LLVMGetInlineAsmHasSideEffects

func (ValueRef) InlineAsmNeedsAlignedStack added in v0.3.0

func (self ValueRef) InlineAsmNeedsAlignedStack() Bool

Get if the inline asm snippet needs an aligned stack

llgo:link ValueRef.InlineAsmNeedsAlignedStack C.LLVMGetInlineAsmNeedsAlignedStack

func (ValueRef) InstructionCallConv added in v0.3.0

func (self ValueRef) InstructionCallConv() c.Uint

Obtain the calling convention for a call instruction.

This is the opposite of LLVMSetInstructionCallConv(). Reads its usage.

@see LLVMSetInstructionCallConv()

llgo:link ValueRef.InstructionCallConv C.LLVMGetInstructionCallConv

func (ValueRef) InstructionClone added in v0.3.0

func (self ValueRef) InstructionClone() ValueRef

Create a copy of 'this' instruction that is identical in all ways except the following:

  • The instruction has no parent
  • The instruction has no name

@see llvm::Instruction::clone()

llgo:link ValueRef.InstructionClone C.LLVMInstructionClone

func (ValueRef) InstructionEraseFromParent added in v0.3.0

func (self ValueRef) InstructionEraseFromParent()

Remove and delete an instruction.

The instruction specified is removed from its containing building block and then deleted.

@see llvm::Instruction::eraseFromParent()

llgo:link ValueRef.InstructionEraseFromParent C.LLVMInstructionEraseFromParent

func (ValueRef) InstructionGetAllMetadataOtherThanDebugLoc added in v0.3.0

func (self ValueRef) InstructionGetAllMetadataOtherThanDebugLoc(NumEntries *c.SizeT) *ValueMetadataEntry

Returns the metadata associated with an instruction value, but filters out all the debug locations.

@see llvm::Instruction::getAllMetadataOtherThanDebugLoc()

llgo:link ValueRef.InstructionGetAllMetadataOtherThanDebugLoc C.LLVMInstructionGetAllMetadataOtherThanDebugLoc

func (ValueRef) InstructionGetDebugLoc added in v0.3.0

func (self ValueRef) InstructionGetDebugLoc() MetadataRef

Get the debug location for the given instruction.

@see llvm::Instruction::getDebugLoc()

llgo:link ValueRef.InstructionGetDebugLoc C.LLVMInstructionGetDebugLoc

func (ValueRef) InstructionOpcode added in v0.3.0

func (self ValueRef) InstructionOpcode() Opcode

Obtain the code opcode for an individual instruction.

@see llvm::Instruction::getOpCode()

llgo:link ValueRef.InstructionOpcode C.LLVMGetInstructionOpcode

func (ValueRef) InstructionParent added in v0.3.0

func (self ValueRef) InstructionParent() BasicBlockRef

Obtain the basic block to which an instruction belongs.

@see llvm::Instruction::getParent()

llgo:link ValueRef.InstructionParent C.LLVMGetInstructionParent

func (ValueRef) InstructionRemoveFromParent added in v0.3.0

func (self ValueRef) InstructionRemoveFromParent()

Remove an instruction.

The instruction specified is removed from its containing building block but is kept alive.

@see llvm::Instruction::removeFromParent()

llgo:link ValueRef.InstructionRemoveFromParent C.LLVMInstructionRemoveFromParent

func (ValueRef) InstructionSetDebugLoc added in v0.3.0

func (self ValueRef) InstructionSetDebugLoc(Loc MetadataRef)

Set the debug location for the given instruction.

To clear the location metadata of the given instruction, pass NULL to \p Loc.

@see llvm::Instruction::setDebugLoc()

llgo:link ValueRef.InstructionSetDebugLoc C.LLVMInstructionSetDebugLoc

func (ValueRef) IntrinsicID added in v0.3.0

func (self ValueRef) IntrinsicID() c.Uint

Obtain the ID number from a function instance.

@see llvm::Function::getIntrinsicID()

llgo:link ValueRef.IntrinsicID C.LLVMGetIntrinsicID

func (ValueRef) IsAAddrSpaceCastInst added in v0.3.0

func (self ValueRef) IsAAddrSpaceCastInst() ValueRef

llgo:link ValueRef.IsAAddrSpaceCastInst C.LLVMIsAAddrSpaceCastInst

func (ValueRef) IsAAllocaInst added in v0.3.0

func (self ValueRef) IsAAllocaInst() ValueRef

llgo:link ValueRef.IsAAllocaInst C.LLVMIsAAllocaInst

func (ValueRef) IsAArgument added in v0.3.0

func (self ValueRef) IsAArgument() ValueRef

llgo:link ValueRef.IsAArgument C.LLVMIsAArgument

func (ValueRef) IsAAtomicCmpXchgInst added in v0.3.0

func (self ValueRef) IsAAtomicCmpXchgInst() ValueRef

llgo:link ValueRef.IsAAtomicCmpXchgInst C.LLVMIsAAtomicCmpXchgInst

func (ValueRef) IsAAtomicRMWInst added in v0.3.0

func (self ValueRef) IsAAtomicRMWInst() ValueRef

llgo:link ValueRef.IsAAtomicRMWInst C.LLVMIsAAtomicRMWInst

func (ValueRef) IsABasicBlock added in v0.3.0

func (self ValueRef) IsABasicBlock() ValueRef

llgo:link ValueRef.IsABasicBlock C.LLVMIsABasicBlock

func (ValueRef) IsABinaryOperator added in v0.3.0

func (self ValueRef) IsABinaryOperator() ValueRef

llgo:link ValueRef.IsABinaryOperator C.LLVMIsABinaryOperator

func (ValueRef) IsABitCastInst added in v0.3.0

func (self ValueRef) IsABitCastInst() ValueRef

llgo:link ValueRef.IsABitCastInst C.LLVMIsABitCastInst

func (ValueRef) IsABlockAddress added in v0.3.0

func (self ValueRef) IsABlockAddress() ValueRef

llgo:link ValueRef.IsABlockAddress C.LLVMIsABlockAddress

func (ValueRef) IsABranchInst added in v0.3.0

func (self ValueRef) IsABranchInst() ValueRef

llgo:link ValueRef.IsABranchInst C.LLVMIsABranchInst

func (ValueRef) IsACallBrInst added in v0.3.0

func (self ValueRef) IsACallBrInst() ValueRef

llgo:link ValueRef.IsACallBrInst C.LLVMIsACallBrInst

func (ValueRef) IsACallInst added in v0.3.0

func (self ValueRef) IsACallInst() ValueRef

llgo:link ValueRef.IsACallInst C.LLVMIsACallInst

func (ValueRef) IsACastInst added in v0.3.0

func (self ValueRef) IsACastInst() ValueRef

llgo:link ValueRef.IsACastInst C.LLVMIsACastInst

func (ValueRef) IsACatchPadInst added in v0.3.0

func (self ValueRef) IsACatchPadInst() ValueRef

llgo:link ValueRef.IsACatchPadInst C.LLVMIsACatchPadInst

func (ValueRef) IsACatchReturnInst added in v0.3.0

func (self ValueRef) IsACatchReturnInst() ValueRef

llgo:link ValueRef.IsACatchReturnInst C.LLVMIsACatchReturnInst

func (ValueRef) IsACatchSwitchInst added in v0.3.0

func (self ValueRef) IsACatchSwitchInst() ValueRef

llgo:link ValueRef.IsACatchSwitchInst C.LLVMIsACatchSwitchInst

func (ValueRef) IsACleanupPadInst added in v0.3.0

func (self ValueRef) IsACleanupPadInst() ValueRef

llgo:link ValueRef.IsACleanupPadInst C.LLVMIsACleanupPadInst

func (ValueRef) IsACleanupReturnInst added in v0.3.0

func (self ValueRef) IsACleanupReturnInst() ValueRef

llgo:link ValueRef.IsACleanupReturnInst C.LLVMIsACleanupReturnInst

func (ValueRef) IsACmpInst added in v0.3.0

func (self ValueRef) IsACmpInst() ValueRef

llgo:link ValueRef.IsACmpInst C.LLVMIsACmpInst

func (ValueRef) IsAConstant added in v0.3.0

func (self ValueRef) IsAConstant() ValueRef

llgo:link ValueRef.IsAConstant C.LLVMIsAConstant

func (ValueRef) IsAConstantAggregateZero added in v0.3.0

func (self ValueRef) IsAConstantAggregateZero() ValueRef

llgo:link ValueRef.IsAConstantAggregateZero C.LLVMIsAConstantAggregateZero

func (ValueRef) IsAConstantArray added in v0.3.0

func (self ValueRef) IsAConstantArray() ValueRef

llgo:link ValueRef.IsAConstantArray C.LLVMIsAConstantArray

func (ValueRef) IsAConstantDataArray added in v0.3.0

func (self ValueRef) IsAConstantDataArray() ValueRef

llgo:link ValueRef.IsAConstantDataArray C.LLVMIsAConstantDataArray

func (ValueRef) IsAConstantDataSequential added in v0.3.0

func (self ValueRef) IsAConstantDataSequential() ValueRef

llgo:link ValueRef.IsAConstantDataSequential C.LLVMIsAConstantDataSequential

func (ValueRef) IsAConstantDataVector added in v0.3.0

func (self ValueRef) IsAConstantDataVector() ValueRef

llgo:link ValueRef.IsAConstantDataVector C.LLVMIsAConstantDataVector

func (ValueRef) IsAConstantExpr added in v0.3.0

func (self ValueRef) IsAConstantExpr() ValueRef

llgo:link ValueRef.IsAConstantExpr C.LLVMIsAConstantExpr

func (ValueRef) IsAConstantFP added in v0.3.0

func (self ValueRef) IsAConstantFP() ValueRef

llgo:link ValueRef.IsAConstantFP C.LLVMIsAConstantFP

func (ValueRef) IsAConstantInt added in v0.3.0

func (self ValueRef) IsAConstantInt() ValueRef

llgo:link ValueRef.IsAConstantInt C.LLVMIsAConstantInt

func (ValueRef) IsAConstantPointerNull added in v0.3.0

func (self ValueRef) IsAConstantPointerNull() ValueRef

llgo:link ValueRef.IsAConstantPointerNull C.LLVMIsAConstantPointerNull

func (ValueRef) IsAConstantPtrAuth added in v0.3.0

func (self ValueRef) IsAConstantPtrAuth() ValueRef

llgo:link ValueRef.IsAConstantPtrAuth C.LLVMIsAConstantPtrAuth

func (ValueRef) IsAConstantStruct added in v0.3.0

func (self ValueRef) IsAConstantStruct() ValueRef

llgo:link ValueRef.IsAConstantStruct C.LLVMIsAConstantStruct

func (ValueRef) IsAConstantTokenNone added in v0.3.0

func (self ValueRef) IsAConstantTokenNone() ValueRef

llgo:link ValueRef.IsAConstantTokenNone C.LLVMIsAConstantTokenNone

func (ValueRef) IsAConstantVector added in v0.3.0

func (self ValueRef) IsAConstantVector() ValueRef

llgo:link ValueRef.IsAConstantVector C.LLVMIsAConstantVector

func (ValueRef) IsADbgDeclareInst added in v0.3.0

func (self ValueRef) IsADbgDeclareInst() ValueRef

llgo:link ValueRef.IsADbgDeclareInst C.LLVMIsADbgDeclareInst

func (ValueRef) IsADbgInfoIntrinsic added in v0.3.0

func (self ValueRef) IsADbgInfoIntrinsic() ValueRef

llgo:link ValueRef.IsADbgInfoIntrinsic C.LLVMIsADbgInfoIntrinsic

func (ValueRef) IsADbgLabelInst added in v0.3.0

func (self ValueRef) IsADbgLabelInst() ValueRef

llgo:link ValueRef.IsADbgLabelInst C.LLVMIsADbgLabelInst

func (ValueRef) IsADbgVariableIntrinsic added in v0.3.0

func (self ValueRef) IsADbgVariableIntrinsic() ValueRef

llgo:link ValueRef.IsADbgVariableIntrinsic C.LLVMIsADbgVariableIntrinsic

func (ValueRef) IsAExtractElementInst added in v0.3.0

func (self ValueRef) IsAExtractElementInst() ValueRef

llgo:link ValueRef.IsAExtractElementInst C.LLVMIsAExtractElementInst

func (ValueRef) IsAExtractValueInst added in v0.3.0

func (self ValueRef) IsAExtractValueInst() ValueRef

llgo:link ValueRef.IsAExtractValueInst C.LLVMIsAExtractValueInst

func (ValueRef) IsAFCmpInst added in v0.3.0

func (self ValueRef) IsAFCmpInst() ValueRef

llgo:link ValueRef.IsAFCmpInst C.LLVMIsAFCmpInst

func (ValueRef) IsAFPExtInst added in v0.3.0

func (self ValueRef) IsAFPExtInst() ValueRef

llgo:link ValueRef.IsAFPExtInst C.LLVMIsAFPExtInst

func (ValueRef) IsAFPToSIInst added in v0.3.0

func (self ValueRef) IsAFPToSIInst() ValueRef

llgo:link ValueRef.IsAFPToSIInst C.LLVMIsAFPToSIInst

func (ValueRef) IsAFPToUIInst added in v0.3.0

func (self ValueRef) IsAFPToUIInst() ValueRef

llgo:link ValueRef.IsAFPToUIInst C.LLVMIsAFPToUIInst

func (ValueRef) IsAFPTruncInst added in v0.3.0

func (self ValueRef) IsAFPTruncInst() ValueRef

llgo:link ValueRef.IsAFPTruncInst C.LLVMIsAFPTruncInst

func (ValueRef) IsAFenceInst added in v0.3.0

func (self ValueRef) IsAFenceInst() ValueRef

llgo:link ValueRef.IsAFenceInst C.LLVMIsAFenceInst

func (ValueRef) IsAFreezeInst added in v0.3.0

func (self ValueRef) IsAFreezeInst() ValueRef

llgo:link ValueRef.IsAFreezeInst C.LLVMIsAFreezeInst

func (ValueRef) IsAFuncletPadInst added in v0.3.0

func (self ValueRef) IsAFuncletPadInst() ValueRef

llgo:link ValueRef.IsAFuncletPadInst C.LLVMIsAFuncletPadInst

func (ValueRef) IsAFunction added in v0.3.0

func (self ValueRef) IsAFunction() ValueRef

llgo:link ValueRef.IsAFunction C.LLVMIsAFunction

func (ValueRef) IsAGetElementPtrInst added in v0.3.0

func (self ValueRef) IsAGetElementPtrInst() ValueRef

llgo:link ValueRef.IsAGetElementPtrInst C.LLVMIsAGetElementPtrInst

func (ValueRef) IsAGlobal added in v0.3.1

func (self ValueRef) IsAGlobal() ValueRef

llgo:link ValueRef.IsAGlobal C.LLVMIsAGlobalValue

func (ValueRef) IsAGlobalAlias added in v0.3.0

func (self ValueRef) IsAGlobalAlias() ValueRef

llgo:link ValueRef.IsAGlobalAlias C.LLVMIsAGlobalAlias

func (ValueRef) IsAGlobalIFunc added in v0.3.0

func (self ValueRef) IsAGlobalIFunc() ValueRef

llgo:link ValueRef.IsAGlobalIFunc C.LLVMIsAGlobalIFunc

func (ValueRef) IsAGlobalObject added in v0.3.0

func (self ValueRef) IsAGlobalObject() ValueRef

llgo:link ValueRef.IsAGlobalObject C.LLVMIsAGlobalObject

func (ValueRef) IsAGlobalVariable added in v0.3.0

func (self ValueRef) IsAGlobalVariable() ValueRef

llgo:link ValueRef.IsAGlobalVariable C.LLVMIsAGlobalVariable

func (ValueRef) IsAICmpInst added in v0.3.0

func (self ValueRef) IsAICmpInst() ValueRef

llgo:link ValueRef.IsAICmpInst C.LLVMIsAICmpInst

func (ValueRef) IsAIndirectBrInst added in v0.3.0

func (self ValueRef) IsAIndirectBrInst() ValueRef

llgo:link ValueRef.IsAIndirectBrInst C.LLVMIsAIndirectBrInst

func (ValueRef) IsAInlineAsm added in v0.3.0

func (self ValueRef) IsAInlineAsm() ValueRef

llgo:link ValueRef.IsAInlineAsm C.LLVMIsAInlineAsm

func (ValueRef) IsAInsertElementInst added in v0.3.0

func (self ValueRef) IsAInsertElementInst() ValueRef

llgo:link ValueRef.IsAInsertElementInst C.LLVMIsAInsertElementInst

func (ValueRef) IsAInsertValueInst added in v0.3.0

func (self ValueRef) IsAInsertValueInst() ValueRef

llgo:link ValueRef.IsAInsertValueInst C.LLVMIsAInsertValueInst

func (ValueRef) IsAInstruction added in v0.3.0

func (self ValueRef) IsAInstruction() ValueRef

llgo:link ValueRef.IsAInstruction C.LLVMIsAInstruction

func (ValueRef) IsAIntToPtrInst added in v0.3.0

func (self ValueRef) IsAIntToPtrInst() ValueRef

llgo:link ValueRef.IsAIntToPtrInst C.LLVMIsAIntToPtrInst

func (ValueRef) IsAIntrinsicInst added in v0.3.0

func (self ValueRef) IsAIntrinsicInst() ValueRef

llgo:link ValueRef.IsAIntrinsicInst C.LLVMIsAIntrinsicInst

func (ValueRef) IsAInvokeInst added in v0.3.0

func (self ValueRef) IsAInvokeInst() ValueRef

llgo:link ValueRef.IsAInvokeInst C.LLVMIsAInvokeInst

func (ValueRef) IsALandingPadInst added in v0.3.0

func (self ValueRef) IsALandingPadInst() ValueRef

llgo:link ValueRef.IsALandingPadInst C.LLVMIsALandingPadInst

func (ValueRef) IsALoadInst added in v0.3.0

func (self ValueRef) IsALoadInst() ValueRef

llgo:link ValueRef.IsALoadInst C.LLVMIsALoadInst

func (ValueRef) IsAMDNode added in v0.3.0

func (self ValueRef) IsAMDNode() ValueRef

llgo:link ValueRef.IsAMDNode C.LLVMIsAMDNode

func (ValueRef) IsAMDString added in v0.3.0

func (self ValueRef) IsAMDString() ValueRef

llgo:link ValueRef.IsAMDString C.LLVMIsAMDString

func (ValueRef) IsAMemCpyInst added in v0.3.0

func (self ValueRef) IsAMemCpyInst() ValueRef

llgo:link ValueRef.IsAMemCpyInst C.LLVMIsAMemCpyInst

func (ValueRef) IsAMemIntrinsic added in v0.3.0

func (self ValueRef) IsAMemIntrinsic() ValueRef

llgo:link ValueRef.IsAMemIntrinsic C.LLVMIsAMemIntrinsic

func (ValueRef) IsAMemMoveInst added in v0.3.0

func (self ValueRef) IsAMemMoveInst() ValueRef

llgo:link ValueRef.IsAMemMoveInst C.LLVMIsAMemMoveInst

func (ValueRef) IsAMemSetInst added in v0.3.0

func (self ValueRef) IsAMemSetInst() ValueRef

llgo:link ValueRef.IsAMemSetInst C.LLVMIsAMemSetInst

func (ValueRef) IsAPHINode added in v0.3.0

func (self ValueRef) IsAPHINode() ValueRef

llgo:link ValueRef.IsAPHINode C.LLVMIsAPHINode

func (ValueRef) IsAPoison added in v0.3.1

func (self ValueRef) IsAPoison() ValueRef

llgo:link ValueRef.IsAPoison C.LLVMIsAPoisonValue

func (ValueRef) IsAPtrToIntInst added in v0.3.0

func (self ValueRef) IsAPtrToIntInst() ValueRef

llgo:link ValueRef.IsAPtrToIntInst C.LLVMIsAPtrToIntInst

func (ValueRef) IsAResumeInst added in v0.3.0

func (self ValueRef) IsAResumeInst() ValueRef

llgo:link ValueRef.IsAResumeInst C.LLVMIsAResumeInst

func (ValueRef) IsAReturnInst added in v0.3.0

func (self ValueRef) IsAReturnInst() ValueRef

llgo:link ValueRef.IsAReturnInst C.LLVMIsAReturnInst

func (ValueRef) IsASExtInst added in v0.3.0

func (self ValueRef) IsASExtInst() ValueRef

llgo:link ValueRef.IsASExtInst C.LLVMIsASExtInst

func (ValueRef) IsASIToFPInst added in v0.3.0

func (self ValueRef) IsASIToFPInst() ValueRef

llgo:link ValueRef.IsASIToFPInst C.LLVMIsASIToFPInst

func (ValueRef) IsASelectInst added in v0.3.0

func (self ValueRef) IsASelectInst() ValueRef

llgo:link ValueRef.IsASelectInst C.LLVMIsASelectInst

func (ValueRef) IsAShuffleVectorInst added in v0.3.0

func (self ValueRef) IsAShuffleVectorInst() ValueRef

llgo:link ValueRef.IsAShuffleVectorInst C.LLVMIsAShuffleVectorInst

func (ValueRef) IsAStoreInst added in v0.3.0

func (self ValueRef) IsAStoreInst() ValueRef

llgo:link ValueRef.IsAStoreInst C.LLVMIsAStoreInst

func (ValueRef) IsASwitchInst added in v0.3.0

func (self ValueRef) IsASwitchInst() ValueRef

llgo:link ValueRef.IsASwitchInst C.LLVMIsASwitchInst

func (ValueRef) IsATerminatorInst added in v0.3.0

func (self ValueRef) IsATerminatorInst() ValueRef

Determine whether an instruction is a terminator. This routine is named to be compatible with historical functions that did this by querying the underlying C++ type.

@see llvm::Instruction::isTerminator()

llgo:link ValueRef.IsATerminatorInst C.LLVMIsATerminatorInst

func (ValueRef) IsATruncInst added in v0.3.0

func (self ValueRef) IsATruncInst() ValueRef

llgo:link ValueRef.IsATruncInst C.LLVMIsATruncInst

func (ValueRef) IsAUIToFPInst added in v0.3.0

func (self ValueRef) IsAUIToFPInst() ValueRef

llgo:link ValueRef.IsAUIToFPInst C.LLVMIsAUIToFPInst

func (ValueRef) IsAUnaryInstruction added in v0.3.0

func (self ValueRef) IsAUnaryInstruction() ValueRef

llgo:link ValueRef.IsAUnaryInstruction C.LLVMIsAUnaryInstruction

func (ValueRef) IsAUnaryOperator added in v0.3.0

func (self ValueRef) IsAUnaryOperator() ValueRef

llgo:link ValueRef.IsAUnaryOperator C.LLVMIsAUnaryOperator

func (ValueRef) IsAUndef added in v0.3.1

func (self ValueRef) IsAUndef() ValueRef

llgo:link ValueRef.IsAUndef C.LLVMIsAUndefValue

func (ValueRef) IsAUnreachableInst added in v0.3.0

func (self ValueRef) IsAUnreachableInst() ValueRef

llgo:link ValueRef.IsAUnreachableInst C.LLVMIsAUnreachableInst

func (ValueRef) IsAUser added in v0.3.0

func (self ValueRef) IsAUser() ValueRef

llgo:link ValueRef.IsAUser C.LLVMIsAUser

func (ValueRef) IsAVAArgInst added in v0.3.0

func (self ValueRef) IsAVAArgInst() ValueRef

llgo:link ValueRef.IsAVAArgInst C.LLVMIsAVAArgInst

func (ValueRef) IsAValueAsMetadata added in v0.3.0

func (self ValueRef) IsAValueAsMetadata() ValueRef

llgo:link ValueRef.IsAValueAsMetadata C.LLVMIsAValueAsMetadata

func (ValueRef) IsAZExtInst added in v0.3.0

func (self ValueRef) IsAZExtInst() ValueRef

llgo:link ValueRef.IsAZExtInst C.LLVMIsAZExtInst

func (ValueRef) IsAtomic added in v0.3.0

func (self ValueRef) IsAtomic() Bool

Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg, fence, or loads and stores with atomic ordering.

llgo:link ValueRef.IsAtomic C.LLVMIsAtomic

func (ValueRef) IsAtomicSingleThread added in v0.3.0

func (self ValueRef) IsAtomicSingleThread() Bool

llgo:link ValueRef.IsAtomicSingleThread C.LLVMIsAtomicSingleThread

func (ValueRef) IsBasicBlock added in v0.3.1

func (self ValueRef) IsBasicBlock() Bool

Determine whether an LLVMValueRef is itself a basic block.

llgo:link ValueRef.IsBasicBlock C.LLVMValueIsBasicBlock

func (ValueRef) IsCleanup added in v0.3.0

func (self ValueRef) IsCleanup() Bool

Get the 'cleanup' flag in the landingpad instruction

llgo:link ValueRef.IsCleanup C.LLVMIsCleanup

func (ValueRef) IsConditional added in v0.3.0

func (self ValueRef) IsConditional() Bool

Return if a branch is conditional.

This only works on llvm::BranchInst instructions.

@see llvm::BranchInst::isConditional

llgo:link ValueRef.IsConditional C.LLVMIsConditional

func (ValueRef) IsConstant added in v0.3.0

func (self ValueRef) IsConstant() Bool

Determine whether the specified value instance is constant.

llgo:link ValueRef.IsConstant C.LLVMIsConstant

func (ValueRef) IsConstantString added in v0.3.0

func (self ValueRef) IsConstantString() Bool

Returns true if the specified constant is an array of i8.

@see ConstantDataSequential::getAsString()

llgo:link ValueRef.IsConstantString C.LLVMIsConstantString

func (ValueRef) IsDeclaration added in v0.3.0

func (self ValueRef) IsDeclaration() Bool

llgo:link ValueRef.IsDeclaration C.LLVMIsDeclaration

func (ValueRef) IsDisjoint added in v0.3.0

func (self ValueRef) IsDisjoint() Bool

Gets whether the instruction has the disjoint flag set. Only valid for or instructions.

llgo:link ValueRef.IsDisjoint C.LLVMGetIsDisjoint

func (ValueRef) IsExternallyInitialized added in v0.3.0

func (self ValueRef) IsExternallyInitialized() Bool

llgo:link ValueRef.IsExternallyInitialized C.LLVMIsExternallyInitialized

func (ValueRef) IsGlobalConstant added in v0.3.0

func (self ValueRef) IsGlobalConstant() Bool

llgo:link ValueRef.IsGlobalConstant C.LLVMIsGlobalConstant

func (ValueRef) IsInBounds added in v0.3.0

func (self ValueRef) IsInBounds() Bool

Check whether the given GEP operator is inbounds.

llgo:link ValueRef.IsInBounds C.LLVMIsInBounds

func (ValueRef) IsNull added in v0.3.0

func (self ValueRef) IsNull() Bool

Determine whether a value instance is null.

@see llvm::Constant::isNullValue()

llgo:link ValueRef.IsNull C.LLVMIsNull

func (ValueRef) IsPoison added in v0.3.0

func (self ValueRef) IsPoison() Bool

Determine whether a value instance is poisonous.

llgo:link ValueRef.IsPoison C.LLVMIsPoison

func (ValueRef) IsTailCall added in v0.3.0

func (self ValueRef) IsTailCall() Bool

Obtain whether a call instruction is a tail call.

This only works on llvm::CallInst instructions.

@see llvm::CallInst::isTailCall()

llgo:link ValueRef.IsTailCall C.LLVMIsTailCall

func (ValueRef) IsThreadLocal added in v0.3.0

func (self ValueRef) IsThreadLocal() Bool

llgo:link ValueRef.IsThreadLocal C.LLVMIsThreadLocal

func (ValueRef) IsUndef added in v0.3.0

func (self ValueRef) IsUndef() Bool

Determine whether a value instance is undefined.

llgo:link ValueRef.IsUndef C.LLVMIsUndef

func (ValueRef) Kind added in v0.3.1

func (self ValueRef) Kind() ValueKind

Obtain the enumerated type of a Value instance.

@see llvm::Value::getValueID()

llgo:link ValueRef.Kind C.LLVMGetValueKind

func (ValueRef) LastBasicBlock added in v0.3.0

func (self ValueRef) LastBasicBlock() BasicBlockRef

Obtain the last basic block in a function.

@see llvm::Function::end()

llgo:link ValueRef.LastBasicBlock C.LLVMGetLastBasicBlock

func (ValueRef) LastDbgRecord added in v0.3.0

func (self ValueRef) LastDbgRecord() DbgRecordRef

Obtain the last debug record attached to an instruction.

Return the last DbgRecord attached to Inst or NULL if there are none.

@see llvm::Instruction::getDbgRecordRange()

llgo:link ValueRef.LastDbgRecord C.LLVMGetLastDbgRecord

func (ValueRef) LastParam added in v0.3.0

func (self ValueRef) LastParam() ValueRef

Obtain the last parameter to a function.

@see llvm::Function::arg_end()

llgo:link ValueRef.LastParam C.LLVMGetLastParam

func (ValueRef) Linkage added in v0.3.0

func (self ValueRef) Linkage() Linkage

llgo:link ValueRef.Linkage C.LLVMGetLinkage

func (ValueRef) MDNodeNumOperands added in v0.3.0

func (self ValueRef) MDNodeNumOperands() c.Uint

Obtain the number of operands from an MDNode value.

@param V MDNode to get number of operands from. @return Number of operands of the MDNode.

llgo:link ValueRef.MDNodeNumOperands C.LLVMGetMDNodeNumOperands

func (ValueRef) MDNodeOperands added in v0.3.0

func (self ValueRef) MDNodeOperands(Dest *ValueRef)

Obtain the given MDNode's operands.

The passed LLVMValueRef pointer should point to enough memory to hold all of the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the MDNode's operands.

@param V MDNode to get the operands from. @param Dest Destination array for operands.

llgo:link ValueRef.MDNodeOperands C.LLVMGetMDNodeOperands

func (ValueRef) MDString added in v0.3.0

func (self ValueRef) MDString(Length *c.Uint) *c.Char

Obtain the underlying string from a MDString value.

@param V Instance to obtain string from. @param Length Memory address which will hold length of returned string. @return String data in MDString.

llgo:link ValueRef.MDString C.LLVMGetMDString

func (ValueRef) Mask added in v0.3.1

func (self ValueRef) Mask(Elt c.Uint) c.Int

Get the mask value at position Elt in the mask of a ShuffleVector instruction.

\Returns the result of \c LLVMGetUndefMaskElem() if the mask value is poison at that position.

llgo:link ValueRef.Mask C.LLVMGetMaskValue

func (ValueRef) Metadata added in v0.3.0

func (self ValueRef) Metadata(KindID c.Uint) ValueRef

Return metadata associated with an instruction value.

llgo:link ValueRef.Metadata C.LLVMGetMetadata

func (ValueRef) NNeg added in v0.3.0

func (self ValueRef) NNeg() Bool

Gets if the instruction has the non-negative flag set. Only valid for zext instructions.

llgo:link ValueRef.NNeg C.LLVMGetNNeg

func (ValueRef) NSW added in v0.3.0

func (self ValueRef) NSW() Bool

llgo:link ValueRef.NSW C.LLVMGetNSW

func (ValueRef) NUW added in v0.3.0

func (self ValueRef) NUW() Bool

llgo:link ValueRef.NUW C.LLVMGetNUW

func (ValueRef) Name deprecated added in v0.3.1

func (self ValueRef) Name() *c.Char

Deprecated: Use LLVMGetValueName2 instead.

llgo:link ValueRef.Name C.LLVMGetValueName

func (ValueRef) Name2 added in v0.3.1

func (self ValueRef) Name2(Length *c.SizeT) *c.Char

Obtain the string name of a value.

@see llvm::Value::getName()

llgo:link ValueRef.Name2 C.LLVMGetValueName2

func (ValueRef) NextFunction added in v0.3.0

func (self ValueRef) NextFunction() ValueRef

Advance a Function iterator to the next Function.

Returns NULL if the iterator was already at the end and there are no more functions.

llgo:link ValueRef.NextFunction C.LLVMGetNextFunction

func (ValueRef) NextGlobal added in v0.3.0

func (self ValueRef) NextGlobal() ValueRef

llgo:link ValueRef.NextGlobal C.LLVMGetNextGlobal

func (ValueRef) NextGlobalAlias added in v0.3.0

func (self ValueRef) NextGlobalAlias() ValueRef

Advance a GlobalAlias iterator to the next GlobalAlias.

Returns NULL if the iterator was already at the end and there are no more global aliases.

llgo:link ValueRef.NextGlobalAlias C.LLVMGetNextGlobalAlias

func (ValueRef) NextGlobalIFunc added in v0.3.0

func (self ValueRef) NextGlobalIFunc() ValueRef

Advance a GlobalIFunc iterator to the next GlobalIFunc.

Returns NULL if the iterator was already at the end and there are no more global aliases.

llgo:link ValueRef.NextGlobalIFunc C.LLVMGetNextGlobalIFunc

func (ValueRef) NextInstruction added in v0.3.0

func (self ValueRef) NextInstruction() ValueRef

Obtain the instruction that occurs after the one specified.

The next instruction will be from the same basic block.

If this is the last instruction in a basic block, NULL will be returned.

llgo:link ValueRef.NextInstruction C.LLVMGetNextInstruction

func (ValueRef) NextParam added in v0.3.0

func (self ValueRef) NextParam() ValueRef

Obtain the next parameter to a function.

This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is actually a wrapped iterator) and obtains the next parameter from the underlying iterator.

llgo:link ValueRef.NextParam C.LLVMGetNextParam

func (ValueRef) NormalDest added in v0.3.0

func (self ValueRef) NormalDest() BasicBlockRef

Return the normal destination basic block.

This only works on llvm::InvokeInst instructions.

@see llvm::InvokeInst::getNormalDest()

llgo:link ValueRef.NormalDest C.LLVMGetNormalDest

func (ValueRef) NumArgOperands added in v0.3.0

func (self ValueRef) NumArgOperands() c.Uint

Obtain the argument count for a call instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst, llvm::InvokeInst, or llvm:FuncletPadInst.

@see llvm::CallInst::getNumArgOperands() @see llvm::InvokeInst::getNumArgOperands() @see llvm::FuncletPadInst::getNumArgOperands()

llgo:link ValueRef.NumArgOperands C.LLVMGetNumArgOperands

func (ValueRef) NumClauses added in v0.3.0

func (self ValueRef) NumClauses() c.Uint

Get the number of clauses on the landingpad instruction

llgo:link ValueRef.NumClauses C.LLVMGetNumClauses

func (ValueRef) NumHandlers added in v0.3.0

func (self ValueRef) NumHandlers() c.Uint

Get the number of handlers on the catchswitch instruction

llgo:link ValueRef.NumHandlers C.LLVMGetNumHandlers

func (ValueRef) NumIndices added in v0.3.0

func (self ValueRef) NumIndices() c.Uint

Obtain the number of indices. NB: This also works on GEP operators.

llgo:link ValueRef.NumIndices C.LLVMGetNumIndices

func (ValueRef) NumMaskElements added in v0.3.0

func (self ValueRef) NumMaskElements() c.Uint

Get the number of elements in the mask of a ShuffleVector instruction.

llgo:link ValueRef.NumMaskElements C.LLVMGetNumMaskElements

func (ValueRef) NumOperandBundles added in v0.3.0

func (self ValueRef) NumOperandBundles() c.Uint

Obtain the number of operand bundles attached to this instruction.

This only works on llvm::CallInst and llvm::InvokeInst instructions.

@see llvm::CallBase::getNumOperandBundles()

llgo:link ValueRef.NumOperandBundles C.LLVMGetNumOperandBundles

func (ValueRef) NumOperands added in v0.3.0

func (self ValueRef) NumOperands() c.Int

Obtain the number of operands in a llvm::User value.

@see llvm::User::getNumOperands()

llgo:link ValueRef.NumOperands C.LLVMGetNumOperands

func (ValueRef) NumSuccessors added in v0.3.0

func (self ValueRef) NumSuccessors() c.Uint

Return the number of successors that this terminator has.

@see llvm::Instruction::getNumSuccessors

llgo:link ValueRef.NumSuccessors C.LLVMGetNumSuccessors

func (ValueRef) Operand added in v0.3.0

func (self ValueRef) Operand(Index c.Uint) ValueRef

Obtain an operand at a specific index in a llvm::User value.

@see llvm::User::getOperand()

llgo:link ValueRef.Operand C.LLVMGetOperand

func (ValueRef) OperandBundleAtIndex added in v0.3.0

func (self ValueRef) OperandBundleAtIndex(Index c.Uint) OperandBundleRef

Obtain the operand bundle attached to this instruction at the given index. Use LLVMDisposeOperandBundle to free the operand bundle.

This only works on llvm::CallInst and llvm::InvokeInst instructions.

llgo:link ValueRef.OperandBundleAtIndex C.LLVMGetOperandBundleAtIndex

func (ValueRef) OperandUse added in v0.3.0

func (self ValueRef) OperandUse(Index c.Uint) UseRef

Obtain the use of an operand at a specific index in a llvm::User value.

@see llvm::User::getOperandUse()

llgo:link ValueRef.OperandUse C.LLVMGetOperandUse

func (ValueRef) Ordering added in v0.3.0

func (self ValueRef) Ordering() AtomicOrdering

llgo:link ValueRef.Ordering C.LLVMGetOrdering

func (ValueRef) Param added in v0.3.0

func (self ValueRef) Param(Index c.Uint) ValueRef

Obtain the parameter at the specified index.

Parameters are indexed from 0.

@see llvm::Function::arg_begin()

llgo:link ValueRef.Param C.LLVMGetParam

func (ValueRef) ParamParent added in v0.3.0

func (self ValueRef) ParamParent() ValueRef

Obtain the function to which this argument belongs.

Unlike other functions in this group, this one takes an LLVMValueRef that corresponds to a llvm::Attribute.

The returned LLVMValueRef is the llvm::Function to which this argument belongs.

llgo:link ValueRef.ParamParent C.LLVMGetParamParent

func (ValueRef) Params added in v0.3.0

func (self ValueRef) Params(Params *ValueRef)

Obtain the parameters in a function.

The takes a pointer to a pre-allocated array of LLVMValueRef that is at least LLVMCountParams() long. This array will be filled with LLVMValueRef instances which correspond to the parameters the function receives. Each LLVMValueRef corresponds to a llvm::Argument instance.

@see llvm::Function::arg_begin()

llgo:link ValueRef.Params C.LLVMGetParams

func (ValueRef) ParentCatchSwitch added in v0.3.0

func (self ValueRef) ParentCatchSwitch() ValueRef

Get the parent catchswitch instruction of a catchpad instruction.

This only works on llvm::CatchPadInst instructions.

@see llvm::CatchPadInst::getCatchSwitch()

llgo:link ValueRef.ParentCatchSwitch C.LLVMGetParentCatchSwitch

func (ValueRef) PersonalityFn added in v0.3.0

func (self ValueRef) PersonalityFn() ValueRef

Obtain the personality function attached to the function.

@see llvm::Function::getPersonalityFn()

llgo:link ValueRef.PersonalityFn C.LLVMGetPersonalityFn

func (ValueRef) PrefixData added in v0.3.0

func (self ValueRef) PrefixData() ValueRef

Gets the prefix data associated with a function. Only valid on functions, and only if LLVMHasPrefixData returns true. See https://llvm.org/docs/LangRef.html#prefix-data

llgo:link ValueRef.PrefixData C.LLVMGetPrefixData

func (ValueRef) PreviousFunction added in v0.3.0

func (self ValueRef) PreviousFunction() ValueRef

Decrement a Function iterator to the previous Function.

Returns NULL if the iterator was already at the beginning and there are no previous functions.

llgo:link ValueRef.PreviousFunction C.LLVMGetPreviousFunction

func (ValueRef) PreviousGlobal added in v0.3.0

func (self ValueRef) PreviousGlobal() ValueRef

llgo:link ValueRef.PreviousGlobal C.LLVMGetPreviousGlobal

func (ValueRef) PreviousGlobalAlias added in v0.3.0

func (self ValueRef) PreviousGlobalAlias() ValueRef

Decrement a GlobalAlias iterator to the previous GlobalAlias.

Returns NULL if the iterator was already at the beginning and there are no previous global aliases.

llgo:link ValueRef.PreviousGlobalAlias C.LLVMGetPreviousGlobalAlias

func (ValueRef) PreviousGlobalIFunc added in v0.3.0

func (self ValueRef) PreviousGlobalIFunc() ValueRef

Decrement a GlobalIFunc iterator to the previous GlobalIFunc.

Returns NULL if the iterator was already at the beginning and there are no previous global aliases.

llgo:link ValueRef.PreviousGlobalIFunc C.LLVMGetPreviousGlobalIFunc

func (ValueRef) PreviousInstruction added in v0.3.0

func (self ValueRef) PreviousInstruction() ValueRef

Obtain the instruction that occurred before this one.

If the instruction is the first instruction in a basic block, NULL will be returned.

llgo:link ValueRef.PreviousInstruction C.LLVMGetPreviousInstruction

func (ValueRef) PreviousParam added in v0.3.0

func (self ValueRef) PreviousParam() ValueRef

Obtain the previous parameter to a function.

This is the opposite of LLVMGetNextParam().

llgo:link ValueRef.PreviousParam C.LLVMGetPreviousParam

func (ValueRef) PrintValueToString added in v0.3.0

func (self ValueRef) PrintValueToString() *c.Char

Return a string representation of the value. Use LLVMDisposeMessage to free the string.

@see llvm::Value::print()

llgo:link ValueRef.PrintValueToString C.LLVMPrintValueToString

func (ValueRef) PrologueData added in v0.3.0

func (self ValueRef) PrologueData() ValueRef

Gets the prologue data associated with a function. Only valid on functions, and only if LLVMHasPrologueData returns true. See https://llvm.org/docs/LangRef.html#prologue-data

llgo:link ValueRef.PrologueData C.LLVMGetPrologueData

func (ValueRef) RawDataValues added in v0.3.0

func (self ValueRef) RawDataValues(SizeInBytes *c.SizeT) *c.Char

Get the raw, underlying bytes of the given constant data sequential.

This is the same as LLVMGetAsString except it works for all constant data sequentials, not just i8 arrays.

@see ConstantDataSequential::getRawDataValues()

llgo:link ValueRef.RawDataValues C.LLVMGetRawDataValues

func (ValueRef) RemoveCallSiteEnumAttribute added in v0.3.0

func (self ValueRef) RemoveCallSiteEnumAttribute(Idx AttributeIndex, KindID c.Uint)

llgo:link ValueRef.RemoveCallSiteEnumAttribute C.LLVMRemoveCallSiteEnumAttribute

func (ValueRef) RemoveCallSiteStringAttribute added in v0.3.0

func (self ValueRef) RemoveCallSiteStringAttribute(Idx AttributeIndex, K *c.Char, KLen c.Uint)

llgo:link ValueRef.RemoveCallSiteStringAttribute C.LLVMRemoveCallSiteStringAttribute

func (ValueRef) RemoveEnumAttributeAtIndex added in v0.3.0

func (self ValueRef) RemoveEnumAttributeAtIndex(Idx AttributeIndex, KindID c.Uint)

llgo:link ValueRef.RemoveEnumAttributeAtIndex C.LLVMRemoveEnumAttributeAtIndex

func (ValueRef) RemoveGlobalIFunc added in v0.3.0

func (self ValueRef) RemoveGlobalIFunc()

Remove a global indirect function from its parent module.

This unlinks the global indirect function from its containing module but keeps it alive.

@see llvm::GlobalIFunc::removeFromParent()

llgo:link ValueRef.RemoveGlobalIFunc C.LLVMRemoveGlobalIFunc

func (ValueRef) RemoveStringAttributeAtIndex added in v0.3.0

func (self ValueRef) RemoveStringAttributeAtIndex(Idx AttributeIndex, K *c.Char, KLen c.Uint)

llgo:link ValueRef.RemoveStringAttributeAtIndex C.LLVMRemoveStringAttributeAtIndex

func (ValueRef) ReplaceMDNodeOperandWith added in v0.3.0

func (self ValueRef) ReplaceMDNodeOperandWith(Index c.Uint, Replacement MetadataRef)

Replace an operand at a specific index in a llvm::MDNode value.

@see llvm::MDNode::replaceOperandWith()

llgo:link ValueRef.ReplaceMDNodeOperandWith C.LLVMReplaceMDNodeOperandWith

func (ValueRef) RunPassesOnFunction added in v0.3.0

func (self ValueRef) RunPassesOnFunction(Passes *c.Char, TM TargetMachineRef, Options PassBuilderOptionsRef) ErrorRef

Construct and run a set of passes over a function.

This function behaves the same as LLVMRunPasses, but operates on a single function instead of an entire module.

llgo:link ValueRef.RunPassesOnFunction C.LLVMRunPassesOnFunction

func (ValueRef) Section added in v0.3.0

func (self ValueRef) Section() *c.Char

llgo:link ValueRef.Section C.LLVMGetSection

func (ValueRef) SetAlignment added in v0.3.0

func (self ValueRef) SetAlignment(Bytes c.Uint)

Set the preferred alignment of the value. @see llvm::AllocaInst::setAlignment() @see llvm::LoadInst::setAlignment() @see llvm::StoreInst::setAlignment() @see llvm::AtomicRMWInst::setAlignment() @see llvm::AtomicCmpXchgInst::setAlignment() @see llvm::GlobalValue::setAlignment()

llgo:link ValueRef.SetAlignment C.LLVMSetAlignment

func (ValueRef) SetArgOperand added in v0.3.0

func (self ValueRef) SetArgOperand(i c.Uint, value ValueRef)

Set a funcletpad argument at the given index.

llgo:link ValueRef.SetArgOperand C.LLVMSetArgOperand

func (ValueRef) SetAtomicRMWBinOp added in v0.3.0

func (self ValueRef) SetAtomicRMWBinOp(BinOp AtomicRMWBinOp)

llgo:link ValueRef.SetAtomicRMWBinOp C.LLVMSetAtomicRMWBinOp

func (ValueRef) SetAtomicSingleThread added in v0.3.0

func (self ValueRef) SetAtomicSingleThread(SingleThread Bool)

llgo:link ValueRef.SetAtomicSingleThread C.LLVMSetAtomicSingleThread

func (ValueRef) SetAtomicSyncScopeID added in v0.3.0

func (self ValueRef) SetAtomicSyncScopeID(SSID c.Uint)

Sets the synchronization scope ID of an atomic instruction.

llgo:link ValueRef.SetAtomicSyncScopeID C.LLVMSetAtomicSyncScopeID

func (ValueRef) SetCleanup added in v0.3.0

func (self ValueRef) SetCleanup(Val Bool)

Set the 'cleanup' flag in the landingpad instruction

llgo:link ValueRef.SetCleanup C.LLVMSetCleanup

func (ValueRef) SetCmpXchgFailureOrdering added in v0.3.0

func (self ValueRef) SetCmpXchgFailureOrdering(Ordering AtomicOrdering)

llgo:link ValueRef.SetCmpXchgFailureOrdering C.LLVMSetCmpXchgFailureOrdering

func (ValueRef) SetCmpXchgSuccessOrdering added in v0.3.0

func (self ValueRef) SetCmpXchgSuccessOrdering(Ordering AtomicOrdering)

llgo:link ValueRef.SetCmpXchgSuccessOrdering C.LLVMSetCmpXchgSuccessOrdering

func (ValueRef) SetComdat added in v0.3.0

func (self ValueRef) SetComdat(C ComdatRef)

Assign the Comdat to the given global object.

@see llvm::GlobalObject::setComdat()

llgo:link ValueRef.SetComdat C.LLVMSetComdat

func (ValueRef) SetDLLStorageClass added in v0.3.0

func (self ValueRef) SetDLLStorageClass(Class DLLStorageClass)

llgo:link ValueRef.SetDLLStorageClass C.LLVMSetDLLStorageClass

func (ValueRef) SetExact added in v0.3.0

func (self ValueRef) SetExact(IsExact Bool)

llgo:link ValueRef.SetExact C.LLVMSetExact

func (ValueRef) SetExternallyInitialized added in v0.3.0

func (self ValueRef) SetExternallyInitialized(IsExtInit Bool)

llgo:link ValueRef.SetExternallyInitialized C.LLVMSetExternallyInitialized

func (ValueRef) SetFastMathFlags added in v0.3.0

func (self ValueRef) SetFastMathFlags(FMF FastMathFlags)

Sets the flags for which fast-math-style optimizations are allowed for this value.

Only valid on floating point instructions. @see LLVMCanValueUseFastMathFlags

llgo:link ValueRef.SetFastMathFlags C.LLVMSetFastMathFlags

func (ValueRef) SetFunctionCallConv added in v0.3.0

func (self ValueRef) SetFunctionCallConv(CC c.Uint)

Set the calling convention of a function.

@see llvm::Function::setCallingConv()

@param Fn Function to operate on @param CC LLVMCallConv to set calling convention to

llgo:link ValueRef.SetFunctionCallConv C.LLVMSetFunctionCallConv

func (ValueRef) SetGC added in v0.3.0

func (self ValueRef) SetGC(Name *c.Char)

Define the garbage collector to use during code generation.

@see llvm::Function::setGC()

llgo:link ValueRef.SetGC C.LLVMSetGC

func (ValueRef) SetGlobalConstant added in v0.3.0

func (self ValueRef) SetGlobalConstant(IsConstant Bool)

llgo:link ValueRef.SetGlobalConstant C.LLVMSetGlobalConstant

func (ValueRef) SetICmpSameSign added in v0.3.0

func (self ValueRef) SetICmpSameSign(SameSign Bool)

Set the samesign flag on an icmp instruction.

This is only valid for instructions that correspond to llvm::ICmpInst.

@see llvm::ICmpInst::setSameSign()

llgo:link ValueRef.SetICmpSameSign C.LLVMSetICmpSameSign

func (ValueRef) SetInstrParamAlignment added in v0.3.0

func (self ValueRef) SetInstrParamAlignment(Idx AttributeIndex, Align c.Uint)

llgo:link ValueRef.SetInstrParamAlignment C.LLVMSetInstrParamAlignment

func (ValueRef) SetInstructionCallConv added in v0.3.0

func (self ValueRef) SetInstructionCallConv(CC c.Uint)

Set the calling convention for a call instruction.

This expects an LLVMValueRef that corresponds to a llvm::CallInst or llvm::InvokeInst.

@see llvm::CallInst::setCallingConv() @see llvm::InvokeInst::setCallingConv()

llgo:link ValueRef.SetInstructionCallConv C.LLVMSetInstructionCallConv

func (ValueRef) SetIsDisjoint added in v0.3.0

func (self ValueRef) SetIsDisjoint(IsDisjoint Bool)

Sets the disjoint flag for the instruction. Only valid for or instructions.

llgo:link ValueRef.SetIsDisjoint C.LLVMSetIsDisjoint

func (ValueRef) SetIsInBounds added in v0.3.0

func (self ValueRef) SetIsInBounds(InBounds Bool)

Set the given GEP instruction to be inbounds or not.

llgo:link ValueRef.SetIsInBounds C.LLVMSetIsInBounds

func (ValueRef) SetLinkage added in v0.3.0

func (self ValueRef) SetLinkage(Linkage Linkage)

llgo:link ValueRef.SetLinkage C.LLVMSetLinkage

func (ValueRef) SetMetadata added in v0.3.0

func (self ValueRef) SetMetadata(KindID c.Uint, Node ValueRef)

Set metadata associated with an instruction value.

llgo:link ValueRef.SetMetadata C.LLVMSetMetadata

func (ValueRef) SetNNeg added in v0.3.0

func (self ValueRef) SetNNeg(IsNonNeg Bool)

Sets the non-negative flag for the instruction. Only valid for zext instructions.

llgo:link ValueRef.SetNNeg C.LLVMSetNNeg

func (ValueRef) SetNSW added in v0.3.0

func (self ValueRef) SetNSW(HasNSW Bool)

llgo:link ValueRef.SetNSW C.LLVMSetNSW

func (ValueRef) SetNUW added in v0.3.0

func (self ValueRef) SetNUW(HasNUW Bool)

llgo:link ValueRef.SetNUW C.LLVMSetNUW

func (ValueRef) SetNormalDest added in v0.3.0

func (self ValueRef) SetNormalDest(B BasicBlockRef)

Set the normal destination basic block.

This only works on llvm::InvokeInst instructions.

@see llvm::InvokeInst::setNormalDest()

llgo:link ValueRef.SetNormalDest C.LLVMSetNormalDest

func (ValueRef) SetOperand added in v0.3.0

func (self ValueRef) SetOperand(Index c.Uint, Val ValueRef)

Set an operand at a specific index in a llvm::User value.

@see llvm::User::setOperand()

llgo:link ValueRef.SetOperand C.LLVMSetOperand

func (ValueRef) SetOrdering added in v0.3.0

func (self ValueRef) SetOrdering(Ordering AtomicOrdering)

llgo:link ValueRef.SetOrdering C.LLVMSetOrdering

func (ValueRef) SetParamAlignment added in v0.3.0

func (self ValueRef) SetParamAlignment(Align c.Uint)

Set the alignment for a function parameter.

@see llvm::Argument::addAttr() @see llvm::AttrBuilder::addAlignmentAttr()

llgo:link ValueRef.SetParamAlignment C.LLVMSetParamAlignment

func (ValueRef) SetSection added in v0.3.0

func (self ValueRef) SetSection(Section *c.Char)

llgo:link ValueRef.SetSection C.LLVMSetSection

func (ValueRef) SetSubprogram added in v0.3.0

func (self ValueRef) SetSubprogram(SP MetadataRef)

Set the subprogram attached to a function.

@see llvm::Function::setSubprogram()

llgo:link ValueRef.SetSubprogram C.LLVMSetSubprogram

func (ValueRef) SetSuccessor added in v0.3.0

func (self ValueRef) SetSuccessor(i c.Uint, block BasicBlockRef)

Update the specified successor to point at the provided block.

@see llvm::Instruction::setSuccessor

llgo:link ValueRef.SetSuccessor C.LLVMSetSuccessor

func (ValueRef) SetSwitchCase added in v0.3.1

func (self ValueRef) SetSwitchCase(i c.Uint, CaseValue ValueRef)

Set the case value for a successor of a switch instruction. i corresponds to the successor index. The first successor is the default destination, so i must be greater than zero.

This only works on llvm::SwitchInst instructions.

@see llvm::SwitchInst::CaseHandle::setValue()

llgo:link ValueRef.SetSwitchCase C.LLVMSetSwitchCaseValue

func (ValueRef) SetTailCall added in v0.3.0

func (self ValueRef) SetTailCall(IsTailCall Bool)

Set whether a call instruction is a tail call.

This only works on llvm::CallInst instructions.

@see llvm::CallInst::setTailCall()

llgo:link ValueRef.SetTailCall C.LLVMSetTailCall

func (ValueRef) SetTailCallKind added in v0.3.0

func (self ValueRef) SetTailCallKind(kind TailCallKind)

Set the call kind of the call instruction.

@see llvm::CallInst::getTailCallKind()

llgo:link ValueRef.SetTailCallKind C.LLVMSetTailCallKind

func (ValueRef) SetThreadLocal added in v0.3.0

func (self ValueRef) SetThreadLocal(IsThreadLocal Bool)

llgo:link ValueRef.SetThreadLocal C.LLVMSetThreadLocal

func (ValueRef) SetThreadLocalMode added in v0.3.0

func (self ValueRef) SetThreadLocalMode(Mode ThreadLocalMode)

llgo:link ValueRef.SetThreadLocalMode C.LLVMSetThreadLocalMode

func (ValueRef) SetUnnamedAddr deprecated added in v0.3.0

func (self ValueRef) SetUnnamedAddr(HasUnnamedAddr Bool)

Deprecated: Use LLVMSetUnnamedAddress instead.

llgo:link ValueRef.SetUnnamedAddr C.LLVMSetUnnamedAddr

func (ValueRef) SetUnnamedAddress added in v0.3.0

func (self ValueRef) SetUnnamedAddress(UnnamedAddr UnnamedAddr)

llgo:link ValueRef.SetUnnamedAddress C.LLVMSetUnnamedAddress

func (ValueRef) SetUnwindDest added in v0.3.0

func (self ValueRef) SetUnwindDest(B BasicBlockRef)

Set the unwind destination basic block.

Works on llvm::InvokeInst, llvm::CleanupReturnInst, and llvm::CatchSwitchInst instructions.

@see llvm::InvokeInst::setUnwindDest() @see llvm::CleanupReturnInst::setUnwindDest() @see llvm::CatchSwitchInst::setUnwindDest()

llgo:link ValueRef.SetUnwindDest C.LLVMSetUnwindDest

func (ValueRef) SetValueName deprecated added in v0.3.0

func (self ValueRef) SetValueName(Name *c.Char)

Deprecated: Use LLVMSetValueName2 instead.

llgo:link ValueRef.SetValueName C.LLVMSetValueName

func (ValueRef) SetValueName2 added in v0.3.0

func (self ValueRef) SetValueName2(Name *c.Char, NameLen c.SizeT)

Set the string name of a value.

@see llvm::Value::setName()

llgo:link ValueRef.SetValueName2 C.LLVMSetValueName2

func (ValueRef) SetVisibility added in v0.3.0

func (self ValueRef) SetVisibility(Viz Visibility)

llgo:link ValueRef.SetVisibility C.LLVMSetVisibility

func (ValueRef) SetVolatile added in v0.3.0

func (self ValueRef) SetVolatile(IsVolatile Bool)

llgo:link ValueRef.SetVolatile C.LLVMSetVolatile

func (ValueRef) SetWeak added in v0.3.0

func (self ValueRef) SetWeak(IsWeak Bool)

llgo:link ValueRef.SetWeak C.LLVMSetWeak

func (ValueRef) StringAttributeAtIndex added in v0.3.0

func (self ValueRef) StringAttributeAtIndex(Idx AttributeIndex, K *c.Char, KLen c.Uint) AttributeRef

llgo:link ValueRef.StringAttributeAtIndex C.LLVMGetStringAttributeAtIndex

func (ValueRef) Subprogram added in v0.3.0

func (self ValueRef) Subprogram() MetadataRef

Get the metadata of the subprogram attached to a function.

@see llvm::Function::getSubprogram()

llgo:link ValueRef.Subprogram C.LLVMGetSubprogram

func (ValueRef) Successor added in v0.3.0

func (self ValueRef) Successor(i c.Uint) BasicBlockRef

Return the specified successor.

@see llvm::Instruction::getSuccessor

llgo:link ValueRef.Successor C.LLVMGetSuccessor

func (ValueRef) SwitchCase added in v0.3.1

func (self ValueRef) SwitchCase(i c.Uint) ValueRef

Obtain the case value for a successor of a switch instruction. i corresponds to the successor index. The first successor is the default destination, so i must be greater than zero.

This only works on llvm::SwitchInst instructions.

@see llvm::SwitchInst::CaseHandle::getCaseValue()

llgo:link ValueRef.SwitchCase C.LLVMGetSwitchCaseValue

func (ValueRef) SwitchDefaultDest added in v0.3.0

func (self ValueRef) SwitchDefaultDest() BasicBlockRef

Obtain the default destination basic block of a switch instruction.

This only works on llvm::SwitchInst instructions.

@see llvm::SwitchInst::getDefaultDest()

llgo:link ValueRef.SwitchDefaultDest C.LLVMGetSwitchDefaultDest

func (ValueRef) TailCallKind added in v0.3.0

func (self ValueRef) TailCallKind() TailCallKind

Obtain a tail call kind of the call instruction.

@see llvm::CallInst::setTailCallKind()

llgo:link ValueRef.TailCallKind C.LLVMGetTailCallKind

func (ValueRef) ThreadLocalMode added in v0.3.0

func (self ValueRef) ThreadLocalMode() ThreadLocalMode

llgo:link ValueRef.ThreadLocalMode C.LLVMGetThreadLocalMode

func (ValueRef) TypeOf added in v0.3.0

func (self ValueRef) TypeOf() TypeRef

Obtain the type of a value.

@see llvm::Value::getType()

llgo:link ValueRef.TypeOf C.LLVMTypeOf

func (ValueRef) UnnamedAddress added in v0.3.0

func (self ValueRef) UnnamedAddress() UnnamedAddr

llgo:link ValueRef.UnnamedAddress C.LLVMGetUnnamedAddress

func (ValueRef) UnwindDest added in v0.3.0

func (self ValueRef) UnwindDest() BasicBlockRef

Return the unwind destination basic block.

Works on llvm::InvokeInst, llvm::CleanupReturnInst, and llvm::CatchSwitchInst instructions.

@see llvm::InvokeInst::getUnwindDest() @see llvm::CleanupReturnInst::getUnwindDest() @see llvm::CatchSwitchInst::getUnwindDest()

llgo:link ValueRef.UnwindDest C.LLVMGetUnwindDest

func (ValueRef) VerifyFunction added in v0.3.0

func (self ValueRef) VerifyFunction(Action VerifierFailureAction) Bool

Verifies that a single function is valid, taking the specified action. Useful for debugging.

llgo:link ValueRef.VerifyFunction C.LLVMVerifyFunction

func (ValueRef) ViewFunctionCFG added in v0.3.0

func (self ValueRef) ViewFunctionCFG()

Open up a ghostview window that displays the CFG of the current function. Useful for debugging.

llgo:link ValueRef.ViewFunctionCFG C.LLVMViewFunctionCFG

func (ValueRef) ViewFunctionCFGOnly added in v0.3.0

func (self ValueRef) ViewFunctionCFGOnly()

llgo:link ValueRef.ViewFunctionCFGOnly C.LLVMViewFunctionCFGOnly

func (ValueRef) Visibility added in v0.3.0

func (self ValueRef) Visibility() Visibility

llgo:link ValueRef.Visibility C.LLVMGetVisibility

func (ValueRef) Volatile added in v0.3.0

func (self ValueRef) Volatile() Bool

llgo:link ValueRef.Volatile C.LLVMGetVolatile

func (ValueRef) Weak added in v0.3.0

func (self ValueRef) Weak() Bool

llgo:link ValueRef.Weak C.LLVMGetWeak

type VerifierFailureAction

type VerifierFailureAction c.Uint
const (
	AbortProcessAction VerifierFailureAction = 0
	PrintMessageAction VerifierFailureAction = 1
	// verifier will just return 1
	ReturnStatusAction VerifierFailureAction = 2
)

type Visibility

type Visibility c.Uint
const (
	DefaultVisibility Visibility = 0
	HiddenVisibility  Visibility = 1
	// < The GV is protected
	ProtectedVisibility Visibility = 2
)

type YieldCallback

type YieldCallback = func(_llcppg_param1 ContextRef, _llcppg_param2 unsafe.Pointer)

llgo:type C

Jump to

Keyboard shortcuts

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