Documentation ¶
Index ¶
- Constants
- Variables
- func InitializeAllAsmParsers()
- func InitializeAllAsmPrinters()
- func InitializeAllDisassemblers()
- func InitializeAllTargetInfos()
- func InitializeAllTargetMCs()
- func InitializeAllTargets()
- func InitializeAsmParser(arch Arch) error
- func InitializeAsmPrinter(arch Arch) error
- func InitializeDisassembler(arch Arch) error
- func InitializeNativeAsmParser() error
- func InitializeNativeAsmPrinter() error
- func InitializeNativeDisassembler() error
- func InitializeNativeTarget() error
- func InitializeTarget(arch Arch) error
- func InitializeTargetInfo(arch Arch) error
- func InitializeTargetMC(arch Arch) error
- type Add
- type AggregateType
- type Alloca
- type And
- type Arch
- type Array
- type ArrayType
- type BitCast
- type Block
- type Br
- type Builder
- func (b Builder) CreateAShr(name string, l, r Value) Shr
- func (b Builder) CreateAlloca(name string, t Type) Alloca
- func (b Builder) CreateAllocaWithSize(name string, t Type, size Value) Alloca
- func (b Builder) CreateAnd(name string, l, r Value) And
- func (b Builder) CreateBitCast(name string, from Value, to Type) BitCast
- func (b Builder) CreateBr(block Block) Br
- func (b Builder) CreateCall(name string, ft Type, fn Value, args ...Value) Call
- func (b Builder) CreateCatchPad(name string, parentPad Value, arg ...Value) CatchPad
- func (b Builder) CreateCatchRet(catchPad Value, bb Block) CatchRet
- func (b Builder) CreateCatchSwitch(name string, parentPad Value, unwindBB Block, numHandlers uint32) CatchSwitch
- func (b Builder) CreateCleanupPad(name string, parentPad Value, arg ...Value) CleanupPad
- func (b Builder) CreateCleanupRet(catchPad Value, bb Block) CleanupRet
- func (b Builder) CreateCondBr(cond Value, tblock, fblock Block) Br
- func (b Builder) CreateExtractElement(name string, vec, index Value) ExtractElement
- func (b Builder) CreateExtractValue(name string, vec Value, index uint) ExtractValue
- func (b Builder) CreateFAdd(name string, l, r Value) Add
- func (b Builder) CreateFDiv(name string, l, r Value) Div
- func (b Builder) CreateFMul(name string, l, r Value) Mul
- func (b Builder) CreateFNeg(name string, v Value) Neg
- func (b Builder) CreateFPExt(name string, from Value, to FloatType) Expand
- func (b Builder) CreateFPToSI(name string, from Value, to IntegerType) FloatToInt
- func (b Builder) CreateFPToUI(name string, from Value, to IntegerType) FloatToInt
- func (b Builder) CreateFPTrunc(name string, from Value, to FloatType) Trunc
- func (b Builder) CreateFRem(name string, l, r Value) Rem
- func (b Builder) CreateFSub(name string, l, r Value) Sub
- func (b Builder) CreateFloatCmp(name string, op FloatPredicate, l, r Value) FloatCmp
- func (b Builder) CreateFree(p Value) Call
- func (b Builder) CreateGEP(name string, t Type, from Value, indices ...Value) GetElementPtr
- func (b Builder) CreateInBoundsGEP(name string, t Type, from Value, indices ...Value) GetElementPtr
- func (b Builder) CreateIntCmp(name string, op IntPredicate, l, r Value) IntCmp
- func (b Builder) CreateIntToPtr(name string, from Value, to PointerType) IntToPtr
- func (b Builder) CreateInvoke(name string, ft Type, then, catch Block, fn Value, args ...Value) Invoke
- func (b Builder) CreateLShr(name string, l, r Value) Shr
- func (b Builder) CreateLandingPad(name string, t Type, f Value, numClauses uint32) LandingPad
- func (b Builder) CreateLoad(name string, t Type, p Value) Load
- func (b Builder) CreateMalloc(name string, t Type) Call
- func (b Builder) CreateMallocWithSize(t Type, size Value, name string) Call
- func (b Builder) CreateMemCpy(dst Value, dstAlign32 uint32, src Value, srcAlign uint32, size Value) Call
- func (b Builder) CreateMemMove(dst Value, dstAlign32 uint32, src Value, srcAlign uint32, size Value) Call
- func (b Builder) CreateMemSet(ptr, value, length Value, align uint32) Call
- func (b Builder) CreateNot(name string, v Value) Not
- func (b Builder) CreateOr(name string, l, r Value) Or
- func (b Builder) CreatePHI(name string, t Type, incomings ...) PHI
- func (b Builder) CreatePtrToInt(name string, from Value, to IntegerType) PtrToInt
- func (b Builder) CreateResume(v *Value) Resume
- func (b Builder) CreateRet(v *Value) Return
- func (b Builder) CreateSAdd(name string, l, r Value) Add
- func (b Builder) CreateSDiv(name string, l, r Value) Div
- func (b Builder) CreateSExt(name string, from Value, to IntegerType) Expand
- func (b Builder) CreateSIToFP(name string, from Value, to FloatType) IntToFloat
- func (b Builder) CreateSMul(name string, l, r Value) Mul
- func (b Builder) CreateSNeg(name string, v Value) Neg
- func (b Builder) CreateSRem(name string, l, r Value) Rem
- func (b Builder) CreateSSub(name string, l, r Value) Sub
- func (b Builder) CreateSelect(name string, cond Value, trueValue, falseValue Value) Select
- func (b Builder) CreateShl(name string, l, r Value) Shl
- func (b Builder) CreateStore(from, to Value) Store
- func (b Builder) CreateStructGEP(name string, t Type, from Value, i uint) GetElementPtr
- func (b Builder) CreateSwitch(v Value, defaultBlock Block, conds ...) Switch
- func (b Builder) CreateTrunc(name string, from Value, to IntegerType) Trunc
- func (b Builder) CreateUAdd(name string, l, r Value) Add
- func (b Builder) CreateUDiv(name string, l, r Value) Div
- func (b Builder) CreateUIToFP(name string, from Value, to FloatType) IntToFloat
- func (b Builder) CreateUMul(name string, l, r Value) Mul
- func (b Builder) CreateUNeg(name string, v Value) Neg
- func (b Builder) CreateURem(name string, l, r Value) Rem
- func (b Builder) CreateUSub(name string, l, r Value) Sub
- func (b Builder) CreateUnreachable() Unreachable
- func (b Builder) CreateXor(name string, l, r Value) Xor
- func (b Builder) CreateZExt(name string, from Value, to IntegerType) Expand
- func (b Builder) CurrentBlock() Block
- func (b Builder) Free()
- func (b Builder) MoveToAfter(block Block)
- type Call
- type CatchPad
- type CatchRet
- type CatchSwitch
- type CleanupPad
- type CleanupRet
- type CodeModel
- type CodeOptLevel
- type Constant
- type Context
- func (ctx Context) ArrayType(elem Type, cap uint32) ArrayType
- func (ctx Context) ConstAggregateZero(t AggregateType) Constant
- func (ctx Context) ConstArray(et Type, elem ...Constant) Array
- func (ctx Context) ConstExtractElement(v, index Constant) Constant
- func (ctx Context) ConstFloat(t FloatType, v float64) Float
- func (ctx Context) ConstFloatFromString(t FloatType, s string) Float
- func (ctx Context) ConstGEP(t Type, v Constant, indice ...Constant) Constant
- func (ctx Context) ConstInBoundsGEP(t Type, v Constant, indice ...Constant) Constant
- func (ctx Context) ConstInteger(t IntegerType, v int64) Integer
- func (ctx Context) ConstIntegerFromString(t IntegerType, s string, radix uint8) Integer
- func (ctx Context) ConstNamedStruct(t StructType, elem ...Constant) Struct
- func (ctx Context) ConstNull(t Type) Constant
- func (ctx Context) ConstPointer(t Type) Pointer
- func (ctx Context) ConstString(s string) Array
- func (ctx Context) ConstStruct(packed bool, elem ...Constant) Struct
- func (ctx Context) FloatType(kind FloatTypeKind) FloatType
- func (ctx Context) Free()
- func (ctx Context) FunctionType(isVarArg bool, ret Type, param ...Type) FunctionType
- func (ctx Context) GetTypeByName(name string) *StructType
- func (ctx Context) IntPtrType(t *Target) IntegerType
- func (ctx Context) IntegerType(bits uint32) IntegerType
- func (ctx Context) NamedStructType(name string, packed bool, elems ...Type) StructType
- func (ctx Context) NewBuilder() Builder
- func (ctx Context) NewModule(name string) Module
- func (ctx Context) OpaquePointerType() PointerType
- func (ctx Context) PointerType(elem Type) PointerType
- func (ctx Context) StructType(packed bool, elems ...Type) StructType
- func (ctx Context) VoidType() VoidType
- type Div
- type ExecutionEngine
- func (engine ExecutionEngine) Free()
- func (engine ExecutionEngine) GetFunction(name string) (Function, bool)
- func (engine ExecutionEngine) GetFunctionRuntimePointer(f Function) (unsafe.Pointer, bool)
- func (engine ExecutionEngine) GetVariable(name string) (GlobalValue, bool)
- func (engine ExecutionEngine) GetVariableRuntimePointer(v GlobalValue) (unsafe.Pointer, bool)
- func (engine ExecutionEngine) MapFunctionToGo(name string, to any) error
- func (engine ExecutionEngine) MapGlobalToC(name string, to unsafe.Pointer) error
- func (engine ExecutionEngine) RunFunction(f Function, args ...ExecutionValue) ExecutionValue
- func (engine ExecutionEngine) RunMainFunction(f Function, argv, envp []string) uint8
- func (engine ExecutionEngine) RunMainFunctionWithParentEnv(f Function) uint8
- type ExecutionValue
- type Expand
- type ExtractElement
- type ExtractValue
- type Float
- type FloatCmp
- type FloatPredicate
- type FloatToInt
- type FloatType
- type FloatTypeKind
- type FuncAttribute
- type Function
- func (f Function) AddAttribute(attr FuncAttribute, attrValue ...uint)
- func (f Function) Blocks() []Block
- func (f Function) CountParams() uint
- func (f Function) EntryBlock() Block
- func (f Function) FirstBlock() Block
- func (f Function) FirstParam() Param
- func (f Function) FunctionType() FunctionType
- func (f Function) GetParam(i uint) Param
- func (f Function) LastBlock() Block
- func (f Function) LastParam() Param
- func (g Function) Linkage() Linkage
- func (c Function) Name() string
- func (f Function) NewBlock(name string) Block
- func (f Function) Params() []Param
- func (g Function) SetLinkage(linkage Linkage)
- func (c Function) SetName(name string)
- func (c Function) String() string
- func (c Function) Type() Type
- func (f Function) Verify() bool
- func (f Function) VerifyWithCFG(only bool)
- type FunctionType
- type GetElementPtr
- type Global
- type GlobalValue
- func (g GlobalValue) GetAlign() uint32
- func (g GlobalValue) GetInitializer() (Constant, bool)
- func (g GlobalValue) IsDeclaration() bool
- func (g GlobalValue) IsExternallyInitialized() bool
- func (g GlobalValue) IsGlobalConstant() bool
- func (g GlobalValue) IsThreadLocal() bool
- func (g GlobalValue) Linkage() Linkage
- func (g GlobalValue) SetAlign(align uint32)
- func (g GlobalValue) SetExternallyInitialized(isConstant bool)
- func (g GlobalValue) SetGlobalConstant(isConstant bool)
- func (g GlobalValue) SetInitializer(v Constant)
- func (g GlobalValue) SetLinkage(linkage Linkage)
- func (g GlobalValue) SetThreadLocal(isThreadLocal bool)
- func (g GlobalValue) SetThreadLocalMode(mode ThreadLocalMode)
- func (g GlobalValue) SetUnnamedAddress(unnamedAddr UnnamedAddr)
- func (g GlobalValue) SetVisibility(visibility Visibility)
- func (v GlobalValue) String() string
- func (g GlobalValue) ThreadLocalMode() ThreadLocalMode
- func (v GlobalValue) Type() Type
- func (g GlobalValue) UnnamedAddress() UnnamedAddr
- func (g GlobalValue) ValueType() Type
- func (g GlobalValue) Visibility() Visibility
- type Instruction
- type IntCmp
- type IntPredicate
- type IntToFloat
- type IntToPtr
- type Integer
- type IntegerType
- type Invoke
- type LandingPad
- type Linkage
- type Load
- type Module
- func (m Module) AddConstructor(prior uint16, f Function)
- func (m Module) AddDestructor(prior uint16, f Function)
- func (m Module) Clone() Module
- func (m Module) Context() Context
- func (m Module) DelGlobal(g GlobalValue)
- func (m Module) Free()
- func (m Module) GetFunction(name string) (Function, bool)
- func (m Module) GetGlobal(name string) (GlobalValue, bool)
- func (m Module) GetSource() string
- func (m Module) GetTarget() (*Target, bool)
- func (m Module) NewFunction(name string, t FunctionType) Function
- func (m Module) NewGlobal(name string, t Type) GlobalValue
- func (m Module) RunPasses(target *Target, option PassOption, pass ...string) error
- func (m Module) SetSource(source string)
- func (m *Module) SetTarget(t *Target)
- func (m Module) String() string
- func (m Module) Verify() error
- type Mul
- type Neg
- type Not
- type Or
- type PHI
- type Param
- type PassOption
- func (o PassOption) Free()
- func (o PassOption) SetCallGraphProfile(v bool)
- func (o PassOption) SetDebugLogging(v bool)
- func (o PassOption) SetForgetAllSCEVInLoopUnroll(v bool)
- func (o PassOption) SetLicmMssaNoAccForPromotionCap(v uint32)
- func (o PassOption) SetLicmMssaOptCap(v uint32)
- func (o PassOption) SetLoopInterleaving(v bool)
- func (o PassOption) SetLoopUnrolling(v bool)
- func (o PassOption) SetLoopVectorization(v bool)
- func (o PassOption) SetMergeFunctions(v bool)
- func (o PassOption) SetSLPVectorization(v bool)
- func (o PassOption) SetVerifyEach(v bool)
- type Pointer
- type PointerType
- type PtrToInt
- type RelocMode
- type Rem
- type Resume
- type Return
- type Select
- type Shl
- type Shr
- type Store
- type Struct
- type StructType
- func (t StructType) Context() Context
- func (t StructType) CountElems() uint32
- func (t StructType) Elems() []Type
- func (t StructType) GetElem(i uint32) Type
- func (t StructType) IsOpaque() bool
- func (t StructType) IsPacked() bool
- func (t StructType) IsSized() bool
- func (t StructType) Name() string
- func (t StructType) SetElems(packed bool, elems ...Type)
- func (t StructType) String() string
- type Sub
- type Switch
- type Target
- func (t Target) CPU() string
- func (t Target) Description() string
- func (t Target) Feature() string
- func (t Target) Free()
- func (d Target) GetABIAlignOfType(t Type) uint
- func (d Target) GetABISizeOfType(t Type) uint
- func (d Target) GetCallFrameAlignOfType(t Type) uint
- func (d Target) GetOffsetOfElem(st StructType, i uint) uint
- func (d Target) GetPrefAlignOfGlobal(g GlobalValue) uint
- func (d Target) GetPrefAlignOfType(t Type) uint
- func (d Target) GetSizeOfType(t Type) uint
- func (d Target) GetStoreSizeOfType(t Type) uint
- func (t Target) HasAsmBackend() bool
- func (t Target) HasJIT() bool
- func (t Target) HasTargetMachine() bool
- func (t Target) IsDarwin() bool
- func (t Target) IsLinux() bool
- func (t Target) IsWindows() bool
- func (t Target) Name() string
- func (d Target) PointerSize() uint
- func (t Target) String() string
- func (t Target) Triple() string
- func (t Target) WriteASMToFile(m Module, file string, opt CodeOptLevel, reloc RelocMode, code CodeModel) error
- func (t Target) WriteOBJToFile(m Module, file string, opt CodeOptLevel, reloc RelocMode, code CodeModel) error
- type Terminator
- type ThreadLocalMode
- type Trunc
- type Type
- type UnnamedAddr
- type Unreachable
- type Value
- type Visibility
- type VoidType
- type Xor
Constants ¶
View Source
const ( ExternalLinkage = Linkage(binding.LLVMExternalLinkage) AvailableExternallyLinkage = Linkage(binding.LLVMAvailableExternallyLinkage) LinkOnceAnyLinkage = Linkage(binding.LLVMLinkOnceAnyLinkage) LinkOnceODRLinkage = Linkage(binding.LLVMLinkOnceODRLinkage) LinkOnceODRAutoHideLinkage = Linkage(binding.LLVMLinkOnceODRAutoHideLinkage) WeakAnyLinkage = Linkage(binding.LLVMWeakAnyLinkage) WeakODRLinkage = Linkage(binding.LLVMWeakODRLinkage) AppendingLinkage = Linkage(binding.LLVMAppendingLinkage) InternalLinkage = Linkage(binding.LLVMInternalLinkage) PrivateLinkage = Linkage(binding.LLVMPrivateLinkage) DLLImportLinkage = Linkage(binding.LLVMDLLImportLinkage) DLLExportLinkage = Linkage(binding.LLVMDLLExportLinkage) ExternalWeakLinkage = Linkage(binding.LLVMExternalWeakLinkage) GhostLinkage = Linkage(binding.LLVMGhostLinkage) CommonLinkage = Linkage(binding.LLVMCommonLinkage) LinkerPrivateLinkage = Linkage(binding.LLVMLinkerPrivateLinkage) LinkerPrivateWeakLinkage = Linkage(binding.LLVMLinkerPrivateWeakLinkage) )
View Source
const ( DefaultVisibility = Visibility(binding.LLVMDefaultVisibility) HiddenVisibility = Visibility(binding.LLVMHiddenVisibility) ProtectedVisibility = Visibility(binding.LLVMProtectedVisibility) )
View Source
const ( NoUnnamedAddr = UnnamedAddr(binding.LLVMNoUnnamedAddr) LocalUnnamedAddr = UnnamedAddr(binding.LLVMLocalUnnamedAddr) GlobalUnnamedAddr = UnnamedAddr(binding.LLVMGlobalUnnamedAddr) )
View Source
const ( NotThreadLocal = ThreadLocalMode(binding.LLVMNotThreadLocal) GeneralDynamicTLSModel = ThreadLocalMode(binding.LLVMGeneralDynamicTLSModel) LocalDynamicTLSModel = ThreadLocalMode(binding.LLVMLocalDynamicTLSModel) InitialExecTLSModel = ThreadLocalMode(binding.LLVMInitialExecTLSModel) LocalExecTLSModel = ThreadLocalMode(binding.LLVMLocalExecTLSModel) )
View Source
const ( IntEQ = IntPredicate(binding.LLVMIntEQ) IntNE = IntPredicate(binding.LLVMIntNE) IntUGT = IntPredicate(binding.LLVMIntUGT) IntUGE = IntPredicate(binding.LLVMIntUGE) IntULT = IntPredicate(binding.LLVMIntULT) IntULE = IntPredicate(binding.LLVMIntULE) IntSGT = IntPredicate(binding.LLVMIntSGT) IntSGE = IntPredicate(binding.LLVMIntSGE) IntSLT = IntPredicate(binding.LLVMIntSLT) IntSLE = IntPredicate(binding.LLVMIntSLE) )
View Source
const ( FloatOEQ = FloatPredicate(binding.LLVMRealOEQ) FloatOGT = FloatPredicate(binding.LLVMRealOGT) FloatOGE = FloatPredicate(binding.LLVMRealOGE) FloatOLT = FloatPredicate(binding.LLVMRealOLT) FloatOLE = FloatPredicate(binding.LLVMRealOLE) FloatONE = FloatPredicate(binding.LLVMRealONE) FloatORD = FloatPredicate(binding.LLVMRealORD) FloatUNO = FloatPredicate(binding.LLVMRealUNO) FloatUEQ = FloatPredicate(binding.LLVMRealUEQ) FloatUGT = FloatPredicate(binding.LLVMRealUGT) FloatUGE = FloatPredicate(binding.LLVMRealUGE) FloatULT = FloatPredicate(binding.LLVMRealULT) FloatULE = FloatPredicate(binding.LLVMRealULE) FloatUNE = FloatPredicate(binding.LLVMRealUNE) )
View Source
const ( CodeOptLevelNone = CodeOptLevel(binding.LLVMCodeGenLevelNone) CodeOptLevelLess = CodeOptLevel(binding.LLVMCodeGenLevelLess) CodeOptLevelDefault = CodeOptLevel(binding.LLVMCodeGenLevelDefault) CodeOptLevelAggressive = CodeOptLevel(binding.LLVMCodeGenLevelAggressive) )
View Source
const ( RelocModeDefault = RelocMode(binding.LLVMRelocDefault) RelocModeStatic = RelocMode(binding.LLVMRelocStatic) RelocModePIC = RelocMode(binding.LLVMRelocPIC) RelocModeDynamicNoPic = RelocMode(binding.LLVMRelocDynamicNoPic) RelocModeROPI = RelocMode(binding.LLVMRelocROPI) RelocModeRWPI = RelocMode(binding.LLVMRelocRWPI) RelocModeROPI_RWPI = RelocMode(binding.LLVMRelocROPI_RWPI) )
View Source
const ( CodeModelDefault = CodeModel(binding.LLVMCodeModelDefault) CodeModelJITDefault = CodeModel(binding.LLVMCodeModelJITDefault) CodeModelTiny = CodeModel(binding.LLVMCodeModelTiny) CodeModelSmall = CodeModel(binding.LLVMCodeModelSmall) CodeModelKernel = CodeModel(binding.LLVMCodeModelKernel) CodeModelMedium = CodeModel(binding.LLVMCodeModelMedium) CodeModelLarge = CodeModel(binding.LLVMCodeModelLarge) )
View Source
const ( FloatTypeKindHalf = FloatTypeKind(binding.LLVMHalfTypeKind) FloatTypeKindBFloat = FloatTypeKind(binding.LLVMBFloatTypeKind) FloatTypeKindFloat = FloatTypeKind(binding.LLVMFloatTypeKind) FloatTypeKindDouble = FloatTypeKind(binding.LLVMDoubleTypeKind) FloatTypeKindX86FP80 = FloatTypeKind(binding.LLVMX86_FP80TypeKind) FloatTypeKindFP128 = FloatTypeKind(binding.LLVMFP128TypeKind) FloatTypeKindPPCFP128 = FloatTypeKind(binding.LLVMPPC_FP128TypeKind) )
View Source
const MajorVersion = binding.LLVM_VERSION_MAJOR
MajorVersion LLVM大版本号
View Source
const TargetTriple = binding.LLVM_DEFAULT_TARGET_TRIPLE
View Source
const Version = binding.LLVM_VERSION_STRING
Version LLVM版本号
Variables ¶
View Source
var ( // CPUName cpu名称 CPUName = binding.LLVMGetHostCPUName() // CPUFeatures cpu特性 CPUFeatures = binding.LLVMGetHostCPUFeatures() // PointerSize 指针大小(字节) PointerSize = unsafe.Sizeof(uintptr(0)) )
View Source
var ErrUnknownArch = errors.New("unknown arch")
ErrUnknownArch 未知的架构
Functions ¶
func InitializeAllAsmParsers ¶
func InitializeAllAsmParsers()
func InitializeAllAsmPrinters ¶
func InitializeAllAsmPrinters()
func InitializeAllDisassemblers ¶
func InitializeAllDisassemblers()
func InitializeAllTargetInfos ¶
func InitializeAllTargetInfos()
func InitializeAllTargetMCs ¶
func InitializeAllTargetMCs()
func InitializeAllTargets ¶
func InitializeAllTargets()
func InitializeAsmPrinter ¶
InitializeAsmPrinter 初始化汇编输出器
func InitializeDisassembler ¶
InitializeDisassembler 初始化目标反汇编器
func InitializeNativeAsmParser ¶
func InitializeNativeAsmParser() error
func InitializeNativeAsmPrinter ¶
func InitializeNativeAsmPrinter() error
func InitializeNativeDisassembler ¶
func InitializeNativeDisassembler() error
func InitializeNativeTarget ¶
func InitializeNativeTarget() error
Types ¶
type Add ¶
type Add binding.LLVMValueRef
type AggregateType ¶
type AggregateType interface { Type // contains filtered or unexported methods }
type Alloca ¶
type Alloca binding.LLVMValueRef
type And ¶
type And binding.LLVMValueRef
type Array ¶
type Array binding.LLVMValueRef
type ArrayType ¶
type ArrayType binding.LLVMTypeRef
type BitCast ¶
type BitCast binding.LLVMValueRef
type Block ¶
type Block binding.LLVMBasicBlockRef
func (Block) GetTerminator ¶
func (b Block) GetTerminator() Terminator
func (Block) IsTerminating ¶
type Builder ¶
type Builder binding.LLVMBuilderRef
func (Builder) CreateAllocaWithSize ¶
func (Builder) CreateBitCast ¶
func (Builder) CreateCall ¶
func (Builder) CreateCatchPad ¶
func (Builder) CreateCatchSwitch ¶
func (Builder) CreateCleanupPad ¶
func (b Builder) CreateCleanupPad(name string, parentPad Value, arg ...Value) CleanupPad
func (Builder) CreateCleanupRet ¶
func (b Builder) CreateCleanupRet(catchPad Value, bb Block) CleanupRet
func (Builder) CreateExtractElement ¶
func (b Builder) CreateExtractElement(name string, vec, index Value) ExtractElement
func (Builder) CreateExtractValue ¶
func (b Builder) CreateExtractValue(name string, vec Value, index uint) ExtractValue
func (Builder) CreateFPExt ¶
func (Builder) CreateFPToSI ¶
func (b Builder) CreateFPToSI(name string, from Value, to IntegerType) FloatToInt
func (Builder) CreateFPToUI ¶
func (b Builder) CreateFPToUI(name string, from Value, to IntegerType) FloatToInt
func (Builder) CreateFPTrunc ¶
func (Builder) CreateFloatCmp ¶
func (b Builder) CreateFloatCmp(name string, op FloatPredicate, l, r Value) FloatCmp
func (Builder) CreateFree ¶
func (Builder) CreateInBoundsGEP ¶
func (Builder) CreateIntCmp ¶
func (b Builder) CreateIntCmp(name string, op IntPredicate, l, r Value) IntCmp
func (Builder) CreateIntToPtr ¶
func (b Builder) CreateIntToPtr(name string, from Value, to PointerType) IntToPtr
func (Builder) CreateInvoke ¶
func (Builder) CreateLandingPad ¶
func (Builder) CreateMallocWithSize ¶
func (Builder) CreateMemCpy ¶
func (Builder) CreateMemMove ¶
func (Builder) CreateMemSet ¶
func (Builder) CreatePtrToInt ¶
func (b Builder) CreatePtrToInt(name string, from Value, to IntegerType) PtrToInt
func (Builder) CreateResume ¶
func (Builder) CreateSExt ¶
func (b Builder) CreateSExt(name string, from Value, to IntegerType) Expand
func (Builder) CreateSIToFP ¶
func (b Builder) CreateSIToFP(name string, from Value, to FloatType) IntToFloat
func (Builder) CreateSelect ¶
func (Builder) CreateStore ¶
func (Builder) CreateStructGEP ¶
func (Builder) CreateSwitch ¶
func (Builder) CreateTrunc ¶
func (b Builder) CreateTrunc(name string, from Value, to IntegerType) Trunc
func (Builder) CreateUIToFP ¶
func (b Builder) CreateUIToFP(name string, from Value, to FloatType) IntToFloat
func (Builder) CreateUnreachable ¶
func (b Builder) CreateUnreachable() Unreachable
func (Builder) CreateZExt ¶
func (b Builder) CreateZExt(name string, from Value, to IntegerType) Expand
func (Builder) CurrentBlock ¶
func (Builder) MoveToAfter ¶
type Call ¶
type Call binding.LLVMValueRef
type CatchPad ¶
type CatchPad binding.LLVMValueRef
type CatchRet ¶
type CatchRet binding.LLVMValueRef
type CatchSwitch ¶
type CatchSwitch binding.LLVMValueRef
func (CatchSwitch) Belong ¶
func (i CatchSwitch) Belong() Block
func (CatchSwitch) String ¶
func (v CatchSwitch) String() string
func (CatchSwitch) Type ¶
func (v CatchSwitch) Type() Type
type CleanupPad ¶
type CleanupPad binding.LLVMValueRef
func (CleanupPad) Belong ¶
func (i CleanupPad) Belong() Block
func (CleanupPad) String ¶
func (v CleanupPad) String() string
func (CleanupPad) Type ¶
func (v CleanupPad) Type() Type
type CleanupRet ¶
type CleanupRet binding.LLVMValueRef
func (CleanupRet) Belong ¶
func (i CleanupRet) Belong() Block
func (CleanupRet) String ¶
func (v CleanupRet) String() string
func (CleanupRet) Type ¶
func (v CleanupRet) Type() Type
type CodeModel ¶
type CodeModel binding.LLVMRelocMode
type CodeOptLevel ¶
type CodeOptLevel binding.LLVMCodeGenOptLevel
type Context ¶
type Context binding.LLVMContextRef
func NewContext ¶
func NewContext() Context
func (Context) ConstAggregateZero ¶
func (ctx Context) ConstAggregateZero(t AggregateType) Constant
func (Context) ConstExtractElement ¶
func (Context) ConstFloatFromString ¶
func (Context) ConstInBoundsGEP ¶
func (Context) ConstInteger ¶
func (ctx Context) ConstInteger(t IntegerType, v int64) Integer
func (Context) ConstIntegerFromString ¶
func (ctx Context) ConstIntegerFromString(t IntegerType, s string, radix uint8) Integer
func (Context) ConstNamedStruct ¶
func (ctx Context) ConstNamedStruct(t StructType, elem ...Constant) Struct
func (Context) ConstPointer ¶
func (Context) ConstString ¶
func (Context) FloatType ¶
func (ctx Context) FloatType(kind FloatTypeKind) FloatType
func (Context) FunctionType ¶
func (ctx Context) FunctionType(isVarArg bool, ret Type, param ...Type) FunctionType
func (Context) GetTypeByName ¶
func (ctx Context) GetTypeByName(name string) *StructType
func (Context) IntPtrType ¶
func (ctx Context) IntPtrType(t *Target) IntegerType
func (Context) IntegerType ¶
func (ctx Context) IntegerType(bits uint32) IntegerType
func (Context) NamedStructType ¶
func (ctx Context) NamedStructType(name string, packed bool, elems ...Type) StructType
func (Context) NewBuilder ¶
func (Context) OpaquePointerType ¶
func (ctx Context) OpaquePointerType() PointerType
func (Context) PointerType ¶
func (ctx Context) PointerType(elem Type) PointerType
func (Context) StructType ¶
func (ctx Context) StructType(packed bool, elems ...Type) StructType
type Div ¶
type Div binding.LLVMValueRef
type ExecutionEngine ¶
type ExecutionEngine struct {
// contains filtered or unexported fields
}
func DefaultMCJITCompiler ¶
func DefaultMCJITCompiler(m Module) (*ExecutionEngine, error)
func NewExecutionEngine ¶
func NewExecutionEngine(m Module) (*ExecutionEngine, error)
func NewInterpreter ¶
func NewInterpreter(m Module) (*ExecutionEngine, error)
func NewJITCompiler ¶
func NewJITCompiler(m Module, opt CodeOptLevel) (*ExecutionEngine, error)
func (ExecutionEngine) Free ¶
func (engine ExecutionEngine) Free()
func (ExecutionEngine) GetFunction ¶
func (engine ExecutionEngine) GetFunction(name string) (Function, bool)
func (ExecutionEngine) GetFunctionRuntimePointer ¶
func (engine ExecutionEngine) GetFunctionRuntimePointer(f Function) (unsafe.Pointer, bool)
func (ExecutionEngine) GetVariable ¶
func (engine ExecutionEngine) GetVariable(name string) (GlobalValue, bool)
func (ExecutionEngine) GetVariableRuntimePointer ¶
func (engine ExecutionEngine) GetVariableRuntimePointer(v GlobalValue) (unsafe.Pointer, bool)
func (ExecutionEngine) MapFunctionToGo ¶
func (engine ExecutionEngine) MapFunctionToGo(name string, to any) error
MapFunctionToGo 映射函数到go函数
func (ExecutionEngine) MapGlobalToC ¶
func (engine ExecutionEngine) MapGlobalToC(name string, to unsafe.Pointer) error
MapGlobalToC 映射全局值到c语言值
func (ExecutionEngine) RunFunction ¶
func (engine ExecutionEngine) RunFunction(f Function, args ...ExecutionValue) ExecutionValue
func (ExecutionEngine) RunMainFunction ¶
func (engine ExecutionEngine) RunMainFunction(f Function, argv, envp []string) uint8
func (ExecutionEngine) RunMainFunctionWithParentEnv ¶
func (engine ExecutionEngine) RunMainFunctionWithParentEnv(f Function) uint8
type ExecutionValue ¶
type ExecutionValue binding.LLVMGenericValueRef
func NewFloatExecutionValue ¶
func NewFloatExecutionValue(t FloatType, v float64) ExecutionValue
func NewIntExecutionValue ¶
func NewIntExecutionValue(t IntegerType, v uint64, isSigned bool) ExecutionValue
func (ExecutionValue) Float ¶
func (v ExecutionValue) Float(t FloatType) float64
func (ExecutionValue) Free ¶
func (v ExecutionValue) Free()
func (ExecutionValue) Integer ¶
func (v ExecutionValue) Integer(isSigned bool) uint64
type Expand ¶
type Expand binding.LLVMValueRef
type ExtractElement ¶
type ExtractElement binding.LLVMValueRef
func (ExtractElement) Belong ¶
func (i ExtractElement) Belong() Block
func (ExtractElement) String ¶
func (v ExtractElement) String() string
func (ExtractElement) Type ¶
func (v ExtractElement) Type() Type
type ExtractValue ¶
type ExtractValue binding.LLVMValueRef
func (ExtractValue) Belong ¶
func (i ExtractValue) Belong() Block
func (ExtractValue) String ¶
func (v ExtractValue) String() string
func (ExtractValue) Type ¶
func (v ExtractValue) Type() Type
type Float ¶
type Float binding.LLVMValueRef
type FloatCmp ¶
type FloatCmp binding.LLVMValueRef
func (FloatCmp) GetOperator ¶
func (c FloatCmp) GetOperator() FloatPredicate
type FloatPredicate ¶
type FloatPredicate binding.LLVMRealPredicate
type FloatToInt ¶
type FloatToInt binding.LLVMValueRef
func (FloatToInt) Belong ¶
func (i FloatToInt) Belong() Block
func (FloatToInt) String ¶
func (v FloatToInt) String() string
func (FloatToInt) Type ¶
func (v FloatToInt) Type() Type
type FloatType ¶
type FloatType binding.LLVMTypeRef
func (FloatType) Kind ¶
func (t FloatType) Kind() FloatTypeKind
type FloatTypeKind ¶
type FloatTypeKind binding.LLVMTypeKind
type FuncAttribute ¶
type FuncAttribute uint8
const ( FuncAttributeNoReturn FuncAttribute = iota // 函数不会返回 FuncAttributeInlineHint // 自动内联 FuncAttributeAlwaysInline // 必须内联 FuncAttributeNoInline // 禁止内联 // FuncAttributeAllocKind 内存分配类型 // 1-alloc 2-realloc 1|2-alloc,realloc 4-free 8-uninitialized 16-zeroed 32-aligned FuncAttributeAllocKind )
type Function ¶
type Function binding.LLVMValueRef
func (Function) AddAttribute ¶
func (f Function) AddAttribute(attr FuncAttribute, attrValue ...uint)
func (Function) CountParams ¶
func (Function) EntryBlock ¶
func (Function) FirstBlock ¶
func (Function) FirstParam ¶
func (Function) FunctionType ¶
func (f Function) FunctionType() FunctionType
func (Function) SetLinkage ¶
func (Function) VerifyWithCFG ¶
type FunctionType ¶
type FunctionType binding.LLVMTypeRef
func (FunctionType) Context ¶
func (t FunctionType) Context() Context
func (FunctionType) CountParams ¶
func (t FunctionType) CountParams() uint32
func (FunctionType) IsSized ¶
func (t FunctionType) IsSized() bool
func (FunctionType) IsVarArg ¶
func (t FunctionType) IsVarArg() bool
func (FunctionType) Params ¶
func (t FunctionType) Params() []Type
func (FunctionType) ReturnType ¶
func (t FunctionType) ReturnType() Type
func (FunctionType) String ¶
func (t FunctionType) String() string
type GetElementPtr ¶
type GetElementPtr binding.LLVMValueRef
func (GetElementPtr) Belong ¶
func (i GetElementPtr) Belong() Block
func (GetElementPtr) String ¶
func (v GetElementPtr) String() string
func (GetElementPtr) Type ¶
func (v GetElementPtr) Type() Type
type GlobalValue ¶
type GlobalValue binding.LLVMValueRef
func (GlobalValue) GetAlign ¶
func (g GlobalValue) GetAlign() uint32
func (GlobalValue) GetInitializer ¶
func (g GlobalValue) GetInitializer() (Constant, bool)
func (GlobalValue) IsDeclaration ¶
func (g GlobalValue) IsDeclaration() bool
func (GlobalValue) IsExternallyInitialized ¶
func (g GlobalValue) IsExternallyInitialized() bool
func (GlobalValue) IsGlobalConstant ¶
func (g GlobalValue) IsGlobalConstant() bool
func (GlobalValue) IsThreadLocal ¶
func (g GlobalValue) IsThreadLocal() bool
func (GlobalValue) Linkage ¶
func (g GlobalValue) Linkage() Linkage
func (GlobalValue) SetAlign ¶
func (g GlobalValue) SetAlign(align uint32)
func (GlobalValue) SetExternallyInitialized ¶
func (g GlobalValue) SetExternallyInitialized(isConstant bool)
func (GlobalValue) SetGlobalConstant ¶
func (g GlobalValue) SetGlobalConstant(isConstant bool)
func (GlobalValue) SetInitializer ¶
func (g GlobalValue) SetInitializer(v Constant)
func (GlobalValue) SetLinkage ¶
func (g GlobalValue) SetLinkage(linkage Linkage)
func (GlobalValue) SetThreadLocal ¶
func (g GlobalValue) SetThreadLocal(isThreadLocal bool)
func (GlobalValue) SetThreadLocalMode ¶
func (g GlobalValue) SetThreadLocalMode(mode ThreadLocalMode)
func (GlobalValue) SetUnnamedAddress ¶
func (g GlobalValue) SetUnnamedAddress(unnamedAddr UnnamedAddr)
func (GlobalValue) SetVisibility ¶
func (g GlobalValue) SetVisibility(visibility Visibility)
func (GlobalValue) String ¶
func (v GlobalValue) String() string
func (GlobalValue) ThreadLocalMode ¶
func (g GlobalValue) ThreadLocalMode() ThreadLocalMode
func (GlobalValue) Type ¶
func (v GlobalValue) Type() Type
func (GlobalValue) UnnamedAddress ¶
func (g GlobalValue) UnnamedAddress() UnnamedAddr
func (GlobalValue) ValueType ¶
func (g GlobalValue) ValueType() Type
func (GlobalValue) Visibility ¶
func (g GlobalValue) Visibility() Visibility
type Instruction ¶
type Instruction interface { Belong() Block // contains filtered or unexported methods }
type IntCmp ¶
type IntCmp binding.LLVMValueRef
func (IntCmp) GetOperator ¶
func (c IntCmp) GetOperator() IntPredicate
type IntPredicate ¶
type IntPredicate binding.LLVMIntPredicate
type IntToFloat ¶
type IntToFloat binding.LLVMValueRef
func (IntToFloat) Belong ¶
func (i IntToFloat) Belong() Block
func (IntToFloat) String ¶
func (v IntToFloat) String() string
func (IntToFloat) Type ¶
func (v IntToFloat) Type() Type
type IntToPtr ¶
type IntToPtr binding.LLVMValueRef
type Integer ¶
type Integer binding.LLVMValueRef
type IntegerType ¶
type IntegerType binding.LLVMTypeRef
func (IntegerType) Bits ¶
func (t IntegerType) Bits() uint32
func (IntegerType) Context ¶
func (t IntegerType) Context() Context
func (IntegerType) IsSized ¶
func (t IntegerType) IsSized() bool
func (IntegerType) String ¶
func (t IntegerType) String() string
type Invoke ¶
type Invoke binding.LLVMValueRef
type LandingPad ¶
type LandingPad binding.LLVMValueRef
func (LandingPad) Belong ¶
func (i LandingPad) Belong() Block
func (LandingPad) String ¶
func (v LandingPad) String() string
func (LandingPad) Type ¶
func (v LandingPad) Type() Type
type Linkage ¶
type Linkage binding.LLVMLinkage
type Load ¶
type Load binding.LLVMValueRef
type Module ¶
type Module struct { binding.LLVMModuleRef // contains filtered or unexported fields }
func (Module) AddConstructor ¶
func (Module) AddDestructor ¶
func (Module) DelGlobal ¶
func (m Module) DelGlobal(g GlobalValue)
func (Module) NewFunction ¶
func (m Module) NewFunction(name string, t FunctionType) Function
type Mul ¶
type Mul binding.LLVMValueRef
type Neg ¶
type Neg binding.LLVMValueRef
type Not ¶
type Not binding.LLVMValueRef
type Or ¶
type Or binding.LLVMValueRef
type Param ¶
type Param binding.LLVMValueRef
type PassOption ¶
type PassOption binding.LLVMPassBuilderOptionsRef
func NewPassOption ¶
func NewPassOption() PassOption
func (PassOption) Free ¶
func (o PassOption) Free()
func (PassOption) SetCallGraphProfile ¶
func (o PassOption) SetCallGraphProfile(v bool)
func (PassOption) SetDebugLogging ¶
func (o PassOption) SetDebugLogging(v bool)
func (PassOption) SetForgetAllSCEVInLoopUnroll ¶
func (o PassOption) SetForgetAllSCEVInLoopUnroll(v bool)
func (PassOption) SetLicmMssaNoAccForPromotionCap ¶
func (o PassOption) SetLicmMssaNoAccForPromotionCap(v uint32)
func (PassOption) SetLicmMssaOptCap ¶
func (o PassOption) SetLicmMssaOptCap(v uint32)
func (PassOption) SetLoopInterleaving ¶
func (o PassOption) SetLoopInterleaving(v bool)
func (PassOption) SetLoopUnrolling ¶
func (o PassOption) SetLoopUnrolling(v bool)
func (PassOption) SetLoopVectorization ¶
func (o PassOption) SetLoopVectorization(v bool)
func (PassOption) SetMergeFunctions ¶
func (o PassOption) SetMergeFunctions(v bool)
func (PassOption) SetSLPVectorization ¶
func (o PassOption) SetSLPVectorization(v bool)
func (PassOption) SetVerifyEach ¶
func (o PassOption) SetVerifyEach(v bool)
type Pointer ¶
type Pointer binding.LLVMValueRef
type PointerType ¶
type PointerType binding.LLVMTypeRef
func (PointerType) AddressSpace ¶
func (t PointerType) AddressSpace() uint32
func (PointerType) Context ¶
func (t PointerType) Context() Context
func (PointerType) IsOpaque ¶
func (t PointerType) IsOpaque() bool
func (PointerType) IsSized ¶
func (t PointerType) IsSized() bool
func (PointerType) String ¶
func (t PointerType) String() string
type PtrToInt ¶
type PtrToInt binding.LLVMValueRef
type RelocMode ¶
type RelocMode binding.LLVMRelocMode
type Rem ¶
type Rem binding.LLVMValueRef
type Resume ¶
type Resume binding.LLVMValueRef
type Return ¶
type Return binding.LLVMValueRef
type Select ¶
type Select binding.LLVMValueRef
type Shl ¶
type Shl binding.LLVMValueRef
type Shr ¶
type Shr binding.LLVMValueRef
type Store ¶
type Store binding.LLVMValueRef
type Struct ¶
type Struct binding.LLVMValueRef
type StructType ¶
type StructType binding.LLVMTypeRef
func (StructType) Context ¶
func (t StructType) Context() Context
func (StructType) CountElems ¶
func (t StructType) CountElems() uint32
func (StructType) Elems ¶
func (t StructType) Elems() []Type
func (StructType) GetElem ¶
func (t StructType) GetElem(i uint32) Type
func (StructType) IsOpaque ¶
func (t StructType) IsOpaque() bool
func (StructType) IsPacked ¶
func (t StructType) IsPacked() bool
func (StructType) IsSized ¶
func (t StructType) IsSized() bool
func (StructType) Name ¶
func (t StructType) Name() string
func (StructType) SetElems ¶
func (t StructType) SetElems(packed bool, elems ...Type)
func (StructType) String ¶
func (t StructType) String() string
type Sub ¶
type Sub binding.LLVMValueRef
type Switch ¶
type Switch binding.LLVMValueRef
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
func NativeTarget ¶
func NewTargetFromTriple ¶
func (Target) Description ¶
func (Target) GetABIAlignOfType ¶
func (Target) GetABISizeOfType ¶
func (Target) GetCallFrameAlignOfType ¶
func (Target) GetOffsetOfElem ¶
func (d Target) GetOffsetOfElem(st StructType, i uint) uint
func (Target) GetPrefAlignOfGlobal ¶
func (d Target) GetPrefAlignOfGlobal(g GlobalValue) uint
func (Target) GetPrefAlignOfType ¶
func (Target) GetSizeOfType ¶
func (Target) GetStoreSizeOfType ¶
func (Target) HasAsmBackend ¶
func (Target) HasTargetMachine ¶
func (Target) PointerSize ¶
func (d Target) PointerSize() uint
func (Target) WriteASMToFile ¶
func (Target) WriteOBJToFile ¶
type Terminator ¶
type Terminator interface { Instruction // contains filtered or unexported methods }
type ThreadLocalMode ¶
type ThreadLocalMode binding.LLVMThreadLocalMode
type Trunc ¶
type Trunc binding.LLVMValueRef
type UnnamedAddr ¶
type UnnamedAddr binding.LLVMUnnamedAddr
type Unreachable ¶
type Unreachable binding.LLVMValueRef
func (Unreachable) Belong ¶
func (i Unreachable) Belong() Block
type Visibility ¶
type Visibility binding.LLVMVisibility
type VoidType ¶
type VoidType binding.LLVMTypeRef
Source Files ¶
Click to show internal directories.
Click to hide internal directories.