• Home
  • Raw
  • Download

Lines Matching full:c

17 #include "llvm-c/Core.h"
21 import "C"
29 C C.LLVMContextRef member
32 C C.LLVMModuleRef member
35 C C.LLVMTypeRef member
38 C C.LLVMValueRef member
41 C C.LLVMBasicBlockRef member
44 C C.LLVMBuilderRef member
47 C C.LLVMModuleProviderRef member
50 C C.LLVMMemoryBufferRef member
53 C C.LLVMPassManagerRef member
56 C C.LLVMUseRef member
59 C C.LLVMMetadataRef member
62 Opcode C.LLVMOpcode
63 TypeKind C.LLVMTypeKind
64 Linkage C.LLVMLinkage
65 Visibility C.LLVMVisibility
66 CallConv C.LLVMCallConv
67 IntPredicate C.LLVMIntPredicate
68 FloatPredicate C.LLVMRealPredicate
69 LandingPadClause C.LLVMLandingPadClauseTy
72 func (c Context) IsNil() bool { return c.C == nil }
73 func (c Module) IsNil() bool { return c.C == nil }
74 func (c Type) IsNil() bool { return c.C == nil }
75 func (c Value) IsNil() bool { return c.C == nil }
76 func (c BasicBlock) IsNil() bool { return c.C == nil }
77 func (c Builder) IsNil() bool { return c.C == nil }
78 func (c ModuleProvider) IsNil() bool { return c.C == nil }
79 func (c MemoryBuffer) IsNil() bool { return c.C == nil }
80 func (c PassManager) IsNil() bool { return c.C == nil }
81 func (c Use) IsNil() bool { return c.C == nil }
84 func llvmTypeRefPtr(t *Type) *C.LLVMTypeRef { return (*C.LLVMTypeRef)(unsafe.Pointer(t)) }
85 func llvmValueRefPtr(t *Value) *C.LLVMValueRef { return (*C.LLVMValueRef)(unsafe.Pointer(t)) }
86 func llvmMetadataRefPtr(t *Metadata) *C.LLVMMetadataRef {
87 return (*C.LLVMMetadataRef)(unsafe.Pointer(t))
89 func llvmBasicBlockRefPtr(t *BasicBlock) *C.LLVMBasicBlockRef {
90 return (*C.LLVMBasicBlockRef)(unsafe.Pointer(t))
92 func boolToLLVMBool(b bool) C.LLVMBool {
94 return C.LLVMBool(1)
96 return C.LLVMBool(0)
99 func llvmValueRefs(values []Value) (*C.LLVMValueRef, C.unsigned) {
100 var pt *C.LLVMValueRef
101 ptlen := C.unsigned(len(values))
108 func llvmMetadataRefs(mds []Metadata) (*C.LLVMMetadataRef, C.unsigned) {
109 var pt *C.LLVMMetadataRef
110 ptlen := C.unsigned(len(mds))
123 ZExtAttribute Attribute = C.LLVMZExtAttribute
124 SExtAttribute Attribute = C.LLVMSExtAttribute
125 NoReturnAttribute Attribute = C.LLVMNoReturnAttribute
126 InRegAttribute Attribute = C.LLVMInRegAttribute
127 StructRetAttribute Attribute = C.LLVMStructRetAttribute
128 NoUnwindAttribute Attribute = C.LLVMNoUnwindAttribute
129 NoAliasAttribute Attribute = C.LLVMNoAliasAttribute
130 ByValAttribute Attribute = C.LLVMByValAttribute
131 NestAttribute Attribute = C.LLVMNestAttribute
132 ReadNoneAttribute Attribute = C.LLVMReadNoneAttribute
133 ReadOnlyAttribute Attribute = C.LLVMReadOnlyAttribute
134 NoInlineAttribute Attribute = C.LLVMNoInlineAttribute
135 AlwaysInlineAttribute Attribute = C.LLVMAlwaysInlineAttribute
136 OptimizeForSizeAttribute Attribute = C.LLVMOptimizeForSizeAttribute
137 StackProtectAttribute Attribute = C.LLVMStackProtectAttribute
138 StackProtectReqAttribute Attribute = C.LLVMStackProtectReqAttribute
139 Alignment Attribute = C.LLVMAlignment
140 NoCaptureAttribute Attribute = C.LLVMNoCaptureAttribute
141 NoRedZoneAttribute Attribute = C.LLVMNoRedZoneAttribute
142 NoImplicitFloatAttribute Attribute = C.LLVMNoImplicitFloatAttribute
143 NakedAttribute Attribute = C.LLVMNakedAttribute
144 InlineHintAttribute Attribute = C.LLVMInlineHintAttribute
145 StackAlignment Attribute = C.LLVMStackAlignment
146 ReturnsTwiceAttribute Attribute = C.LLVMReturnsTwice
147 UWTableAttribute Attribute = C.LLVMUWTable
172 Ret Opcode = C.LLVMRet
173 Br Opcode = C.LLVMBr
174 Switch Opcode = C.LLVMSwitch
175 IndirectBr Opcode = C.LLVMIndirectBr
176 Invoke Opcode = C.LLVMInvoke
177 Unreachable Opcode = C.LLVMUnreachable
180 Add Opcode = C.LLVMAdd
181 FAdd Opcode = C.LLVMFAdd
182 Sub Opcode = C.LLVMSub
183 FSub Opcode = C.LLVMFSub
184 Mul Opcode = C.LLVMMul
185 FMul Opcode = C.LLVMFMul
186 UDiv Opcode = C.LLVMUDiv
187 SDiv Opcode = C.LLVMSDiv
188 FDiv Opcode = C.LLVMFDiv
189 URem Opcode = C.LLVMURem
190 SRem Opcode = C.LLVMSRem
191 FRem Opcode = C.LLVMFRem
194 Shl Opcode = C.LLVMShl
195 LShr Opcode = C.LLVMLShr
196 AShr Opcode = C.LLVMAShr
197 And Opcode = C.LLVMAnd
198 Or Opcode = C.LLVMOr
199 Xor Opcode = C.LLVMXor
202 Alloca Opcode = C.LLVMAlloca
203 Load Opcode = C.LLVMLoad
204 Store Opcode = C.LLVMStore
205 GetElementPtr Opcode = C.LLVMGetElementPtr
208 Trunc Opcode = C.LLVMTrunc
209 ZExt Opcode = C.LLVMZExt
210 SExt Opcode = C.LLVMSExt
211 FPToUI Opcode = C.LLVMFPToUI
212 FPToSI Opcode = C.LLVMFPToSI
213 UIToFP Opcode = C.LLVMUIToFP
214 SIToFP Opcode = C.LLVMSIToFP
215 FPTrunc Opcode = C.LLVMFPTrunc
216 FPExt Opcode = C.LLVMFPExt
217 PtrToInt Opcode = C.LLVMPtrToInt
218 IntToPtr Opcode = C.LLVMIntToPtr
219 BitCast Opcode = C.LLVMBitCast
222 ICmp Opcode = C.LLVMICmp
223 FCmp Opcode = C.LLVMFCmp
224 PHI Opcode = C.LLVMPHI
225 Call Opcode = C.LLVMCall
226 Select Opcode = C.LLVMSelect
229 VAArg Opcode = C.LLVMVAArg
230 ExtractElement Opcode = C.LLVMExtractElement
231 InsertElement Opcode = C.LLVMInsertElement
232 ShuffleVector Opcode = C.LLVMShuffleVector
233 ExtractValue Opcode = C.LLVMExtractValue
234 InsertValue Opcode = C.LLVMInsertValue
242 VoidTypeKind TypeKind = C.LLVMVoidTypeKind
243 FloatTypeKind TypeKind = C.LLVMFloatTypeKind
244 DoubleTypeKind TypeKind = C.LLVMDoubleTypeKind
245 X86_FP80TypeKind TypeKind = C.LLVMX86_FP80TypeKind
246 FP128TypeKind TypeKind = C.LLVMFP128TypeKind
247 PPC_FP128TypeKind TypeKind = C.LLVMPPC_FP128TypeKind
248 LabelTypeKind TypeKind = C.LLVMLabelTypeKind
249 IntegerTypeKind TypeKind = C.LLVMIntegerTypeKind
250 FunctionTypeKind TypeKind = C.LLVMFunctionTypeKind
251 StructTypeKind TypeKind = C.LLVMStructTypeKind
252 ArrayTypeKind TypeKind = C.LLVMArrayTypeKind
253 PointerTypeKind TypeKind = C.LLVMPointerTypeKind
254 VectorTypeKind TypeKind = C.LLVMVectorTypeKind
255 MetadataTypeKind TypeKind = C.LLVMMetadataTypeKind
263 ExternalLinkage Linkage = C.LLVMExternalLinkage
264 AvailableExternallyLinkage Linkage = C.LLVMAvailableExternallyLinkage
265 LinkOnceAnyLinkage Linkage = C.LLVMLinkOnceAnyLinkage
266 LinkOnceODRLinkage Linkage = C.LLVMLinkOnceODRLinkage
267 WeakAnyLinkage Linkage = C.LLVMWeakAnyLinkage
268 WeakODRLinkage Linkage = C.LLVMWeakODRLinkage
269 AppendingLinkage Linkage = C.LLVMAppendingLinkage
270 InternalLinkage Linkage = C.LLVMInternalLinkage
271 PrivateLinkage Linkage = C.LLVMPrivateLinkage
272 ExternalWeakLinkage Linkage = C.LLVMExternalWeakLinkage
273 CommonLinkage Linkage = C.LLVMCommonLinkage
281 DefaultVisibility Visibility = C.LLVMDefaultVisibility
282 HiddenVisibility Visibility = C.LLVMHiddenVisibility
283 ProtectedVisibility Visibility = C.LLVMProtectedVisibility
291 CCallConv CallConv = C.LLVMCCallConv
292 FastCallConv CallConv = C.LLVMFastCallConv
293 ColdCallConv CallConv = C.LLVMColdCallConv
294 X86StdcallCallConv CallConv = C.LLVMX86StdcallCallConv
295 X86FastcallCallConv CallConv = C.LLVMX86FastcallCallConv
303 IntEQ IntPredicate = C.LLVMIntEQ
304 IntNE IntPredicate = C.LLVMIntNE
305 IntUGT IntPredicate = C.LLVMIntUGT
306 IntUGE IntPredicate = C.LLVMIntUGE
307 IntULT IntPredicate = C.LLVMIntULT
308 IntULE IntPredicate = C.LLVMIntULE
309 IntSGT IntPredicate = C.LLVMIntSGT
310 IntSGE IntPredicate = C.LLVMIntSGE
311 IntSLT IntPredicate = C.LLVMIntSLT
312 IntSLE IntPredicate = C.LLVMIntSLE
320 FloatPredicateFalse FloatPredicate = C.LLVMRealPredicateFalse
321 FloatOEQ FloatPredicate = C.LLVMRealOEQ
322 FloatOGT FloatPredicate = C.LLVMRealOGT
323 FloatOGE FloatPredicate = C.LLVMRealOGE
324 FloatOLT FloatPredicate = C.LLVMRealOLT
325 FloatOLE FloatPredicate = C.LLVMRealOLE
326 FloatONE FloatPredicate = C.LLVMRealONE
327 FloatORD FloatPredicate = C.LLVMRealORD
328 FloatUNO FloatPredicate = C.LLVMRealUNO
329 FloatUEQ FloatPredicate = C.LLVMRealUEQ
330 FloatUGT FloatPredicate = C.LLVMRealUGT
331 FloatUGE FloatPredicate = C.LLVMRealUGE
332 FloatULT FloatPredicate = C.LLVMRealULT
333 FloatULE FloatPredicate = C.LLVMRealULE
334 FloatUNE FloatPredicate = C.LLVMRealUNE
335 FloatPredicateTrue FloatPredicate = C.LLVMRealPredicateTrue
343 LandingPadCatch LandingPadClause = C.LLVMLandingPadCatch
344 LandingPadFilter LandingPadClause = C.LLVMLandingPadFilter
351 func NewContext() Context { return Context{C.LLVMContextCreate()} }
352 func GlobalContext() Context { return Context{C.LLVMGetGlobalContext()} }
353 func (c Context) Dispose() { C.LLVMContextDispose(c.C) }
355 func (c Context) MDKindID(name string) (id int) {
356 cname := C.CString(name)
357 defer C.free(unsafe.Pointer(cname))
358 id = int(C.LLVMGetMDKindIDInContext(c.C, cname, C.unsigned(len(name))))
363 cname := C.CString(name)
364 defer C.free(unsafe.Pointer(cname))
365 id = int(C.LLVMGetMDKindID(cname, C.unsigned(len(name))))
376 cname := C.CString(name)
377 defer C.free(unsafe.Pointer(cname))
378 m.C = C.LLVMModuleCreateWithName(cname)
382 func (c Context) NewModule(name string) (m Module) {
383 cname := C.CString(name)
384 defer C.free(unsafe.Pointer(cname))
385 m.C = C.LLVMModuleCreateWithNameInContext(cname, c.C)
390 func (m Module) Dispose() { C.LLVMDisposeModule(m.C) }
394 clayout := C.LLVMGetDataLayout(m.C)
395 return C.GoString(clayout)
399 clayout := C.CString(layout)
400 defer C.free(unsafe.Pointer(clayout))
401 C.LLVMSetDataLayout(m.C, clayout)
406 ctarget := C.LLVMGetTarget(m.C)
407 return C.GoString(ctarget)
410 ctarget := C.CString(target)
411 defer C.free(unsafe.Pointer(ctarget))
412 C.LLVMSetTarget(m.C, ctarget)
416 cname := C.CString(name)
417 defer C.free(unsafe.Pointer(cname))
418 t.C = C.LLVMGetTypeByName(m.C, cname)
424 C.LLVMDumpModule(m.C)
428 cir := C.LLVMPrintModuleToString(m.C)
429 defer C.free(unsafe.Pointer(cir))
430 ir := C.GoString(cir)
436 casm := C.CString(asm)
437 defer C.free(unsafe.Pointer(casm))
438 C.LLVMSetModuleInlineAsm(m.C, casm)
442 cname := C.CString(name)
443 defer C.free(unsafe.Pointer(cname))
444 C.LLVMAddNamedMetadataOperand2(m.C, cname, operand.C)
447 func (m Module) Context() (c Context) {
448 c.C = C.LLVMGetModuleContext(m.C)
471 func (t Type) TypeKind() TypeKind { return TypeKind(C.LLVMGetTypeKind(t.C)) }
474 func (t Type) Context() (c Context) {
475 c.C = C.LLVMGetTypeContext(t.C)
480 func (c Context) Int1Type() (t Type) { t.C = C.LLVMInt1TypeInContext(c.C); return }
481 func (c Context) Int8Type() (t Type) { t.C = C.LLVMInt8TypeInContext(c.C); return }
482 func (c Context) Int16Type() (t Type) { t.C = C.LLVMInt16TypeInContext(c.C); return }
483 func (c Context) Int32Type() (t Type) { t.C = C.LLVMInt32TypeInContext(c.C); return }
484 func (c Context) Int64Type() (t Type) { t.C = C.LLVMInt64TypeInContext(c.C); return }
485 func (c Context) IntType(numbits int) (t Type) {
486 t.C = C.LLVMIntTypeInContext(c.C, C.unsigned(numbits))
490 func Int1Type() (t Type) { t.C = C.LLVMInt1Type(); return }
491 func Int8Type() (t Type) { t.C = C.LLVMInt8Type(); return }
492 func Int16Type() (t Type) { t.C = C.LLVMInt16Type(); return }
493 func Int32Type() (t Type) { t.C = C.LLVMInt32Type(); return }
494 func Int64Type() (t Type) { t.C = C.LLVMInt64Type(); return }
497 t.C = C.LLVMIntType(C.unsigned(numbits))
502 return int(C.LLVMGetIntTypeWidth(t.C))
506 func (c Context) FloatType() (t Type) { t.C = C.LLVMFloatTypeInContext(c.C); return }
507 func (c Context) DoubleType() (t Type) { t.C = C.LLVMDoubleTypeInContext(c.C); return }
508 func (c Context) X86FP80Type() (t Type) { t.C = C.LLVMX86FP80TypeInContext(c.C); return }
509 func (c Context) FP128Type() (t Type) { t.C = C.LLVMFP128TypeInContext(c.C); return }
510 func (c Context) PPCFP128Type() (t Type) { t.C = C.LLVMPPCFP128TypeInContext(c.C); return }
512 func FloatType() (t Type) { t.C = C.LLVMFloatType(); return }
513 func DoubleType() (t Type) { t.C = C.LLVMDoubleType(); return }
514 func X86FP80Type() (t Type) { t.C = C.LLVMX86FP80Type(); return }
515 func FP128Type() (t Type) { t.C = C.LLVMFP128Type(); return }
516 func PPCFP128Type() (t Type) { t.C = C.LLVMPPCFP128Type(); return }
520 var pt *C.LLVMTypeRef
521 var ptlen C.unsigned
524 ptlen = C.unsigned(len(paramTypes))
526 t.C = C.LLVMFunctionType(returnType.C,
533 func (t Type) IsFunctionVarArg() bool { return C.LLVMIsFunctionVarArg(t.C) != 0 }
534 func (t Type) ReturnType() (rt Type) { rt.C = C.LLVMGetReturnType(t.C); return }
535 func (t Type) ParamTypesCount() int { return int(C.LLVMCountParamTypes(t.C)) }
540 C.LLVMGetParamTypes(t.C, llvmTypeRefPtr(&out[0]))
547 func (c Context) StructType(elementTypes []Type, packed bool) (t Type) {
548 var pt *C.LLVMTypeRef
549 var ptlen C.unsigned
552 ptlen = C.unsigned(len(elementTypes))
554 t.C = C.LLVMStructTypeInContext(c.C,
562 var pt *C.LLVMTypeRef
563 var ptlen C.unsigned
566 ptlen = C.unsigned(len(elementTypes))
568 t.C = C.LLVMStructType(pt, ptlen, boolToLLVMBool(packed))
572 func (c Context) StructCreateNamed(name string) (t Type) {
573 cname := C.CString(name)
574 defer C.free(unsafe.Pointer(cname))
575 t.C = C.LLVMStructCreateNamed(c.C, cname)
580 return C.GoString(C.LLVMGetStructName(t.C))
584 var pt *C.LLVMTypeRef
585 var ptlen C.unsigned
588 ptlen = C.unsigned(len(elementTypes))
590 C.LLVMStructSetBody(t.C, pt, ptlen, boolToLLVMBool(packed))
593 func (t Type) IsStructPacked() bool { return C.LLVMIsPackedStruct(t.C) != 0 }
594 func (t Type) StructElementTypesCount() int { return int(C.LLVMCountStructElementTypes(t.C)) }
598 C.LLVMGetStructElementTypes(t.C, llvmTypeRefPtr(&out[0]))
605 t.C = C.LLVMArrayType(elementType.C, C.unsigned(elementCount))
609 t.C = C.LLVMPointerType(elementType.C, C.unsigned(addressSpace))
613 t.C = C.LLVMVectorType(elementType.C, C.unsigned(elementCount))
617 func (t Type) ElementType() (rt Type) { rt.C = C.LLVMGetElementType(t.C); return }
618 func (t Type) ArrayLength() int { return int(C.LLVMGetArrayLength(t.C)) }
619 func (t Type) PointerAddressSpace() int { return int(C.LLVMGetPointerAddressSpace(t.C)) }
620 func (t Type) VectorSize() int { return int(C.LLVMGetVectorSize(t.C)) }
623 func (c Context) VoidType() (t Type) { t.C = C.LLVMVoidTypeInContext(c.C); return }
624 func (c Context) LabelType() (t Type) { t.C = C.LLVMLabelTypeInContext(c.C); return }
626 func VoidType() (t Type) { t.C = C.LLVMVoidType(); return }
627 func LabelType() (t Type) { t.C = C.LLVMLabelType(); return }
634 func (v Value) Type() (t Type) { t.C = C.LLVMTypeOf(v.C); return }
635 func (v Value) Name() string { return C.GoString(C.LLVMGetValueName(v.C)) }
637 cname := C.CString(name)
638 defer C.free(unsafe.Pointer(cname))
639 C.LLVMSetValueName(v.C, cname)
641 func (v Value) Dump() { C.LLVMDumpValue(v.C) }
642 func (v Value) ReplaceAllUsesWith(nv Value) { C.LLVMReplaceAllUsesWith(v.C, nv.C) }
643 func (v Value) HasMetadata() bool { return C.LLVMHasMetadata(v.C) != 0 }
645 rv.C = C.LLVMGetMetadata(v.C, C.unsigned(kind))
649 C.LLVMSetMetadata2(v.C, C.unsigned(kind), node.C)
655 func (v Value) IsAArgument() (rv Value) { rv.C = C.LLVMIsAArgument(v.C); return }
656 func (v Value) IsABasicBlock() (rv Value) { rv.C = C.LLVMIsABasicBlock(v.C); return }
657 func (v Value) IsAInlineAsm() (rv Value) { rv.C = C.LLVMIsAInlineAsm(v.C); return }
658 func (v Value) IsAUser() (rv Value) { rv.C = C.LLVMIsAUser(v.C); return }
659 func (v Value) IsAConstant() (rv Value) { rv.C = C.LLVMIsAConstant(v.C); return }
661 rv.C = C.LLVMIsAConstantAggregateZero(v.C)
664 func (v Value) IsAConstantArray() (rv Value) { rv.C = C.LLVMIsAConstantArray(v.C); return }
665 func (v Value) IsAConstantExpr() (rv Value) { rv.C = C.LLVMIsAConstantExpr(v.C); return }
666 func (v Value) IsAConstantFP() (rv Value) { rv.C = C.LLVMIsAConstantFP(v.C); return }
667 func (v Value) IsAConstantInt() (rv Value) { rv.C = C.LLVMIsAConstantInt(v.C); return }
668 func (v Value) IsAConstantPointerNull() (rv Value) { rv.C = C.LLVMIsAConstantPointerNull(v.C); retu…
669 func (v Value) IsAConstantStruct() (rv Value) { rv.C = C.LLVMIsAConstantStruct(v.C); return }
670 func (v Value) IsAConstantVector() (rv Value) { rv.C = C.LLVMIsAConstantVector(v.C); return }
671 func (v Value) IsAGlobalValue() (rv Value) { rv.C = C.LLVMIsAGlobalValue(v.C); return }
672 func (v Value) IsAFunction() (rv Value) { rv.C = C.LLVMIsAFunction(v.C); return }
673 func (v Value) IsAGlobalAlias() (rv Value) { rv.C = C.LLVMIsAGlobalAlias(v.C); return }
674 func (v Value) IsAGlobalVariable() (rv Value) { rv.C = C.LLVMIsAGlobalVariable(v.C); return }
675 func (v Value) IsAUndefValue() (rv Value) { rv.C = C.LLVMIsAUndefValue(v.C); return }
676 func (v Value) IsAInstruction() (rv Value) { rv.C = C.LLVMIsAInstruction(v.C); return }
677 func (v Value) IsABinaryOperator() (rv Value) { rv.C = C.LLVMIsABinaryOperator(v.C); return }
678 func (v Value) IsACallInst() (rv Value) { rv.C = C.LLVMIsACallInst(v.C); return }
679 func (v Value) IsAIntrinsicInst() (rv Value) { rv.C = C.LLVMIsAIntrinsicInst(v.C); return }
680 func (v Value) IsADbgInfoIntrinsic() (rv Value) { rv.C = C.LLVMIsADbgInfoIntrinsic(v.C); return }
681 func (v Value) IsADbgDeclareInst() (rv Value) { rv.C = C.LLVMIsADbgDeclareInst(v.C); return }
682 func (v Value) IsAMemIntrinsic() (rv Value) { rv.C = C.LLVMIsAMemIntrinsic(v.C); return }
683 func (v Value) IsAMemCpyInst() (rv Value) { rv.C = C.LLVMIsAMemCpyInst(v.C); return }
684 func (v Value) IsAMemMoveInst() (rv Value) { rv.C = C.LLVMIsAMemMoveInst(v.C); return }
685 func (v Value) IsAMemSetInst() (rv Value) { rv.C = C.LLVMIsAMemSetInst(v.C); return }
686 func (v Value) IsACmpInst() (rv Value) { rv.C = C.LLVMIsACmpInst(v.C); return }
687 func (v Value) IsAFCmpInst() (rv Value) { rv.C = C.LLVMIsAFCmpInst(v.C); return }
688 func (v Value) IsAICmpInst() (rv Value) { rv.C = C.LLVMIsAICmpInst(v.C); return }
689 func (v Value) IsAExtractElementInst() (rv Value) { rv.C = C.LLVMIsAExtractElementInst(v.C); retur…
690 func (v Value) IsAGetElementPtrInst() (rv Value) { rv.C = C.LLVMIsAGetElementPtrInst(v.C); return…
691 func (v Value) IsAInsertElementInst() (rv Value) { rv.C = C.LLVMIsAInsertElementInst(v.C); return…
692 func (v Value) IsAInsertValueInst() (rv Value) { rv.C = C.LLVMIsAInsertValueInst(v.C); return }
693 func (v Value) IsAPHINode() (rv Value) { rv.C = C.LLVMIsAPHINode(v.C); return }
694 func (v Value) IsASelectInst() (rv Value) { rv.C = C.LLVMIsASelectInst(v.C); return }
695 func (v Value) IsAShuffleVectorInst() (rv Value) { rv.C = C.LLVMIsAShuffleVectorInst(v.C); return…
696 func (v Value) IsAStoreInst() (rv Value) { rv.C = C.LLVMIsAStoreInst(v.C); return }
697 func (v Value) IsATerminatorInst() (rv Value) { rv.C = C.LLVMIsATerminatorInst(v.C); return }
698 func (v Value) IsABranchInst() (rv Value) { rv.C = C.LLVMIsABranchInst(v.C); return }
699 func (v Value) IsAInvokeInst() (rv Value) { rv.C = C.LLVMIsAInvokeInst(v.C); return }
700 func (v Value) IsAReturnInst() (rv Value) { rv.C = C.LLVMIsAReturnInst(v.C); return }
701 func (v Value) IsASwitchInst() (rv Value) { rv.C = C.LLVMIsASwitchInst(v.C); return }
702 func (v Value) IsAUnreachableInst() (rv Value) { rv.C = C.LLVMIsAUnreachableInst(v.C); return }
703 func (v Value) IsAUnaryInstruction() (rv Value) { rv.C = C.LLVMIsAUnaryInstruction(v.C); return }
704 func (v Value) IsAAllocaInst() (rv Value) { rv.C = C.LLVMIsAAllocaInst(v.C); return }
705 func (v Value) IsACastInst() (rv Value) { rv.C = C.LLVMIsACastInst(v.C); return }
706 func (v Value) IsABitCastInst() (rv Value) { rv.C = C.LLVMIsABitCastInst(v.C); return }
707 func (v Value) IsAFPExtInst() (rv Value) { rv.C = C.LLVMIsAFPExtInst(v.C); return }
708 func (v Value) IsAFPToSIInst() (rv Value) { rv.C = C.LLVMIsAFPToSIInst(v.C); return }
709 func (v Value) IsAFPToUIInst() (rv Value) { rv.C = C.LLVMIsAFPToUIInst(v.C); return }
710 func (v Value) IsAFPTruncInst() (rv Value) { rv.C = C.LLVMIsAFPTruncInst(v.C); return }
711 func (v Value) IsAIntToPtrInst() (rv Value) { rv.C = C.LLVMIsAIntToPtrInst(v.C); return }
712 func (v Value) IsAPtrToIntInst() (rv Value) { rv.C = C.LLVMIsAPtrToIntInst(v.C); return }
713 func (v Value) IsASExtInst() (rv Value) { rv.C = C.LLVMIsASExtInst(v.C); return }
714 func (v Value) IsASIToFPInst() (rv Value) { rv.C = C.LLVMIsASIToFPInst(v.C); return }
715 func (v Value) IsATruncInst() (rv Value) { rv.C = C.LLVMIsATruncInst(v.C); return }
716 func (v Value) IsAUIToFPInst() (rv Value) { rv.C = C.LLVMIsAUIToFPInst(v.C); return }
717 func (v Value) IsAZExtInst() (rv Value) { rv.C = C.LLVMIsAZExtInst(v.C); return }
718 func (v Value) IsAExtractValueInst() (rv Value) { rv.C = C.LLVMIsAExtractValueInst(v.C); return }
719 func (v Value) IsALoadInst() (rv Value) { rv.C = C.LLVMIsALoadInst(v.C); return }
720 func (v Value) IsAVAArgInst() (rv Value) { rv.C = C.LLVMIsAVAArgInst(v.C); return }
723 func (v Value) FirstUse() (u Use) { u.C = C.LLVMGetFirstUse(v.C); return }
724 func (u Use) NextUse() (ru Use) { ru.C = C.LLVMGetNextUse(u.C); return }
725 func (u Use) User() (v Value) { v.C = C.LLVMGetUser(u.C); return }
726 func (u Use) UsedValue() (v Value) { v.C = C.LLVMGetUsedValue(u.C); return }
729 func (v Value) Operand(i int) (rv Value) { rv.C = C.LLVMGetOperand(v.C, C.unsigned(i)); return }
730 func (v Value) SetOperand(i int, op Value) { C.LLVMSetOperand(v.C, C.unsigned(i), op.C) }
731 func (v Value) OperandsCount() int { return int(C.LLVMGetNumOperands(v.C)) }
734 func ConstNull(t Type) (v Value) { v.C = C.LLVMConstNull(t.C); return }
735 func ConstAllOnes(t Type) (v Value) { v.C = C.LLVMConstAllOnes(t.C); return }
736 func Undef(t Type) (v Value) { v.C = C.LLVMGetUndef(t.C); return }
737 func (v Value) IsConstant() bool { return C.LLVMIsConstant(v.C) != 0 }
738 func (v Value) IsNull() bool { return C.LLVMIsNull(v.C) != 0 }
739 func (v Value) IsUndef() bool { return C.LLVMIsUndef(v.C) != 0 }
740 func ConstPointerNull(t Type) (v Value) { v.C = C.LLVMConstPointerNull(t.C); return }
743 func (c Context) MDString(str string) (md Metadata) {
744 cstr := C.CString(str)
745 defer C.free(unsafe.Pointer(cstr))
746 md.C = C.LLVMMDString2(c.C, cstr, C.unsigned(len(str)))
749 func (c Context) MDNode(mds []Metadata) (md Metadata) {
751 md.C = C.LLVMMDNode2(c.C, ptr, nvals)
754 func (c Context) TemporaryMDNode(mds []Metadata) (md Metadata) {
756 md.C = C.LLVMTemporaryMDNode(c.C, ptr, nvals)
760 md.C = C.LLVMConstantAsMetadata(v.C)
766 v.C = C.LLVMConstInt(t.C,
767 C.ulonglong(n),
772 cstr := C.CString(str)
773 defer C.free(unsafe.Pointer(cstr))
774 v.C = C.LLVMConstIntOfString(t.C, cstr, C.uint8_t(radix))
778 v.C = C.LLVMConstReal(t.C, C.double(n))
782 cstr := C.CString(str)
783 defer C.free(unsafe.Pointer(cstr))
784 v.C = C.LLVMConstRealOfString(t.C, cstr)
788 func (v Value) ZExtValue() uint64 { return uint64(C.LLVMConstIntGetZExtValue(v.C)) }
789 func (v Value) SExtValue() int64 { return int64(C.LLVMConstIntGetSExtValue(v.C)) }
792 func (c Context) ConstString(str string, addnull bool) (v Value) {
793 cstr := C.CString(str)
794 defer C.free(unsafe.Pointer(cstr))
795 v.C = C.LLVMConstStringInContext(c.C, cstr,
796 C.unsigned(len(str)), boolToLLVMBool(!addnull))
799 func (c Context) ConstStruct(constVals []Value, packed bool) (v Value) {
801 v.C = C.LLVMConstStructInContext(c.C, ptr, nvals,
807 v.C = C.LLVMConstNamedStruct(t.C, ptr, nvals)
811 cstr := C.CString(str)
812 defer C.free(unsafe.Pointer(cstr))
813 v.C = C.LLVMConstString(cstr,
814 C.unsigned(len(str)), boolToLLVMBool(!addnull))
819 v.C = C.LLVMConstArray(t.C, ptr, nvals)
824 v.C = C.LLVMConstStruct(ptr, nvals, boolToLLVMBool(packed))
829 v.C = C.LLVMConstVector(ptr, nvals)
834 func (v Value) Opcode() Opcode { return Opcode(C.LLVMGetConstOpcode(v.C)) }
835 func (v Value) InstructionOpcode() Opcode { return Opcode(C.LLVMGetInstructionOpcode(v.C)) }
836 func AlignOf(t Type) (v Value) { v.C = C.LLVMAlignOf(t.C); return }
837 func SizeOf(t Type) (v Value) { v.C = C.LLVMSizeOf(t.C); return }
838 func ConstNeg(v Value) (rv Value) { rv.C = C.LLVMConstNeg(v.C); return }
839 func ConstNSWNeg(v Value) (rv Value) { rv.C = C.LLVMConstNSWNeg(v.C); return }
840 func ConstNUWNeg(v Value) (rv Value) { rv.C = C.LLVMConstNUWNeg(v.C); return }
841 func ConstFNeg(v Value) (rv Value) { rv.C = C.LLVMConstFNeg(v.C); return }
842 func ConstNot(v Value) (rv Value) { rv.C = C.LLVMConstNot(v.C); return }
843 func ConstAdd(lhs, rhs Value) (v Value) { v.C = C.LLVMConstAdd(lhs.C, rhs.C); return }
844 func ConstNSWAdd(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNSWAdd(lhs.C, rhs.C); return }
845 func ConstNUWAdd(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNUWAdd(lhs.C, rhs.C); return }
846 func ConstFAdd(lhs, rhs Value) (v Value) { v.C = C.LLVMConstFAdd(lhs.C, rhs.C); return }
847 func ConstSub(lhs, rhs Value) (v Value) { v.C = C.LLVMConstSub(lhs.C, rhs.C); return }
848 func ConstNSWSub(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNSWSub(lhs.C, rhs.C); return }
849 func ConstNUWSub(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNUWSub(lhs.C, rhs.C); return }
850 func ConstFSub(lhs, rhs Value) (v Value) { v.C = C.LLVMConstFSub(lhs.C, rhs.C); return }
851 func ConstMul(lhs, rhs Value) (v Value) { v.C = C.LLVMConstMul(lhs.C, rhs.C); return }
852 func ConstNSWMul(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNSWMul(lhs.C, rhs.C); return }
853 func ConstNUWMul(lhs, rhs Value) (v Value) { v.C = C.LLVMConstNUWMul(lhs.C, rhs.C); return }
854 func ConstFMul(lhs, rhs Value) (v Value) { v.C = C.LLVMConstFMul(lhs.C, rhs.C); return }
855 func ConstUDiv(lhs, rhs Value) (v Value) { v.C = C.LLVMConstUDiv(lhs.C, rhs.C); return }
856 func ConstSDiv(lhs, rhs Value) (v Value) { v.C = C.LLVMConstSDiv(lhs.C, rhs.C); return }
857 func ConstExactSDiv(lhs, rhs Value) (v Value) { v.C = C.LLVMConstExactSDiv(lhs.C, rhs.C); return }
858 func ConstFDiv(lhs, rhs Value) (v Value) { v.C = C.LLVMConstFDiv(lhs.C, rhs.C); return }
859 func ConstURem(lhs, rhs Value) (v Value) { v.C = C.LLVMConstURem(lhs.C, rhs.C); return }
860 func ConstSRem(lhs, rhs Value) (v Value) { v.C = C.LLVMConstSRem(lhs.C, rhs.C); return }
861 func ConstFRem(lhs, rhs Value) (v Value) { v.C = C.LLVMConstFRem(lhs.C, rhs.C); return }
862 func ConstAnd(lhs, rhs Value) (v Value) { v.C = C.LLVMConstAnd(lhs.C, rhs.C); return }
863 func ConstOr(lhs, rhs Value) (v Value) { v.C = C.LLVMConstOr(lhs.C, rhs.C); return }
864 func ConstXor(lhs, rhs Value) (v Value) { v.C = C.LLVMConstXor(lhs.C, rhs.C); return }
867 v.C = C.LLVMConstICmp(C.LLVMIntPredicate(pred), lhs.C, rhs.C)
871 v.C = C.LLVMConstFCmp(C.LLVMRealPredicate(pred), lhs.C, rhs.C)
875 func ConstShl(lhs, rhs Value) (v Value) { v.C = C.LLVMConstShl(lhs.C, rhs.C); return }
876 func ConstLShr(lhs, rhs Value) (v Value) { v.C = C.LLVMConstLShr(lhs.C, rhs.C); return }
877 func ConstAShr(lhs, rhs Value) (v Value) { v.C = C.LLVMConstAShr(lhs.C, rhs.C); return }
881 rv.C = C.LLVMConstGEP(v.C, ptr, nvals)
886 rv.C = C.LLVMConstInBoundsGEP(v.C, ptr, nvals)
889 func ConstTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstTrunc(v.C, t.C); return }
890 func ConstSExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSExt(v.C, t.C); return }
891 func ConstZExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstZExt(v.C, t.C); return }
892 func ConstFPTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPTrunc(v.C, t.C); return }
893 func ConstFPExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPExt(v.C, t.C); return }
894 func ConstUIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstUIToFP(v.C, t.C); return }
895 func ConstSIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSIToFP(v.C, t.C); return }
896 func ConstFPToUI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToUI(v.C, t.C); return }
897 func ConstFPToSI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToSI(v.C, t.C); return }
898 func ConstPtrToInt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstPtrToInt(v.C, t.C); return }
899 func ConstIntToPtr(v Value, t Type) (rv Value) { rv.C = C.LLVMConstIntToPtr(v.C, t.C); return }
900 func ConstBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstBitCast(v.C, t.C); return }
901 func ConstZExtOrBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstZExtOrBitCast(v.C, t.C); re…
902 func ConstSExtOrBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSExtOrBitCast(v.C, t.C); re…
904 rv.C = C.LLVMConstTruncOrBitCast(v.C, t.C)
907 func ConstPointerCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstPointerCast(v.C, t.C); return…
909 rv.C = C.LLVMConstIntCast(v.C, t.C, boolToLLVMBool(signed))
912 func ConstFPCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPCast(v.C, t.C); return }
914 rv.C = C.LLVMConstSelect(cond.C, iftrue.C, iffalse.C)
918 rv.C = C.LLVMConstExtractElement(vec.C, i.C)
922 rv.C = C.LLVMConstInsertElement(vec.C, elem.C, i.C)
926 rv.C = C.LLVMConstShuffleVector(veca.C, vecb.C, mask.C)
939 ptr := (*C.unsigned)(&indices[0])
940 rv.C = C.LLVMConstExtractValue(agg.C, ptr, C.unsigned(n))
949 ptr := (*C.unsigned)(&indices[0])
950 rv.C = C.LLVMConstInsertValue(agg.C, val.C, ptr, C.unsigned(n))
955 v.C = C.LLVMBlockAddress(f.C, bb.C)
960 func (v Value) GlobalParent() (m Module) { m.C = C.LLVMGetGlobalParent(v.C); return }
961 func (v Value) IsDeclaration() bool { return C.LLVMIsDeclaration(v.C) != 0 }
962 func (v Value) Linkage() Linkage { return Linkage(C.LLVMGetLinkage(v.C)) }
963 func (v Value) SetLinkage(l Linkage) { C.LLVMSetLinkage(v.C, C.LLVMLinkage(l)) }
964 func (v Value) Section() string { return C.GoString(C.LLVMGetSection(v.C)) }
966 cstr := C.CString(str)
967 defer C.free(unsafe.Pointer(cstr))
968 C.LLVMSetSection(v.C, cstr)
970 func (v Value) Visibility() Visibility { return Visibility(C.LLVMGetVisibility(v.C)) }
971 func (v Value) SetVisibility(vi Visibility) { C.LLVMSetVisibility(v.C, C.LLVMVisibility(vi)) }
972 func (v Value) Alignment() int { return int(C.LLVMGetAlignment(v.C)) }
973 func (v Value) SetAlignment(a int) { C.LLVMSetAlignment(v.C, C.unsigned(a)) }
974 func (v Value) SetUnnamedAddr(ua bool) { C.LLVMSetUnnamedAddr(v.C, boolToLLVMBool(ua)) }
978 cname := C.CString(name)
979 defer C.free(unsafe.Pointer(cname))
980 v.C = C.LLVMAddGlobal(m.C, t.C, cname)
984 cname := C.CString(name)
985 defer C.free(unsafe.Pointer(cname))
986 v.C = C.LLVMAddGlobalInAddressSpace(m.C, t.C, cname, C.unsigned(addressSpace))
990 cname := C.CString(name)
991 defer C.free(unsafe.Pointer(cname))
992 v.C = C.LLVMGetNamedGlobal(m.C, cname)
996 func (m Module) FirstGlobal() (v Value) { v.C = C.LLVMGetFirstGlobal(m.C); return }
997 func (m Module) LastGlobal() (v Value) { v.C = C.LLVMGetLastGlobal(m.C); return }
998 func NextGlobal(v Value) (rv Value) { rv.C = C.LLVMGetNextGlobal(v.C); return }
999 func PrevGlobal(v Value) (rv Value) { rv.C = C.LLVMGetPreviousGlobal(v.C); return }
1000 func (v Value) EraseFromParentAsGlobal() { C.LLVMDeleteGlobal(v.C) }
1001 func (v Value) Initializer() (rv Value) { rv.C = C.LLVMGetInitializer(v.C); return }
1002 func (v Value) SetInitializer(cv Value) { C.LLVMSetInitializer(v.C, cv.C) }
1003 func (v Value) IsThreadLocal() bool { return C.LLVMIsThreadLocal(v.C) != 0 }
1004 func (v Value) SetThreadLocal(tl bool) { C.LLVMSetThreadLocal(v.C, boolToLLVMBool(tl)) }
1005 func (v Value) IsGlobalConstant() bool { return C.LLVMIsGlobalConstant(v.C) != 0 }
1006 func (v Value) SetGlobalConstant(gc bool) { C.LLVMSetGlobalConstant(v.C, boolToLLVMBool(gc)) }
1010 cname := C.CString(name)
1011 defer C.free(unsafe.Pointer(cname))
1012 v.C = C.LLVMAddAlias(m.C, t.C, aliasee.C, cname)
1018 cname := C.CString(name)
1019 defer C.free(unsafe.Pointer(cname))
1020 v.C = C.LLVMAddFunction(m.C, cname, ft.C)
1025 cname := C.CString(name)
1026 defer C.free(unsafe.Pointer(cname))
1027 v.C = C.LLVMGetNamedFunction(m.C, cname)
1031 func (m Module) FirstFunction() (v Value) { v.C = C.LLVMGetFirstFunction(m.C); return }
1032 func (m Module) LastFunction() (v Value) { v.C = C.LLVMGetLastFunction(m.C); return }
1033 func NextFunction(v Value) (rv Value) { rv.C = C.LLVMGetNextFunction(v.C); return }
1034 func PrevFunction(v Value) (rv Value) { rv.C = C.LLVMGetPreviousFunction(v.C); return }
1035 func (v Value) EraseFromParentAsFunction() { C.LLVMDeleteFunction(v.C) }
1036 func (v Value) IntrinsicID() int { return int(C.LLVMGetIntrinsicID(v.C)) }
1038 return CallConv(C.LLVMCallConv(C.LLVMGetFunctionCallConv(v.C)))
1040 func (v Value) SetFunctionCallConv(cc CallConv) { C.LLVMSetFunctionCallConv(v.C, C.unsigned(cc)) }
1041 func (v Value) GC() string { return C.GoString(C.LLVMGetGC(v.C)) }
1043 cname := C.CString(name)
1044 defer C.free(unsafe.Pointer(cname))
1045 C.LLVMSetGC(v.C, cname)
1047 func (v Value) AddFunctionAttr(a Attribute) { C.LLVMAddFunctionAttr2(v.C, C.uint64_t(a)) }
1048 func (v Value) FunctionAttr() Attribute { return Attribute(C.LLVMGetFunctionAttr2(v.C)) }
1049 func (v Value) RemoveFunctionAttr(a Attribute) { C.LLVMRemoveFunctionAttr2(v.C, C.uint64_t(a)) }
1051 cattr := C.CString(attr)
1052 defer C.free(unsafe.Pointer(cattr))
1053 cvalue := C.CString(value)
1054 defer C.free(unsafe.Pointer(cvalue))
1055 C.LLVMAddTargetDependentFunctionAttr(v.C, cattr, cvalue)
1058 C.LLVMSetPersonalityFn(v.C, p.C)
1061 C.LLVMSetSubprogram(v.C, sp.C)
1065 func (v Value) ParamsCount() int { return int(C.LLVMCountParams(v.C)) }
1069 C.LLVMGetParams(v.C, llvmValueRefPtr(&out[0]))
1073 func (v Value) Param(i int) (rv Value) { rv.C = C.LLVMGetParam(v.C, C.unsigned(i)); return }
1074 func (v Value) ParamParent() (rv Value) { rv.C = C.LLVMGetParamParent(v.C); return }
1075 func (v Value) FirstParam() (rv Value) { rv.C = C.LLVMGetFirstParam(v.C); return }
1076 func (v Value) LastParam() (rv Value) { rv.C = C.LLVMGetLastParam(v.C); return }
1077 func NextParam(v Value) (rv Value) { rv.C = C.LLVMGetNextParam(v.C); return }
1078 func PrevParam(v Value) (rv Value) { rv.C = C.LLVMGetPreviousParam(v.C); return }
1083 C.LLVMAddAttribute(v.C, C.LLVMAttribute(a))
1089 C.LLVMRemoveAttribute(v.C, C.LLVMAttribute(a))
1091 func (v Value) Attribute() Attribute { return Attribute(C.LLVMGetAttribute(v.C)) }
1092 func (v Value) SetParamAlignment(align int) { C.LLVMSetParamAlignment(v.C, C.unsigned(align)) }
1095 func (bb BasicBlock) AsValue() (v Value) { v.C = C.LLVMBasicBlockAsValue(bb.C); return }
1096 func (v Value) IsBasicBlock() bool { return C.LLVMValueIsBasicBlock(v.C) != 0 }
1097 func (v Value) AsBasicBlock() (bb BasicBlock) { bb.C = C.LLVMValueAsBasicBlock(v.C); return }
1098 func (bb BasicBlock) Parent() (v Value) { v.C = C.LLVMGetBasicBlockParent(bb.C); return }
1099 func (v Value) BasicBlocksCount() int { return int(C.LLVMCountBasicBlocks(v.C)) }
1102 C.LLVMGetBasicBlocks(v.C, llvmBasicBlockRefPtr(&out[0]))
1105 func (v Value) FirstBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetFirstBasicBlock(v.C); return }
1106 func (v Value) LastBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetLastBasicBlock(v.C); return }
1107 func NextBasicBlock(bb BasicBlock) (rbb BasicBlock) { rbb.C = C.LLVMGetNextBasicBlock(bb.C); return…
1108 func PrevBasicBlock(bb BasicBlock) (rbb BasicBlock) { rbb.C = C.LLVMGetPreviousBasicBlock(bb.C); re…
1109 func (v Value) EntryBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetEntryBasicBlock(v.C); return }
1110 func (c Context) AddBasicBlock(f Value, name string) (bb BasicBlock) {
1111 cname := C.CString(name)
1112 defer C.free(unsafe.Pointer(cname))
1113 bb.C = C.LLVMAppendBasicBlockInContext(c.C, f.C, cname)
1116 func (c Context) InsertBasicBlock(ref BasicBlock, name string) (bb BasicBlock) {
1117 cname := C.CString(name)
1118 defer C.free(unsafe.Pointer(cname))
1119 bb.C = C.LLVMInsertBasicBlockInContext(c.C, ref.C, cname)
1123 cname := C.CString(name)
1124 defer C.free(unsafe.Pointer(cname))
1125 bb.C = C.LLVMAppendBasicBlock(f.C, cname)
1129 cname := C.CString(name)
1130 defer C.free(unsafe.Pointer(cname))
1131 bb.C = C.LLVMInsertBasicBlock(ref.C, cname)
1134 func (bb BasicBlock) EraseFromParent() { C.LLVMDeleteBasicBlock(bb.C) }
1135 func (bb BasicBlock) MoveBefore(pos BasicBlock) { C.LLVMMoveBasicBlockBefore(bb.C, pos.C) }
1136 func (bb BasicBlock) MoveAfter(pos BasicBlock) { C.LLVMMoveBasicBlockAfter(bb.C, pos.C) }
1139 func (v Value) InstructionParent() (bb BasicBlock) { bb.C = C.LLVMGetInstructionParent(v.C); return…
1140 func (bb BasicBlock) FirstInstruction() (v Value) { v.C = C.LLVMGetFirstInstruction(bb.C); return }
1141 func (bb BasicBlock) LastInstruction() (v Value) { v.C = C.LLVMGetLastInstruction(bb.C); return }
1142 func NextInstruction(v Value) (rv Value) { rv.C = C.LLVMGetNextInstruction(v.C); return }
1143 func PrevInstruction(v Value) (rv Value) { rv.C = C.LLVMGetPreviousInstruction(v.C); retu…
1147 C.LLVMSetInstructionCallConv(v.C, C.unsigned(cc))
1150 return CallConv(C.LLVMCallConv(C.LLVMGetInstructionCallConv(v.C)))
1156 C.LLVMAddInstrAttribute(v.C, C.unsigned(i), C.LLVMAttribute(a))
1162 C.LLVMRemoveInstrAttribute(v.C, C.unsigned(i), C.LLVMAttribute(a))
1165 C.LLVMSetInstrParamAlignment(v.C, C.unsigned(i), C.unsigned(align))
1169 func (v Value) IsTailCall() bool { return C.LLVMIsTailCall(v.C) != 0 }
1170 func (v Value) SetTailCall(is bool) { C.LLVMSetTailCall(v.C, boolToLLVMBool(is)) }
1175 C.LLVMAddIncoming(v.C, ptr, llvmBasicBlockRefPtr(&blocks[0]), nvals)
1177 func (v Value) IncomingCount() int { return int(C.LLVMCountIncoming(v.C)) }
1179 rv.C = C.LLVMGetIncomingValue(v.C, C.unsigned(i))
1183 bb.C = C.LLVMGetIncomingBlock(v.C, C.unsigned(i))
1192 // exclusive means of building instructions using the C interface.
1194 func (c Context) NewBuilder() (b Builder) { b.C = C.LLVMCreateBuilderInContext(c.C); return }
1195 func NewBuilder() (b Builder) { b.C = C.LLVMCreateBuilder(); return }
1197 C.LLVMPositionBuilder(b.C, block.C, instr.C)
1199 func (b Builder) SetInsertPointBefore(instr Value) { C.LLVMPositionBuilderBefore(b.C, instr.C) }
1200 func (b Builder) SetInsertPointAtEnd(block BasicBlock) { C.LLVMPositionBuilderAtEnd(b.C, block.C) }
1201 func (b Builder) GetInsertBlock() (bb BasicBlock) { bb.C = C.LLVMGetInsertBlock(b.C); return }
1202 func (b Builder) ClearInsertionPoint() { C.LLVMClearInsertionPosition(b.C) }
1203 func (b Builder) Insert(instr Value) { C.LLVMInsertIntoBuilder(b.C, instr.C) }
1205 cname := C.CString(name)
1206 defer C.free(unsafe.Pointer(cname))
1207 C.LLVMInsertIntoBuilderWithName(b.C, instr.C, cname)
1209 func (b Builder) Dispose() { C.LLVMDisposeBuilder(b.C) }
1213 C.LLVMSetCurrentDebugLocation2(b.C, C.unsigned(line), C.unsigned(col), scope.C, inlinedAt.C)
1215 func (b Builder) SetInstDebugLocation(v Value) { C.LLVMSetInstDebugLocation(b.C, v.C) }
1226 func (b Builder) CreateRetVoid() (rv Value) { rv.C = C.LLVMBuildRetVoid(b.C); return }
1227 func (b Builder) CreateRet(v Value) (rv Value) { rv.C = C.LLVMBuildRet(b.C, v.C); return }
1230 rv.C = C.LLVMBuildAggregateRet(b.C, ptr, nvals)
1233 func (b Builder) CreateBr(bb BasicBlock) (rv Value) { rv.C = C.LLVMBuildBr(b.C, bb.C); return }
1235 rv.C = C.LLVMBuildCondBr(b.C, ifv.C, thenb.C, elseb.C)
1239 rv.C = C.LLVMBuildSwitch(b.C, v.C, elseb.C, C.unsigned(numCases))
1243 rv.C = C.LLVMBuildIndirectBr(b.C, addr.C, C.unsigned(numDests))
1247 cname := C.CString(name)
1248 defer C.free(unsafe.Pointer(cname))
1250 rv.C = C.LLVMBuildInvoke(b.C, fn.C, ptr, nvals, then.C, catch.C, cname)
1253 func (b Builder) CreateUnreachable() (rv Value) { rv.C = C.LLVMBuildUnreachable(b.C); return }
1256 func (v Value) AddCase(on Value, dest BasicBlock) { C.LLVMAddCase(v.C, on.C, dest.C) }
1259 func (v Value) AddDest(dest BasicBlock) { C.LLVMAddDestination(v.C, dest.C) }
1263 cname := C.CString(name)
1264 defer C.free(unsafe.Pointer(cname))
1265 v.C = C.LLVMBuildAdd(b.C, lhs.C, rhs.C, cname)
1269 cname := C.CString(name)
1270 defer C.free(unsafe.Pointer(cname))
1271 v.C = C.LLVMBuildNSWAdd(b.C, lhs.C, rhs.C, cname)
1275 cname := C.CString(name)
1276 defer C.free(unsafe.Pointer(cname))
1277 v.C = C.LLVMBuildNUWAdd(b.C, lhs.C, rhs.C, cname)
1281 cname := C.CString(name)
1282 defer C.free(unsafe.Pointer(cname))
1283 v.C = C.LLVMBuildFAdd(b.C, lhs.C, rhs.C, cname)
1287 cname := C.CString(name)
1288 defer C.free(unsafe.Pointer(cname))
1289 v.C = C.LLVMBuildSub(b.C, lhs.C, rhs.C, cname)
1293 cname := C.CString(name)
1294 defer C.free(unsafe.Pointer(cname))
1295 v.C = C.LLVMBuildNSWSub(b.C, lhs.C, rhs.C, cname)
1299 cname := C.CString(name)
1300 defer C.free(unsafe.Pointer(cname))
1301 v.C = C.LLVMBuildNUWSub(b.C, lhs.C, rhs.C, cname)
1305 cname := C.CString(name)
1306 v.C = C.LLVMBuildFSub(b.C, lhs.C, rhs.C, cname)
1307 C.free(unsafe.Pointer(cname))
1311 cname := C.CString(name)
1312 defer C.free(unsafe.Pointer(cname))
1313 v.C = C.LLVMBuildMul(b.C, lhs.C, rhs.C, cname)
1317 cname := C.CString(name)
1318 defer C.free(unsafe.Pointer(cname))
1319 v.C = C.LLVMBuildNSWMul(b.C, lhs.C, rhs.C, cname)
1323 cname := C.CString(name)
1324 defer C.free(unsafe.Pointer(cname))
1325 v.C = C.LLVMBuildNUWMul(b.C, lhs.C, rhs.C, cname)
1329 cname := C.CString(name)
1330 defer C.free(unsafe.Pointer(cname))
1331 v.C = C.LLVMBuildFMul(b.C, lhs.C, rhs.C, cname)
1335 cname := C.CString(name)
1336 defer C.free(unsafe.Pointer(cname))
1337 v.C = C.LLVMBuildUDiv(b.C, lhs.C, rhs.C, cname)
1341 cname := C.CString(name)
1342 defer C.free(unsafe.Pointer(cname))
1343 v.C = C.LLVMBuildSDiv(b.C, lhs.C, rhs.C, cname)
1347 cname := C.CString(name)
1348 defer C.free(unsafe.Pointer(cname))
1349 v.C = C.LLVMBuildExactSDiv(b.C, lhs.C, rhs.C, cname)
1353 cname := C.CString(name)
1354 defer C.free(unsafe.Pointer(cname))
1355 v.C = C.LLVMBuildFDiv(b.C, lhs.C, rhs.C, cname)
1359 cname := C.CString(name)
1360 defer C.free(unsafe.Pointer(cname))
1361 v.C = C.LLVMBuildURem(b.C, lhs.C, rhs.C, cname)
1365 cname := C.CString(name)
1366 defer C.free(unsafe.Pointer(cname))
1367 v.C = C.LLVMBuildSRem(b.C, lhs.C, rhs.C, cname)
1371 cname := C.CString(name)
1372 defer C.free(unsafe.Pointer(cname))
1373 v.C = C.LLVMBuildFRem(b.C, lhs.C, rhs.C, cname)
1377 cname := C.CString(name)
1378 defer C.free(unsafe.Pointer(cname))
1379 v.C = C.LLVMBuildShl(b.C, lhs.C, rhs.C, cname)
1383 cname := C.CString(name)
1384 defer C.free(unsafe.Pointer(cname))
1385 v.C = C.LLVMBuildLShr(b.C, lhs.C, rhs.C, cname)
1389 cname := C.CString(name)
1390 defer C.free(unsafe.Pointer(cname))
1391 v.C = C.LLVMBuildAShr(b.C, lhs.C, rhs.C, cname)
1395 cname := C.CString(name)
1396 defer C.free(unsafe.Pointer(cname))
1397 v.C = C.LLVMBuildAnd(b.C, lhs.C, rhs.C, cname)
1401 cname := C.CString(name)
1402 defer C.free(unsafe.Pointer(cname))
1403 v.C = C.LLVMBuildOr(b.C, lhs.C, rhs.C, cname)
1407 cname := C.CString(name)
1408 defer C.free(unsafe.Pointer(cname))
1409 v.C = C.LLVMBuildXor(b.C, lhs.C, rhs.C, cname)
1413 cname := C.CString(name)
1414 defer C.free(unsafe.Pointer(cname))
1415 v.C = C.LLVMBuildBinOp(b.C, C.LLVMOpcode(op), lhs.C, rhs.C, cname)
1419 cname := C.CString(name)
1420 defer C.free(unsafe.Pointer(cname))
1421 rv.C = C.LLVMBuildNeg(b.C, v.C, cname)
1425 cname := C.CString(name)
1426 defer C.free(unsafe.Pointer(cname))
1427 rv.C = C.LLVMBuildNSWNeg(b.C, v.C, cname)
1431 cname := C.CString(name)
1432 defer C.free(unsafe.Pointer(cname))
1433 rv.C = C.LLVMBuildNUWNeg(b.C, v.C, cname)
1437 cname := C.CString(name)
1438 defer C.free(unsafe.Pointer(cname))
1439 rv.C = C.LLVMBuildFNeg(b.C, v.C, cname)
1443 cname := C.CString(name)
1444 defer C.free(unsafe.Pointer(cname))
1445 rv.C = C.LLVMBuildNot(b.C, v.C, cname)
1452 cname := C.CString(name)
1453 defer C.free(unsafe.Pointer(cname))
1454 v.C = C.LLVMBuildMalloc(b.C, t.C, cname)
1458 cname := C.CString(name)
1459 defer C.free(unsafe.Pointer(cname))
1460 v.C = C.LLVMBuildArrayMalloc(b.C, t.C, val.C, cname)
1464 cname := C.CString(name)
1465 defer C.free(unsafe.Pointer(cname))
1466 v.C = C.LLVMBuildAlloca(b.C, t.C, cname)
1470 cname := C.CString(name)
1471 defer C.free(unsafe.Pointer(cname))
1472 v.C = C.LLVMBuildArrayAlloca(b.C, t.C, val.C, cname)
1476 v.C = C.LLVMBuildFree(b.C, p.C)
1480 cname := C.CString(name)
1481 defer C.free(unsafe.Pointer(cname))
1482 v.C = C.LLVMBuildLoad(b.C, p.C, cname)
1486 v.C = C.LLVMBuildStore(b.C, val.C, p.C)
1490 cname := C.CString(name)
1491 defer C.free(unsafe.Pointer(cname))
1493 v.C = C.LLVMBuildGEP(b.C, p.C, ptr, nvals, cname)
1497 cname := C.CString(name)
1498 defer C.free(unsafe.Pointer(cname))
1500 v.C = C.LLVMBuildInBoundsGEP(b.C, p.C, ptr, nvals, cname)
1504 cname := C.CString(name)
1505 defer C.free(unsafe.Pointer(cname))
1506 v.C = C.LLVMBuildStructGEP(b.C, p.C, C.unsigned(i), cname)
1510 cstr := C.CString(str)
1511 defer C.free(unsafe.Pointer(cstr))
1512 cname := C.CString(name)
1513 defer C.free(unsafe.Pointer(cname))
1514 v.C = C.LLVMBuildGlobalString(b.C, cstr, cname)
1518 cstr := C.CString(str)
1519 defer C.free(unsafe.Pointer(cstr))
1520 cname := C.CString(name)
1521 defer C.free(unsafe.Pointer(cname))
1522 v.C = C.LLVMBuildGlobalStringPtr(b.C, cstr, cname)
1528 cname := C.CString(name)
1529 defer C.free(unsafe.Pointer(cname))
1530 v.C = C.LLVMBuildTrunc(b.C, val.C, t.C, cname)
1534 cname := C.CString(name)
1535 defer C.free(unsafe.Pointer(cname))
1536 v.C = C.LLVMBuildZExt(b.C, val.C, t.C, cname)
1540 cname := C.CString(name)
1541 defer C.free(unsafe.Pointer(cname))
1542 v.C = C.LLVMBuildSExt(b.C, val.C, t.C, cname)
1546 cname := C.CString(name)
1547 defer C.free(unsafe.Pointer(cname))
1548 v.C = C.LLVMBuildFPToUI(b.C, val.C, t.C, cname)
1552 cname := C.CString(name)
1553 defer C.free(unsafe.Pointer(cname))
1554 v.C = C.LLVMBuildFPToSI(b.C, val.C, t.C, cname)
1558 cname := C.CString(name)
1559 defer C.free(unsafe.Pointer(cname))
1560 v.C = C.LLVMBuildUIToFP(b.C, val.C, t.C, cname)
1564 cname := C.CString(name)
1565 defer C.free(unsafe.Pointer(cname))
1566 v.C = C.LLVMBuildSIToFP(b.C, val.C, t.C, cname)
1570 cname := C.CString(name)
1571 defer C.free(unsafe.Pointer(cname))
1572 v.C = C.LLVMBuildFPTrunc(b.C, val.C, t.C, cname)
1576 cname := C.CString(name)
1577 defer C.free(unsafe.Pointer(cname))
1578 v.C = C.LLVMBuildFPExt(b.C, val.C, t.C, cname)
1582 cname := C.CString(name)
1583 defer C.free(unsafe.Pointer(cname))
1584 v.C = C.LLVMBuildPtrToInt(b.C, val.C, t.C, cname)
1588 cname := C.CString(name)
1589 defer C.free(unsafe.Pointer(cname))
1590 v.C = C.LLVMBuildIntToPtr(b.C, val.C, t.C, cname)
1594 cname := C.CString(name)
1595 defer C.free(unsafe.Pointer(cname))
1596 v.C = C.LLVMBuildBitCast(b.C, val.C, t.C, cname)
1600 cname := C.CString(name)
1601 defer C.free(unsafe.Pointer(cname))
1602 v.C = C.LLVMBuildZExtOrBitCast(b.C, val.C, t.C, cname)
1606 cname := C.CString(name)
1607 defer C.free(unsafe.Pointer(cname))
1608 v.C = C.LLVMBuildSExtOrBitCast(b.C, val.C, t.C, cname)
1612 cname := C.CString(name)
1613 defer C.free(unsafe.Pointer(cname))
1614 v.C = C.LLVMBuildTruncOrBitCast(b.C, val.C, t.C, cname)
1618 cname := C.CString(name)
1619 defer C.free(unsafe.Pointer(cname))
1620 v.C = C.LLVMBuildCast(b.C, C.LLVMOpcode(op), val.C, t.C, cname)
1624 cname := C.CString(name)
1625 defer C.free(unsafe.Pointer(cname))
1626 v.C = C.LLVMBuildPointerCast(b.C, val.C, t.C, cname)
1630 cname := C.CString(name)
1631 defer C.free(unsafe.Pointer(cname))
1632 v.C = C.LLVMBuildIntCast(b.C, val.C, t.C, cname)
1636 cname := C.CString(name)
1637 defer C.free(unsafe.Pointer(cname))
1638 v.C = C.LLVMBuildFPCast(b.C, val.C, t.C, cname)
1644 cname := C.CString(name)
1645 defer C.free(unsafe.Pointer(cname))
1646 v.C = C.LLVMBuildICmp(b.C, C.LLVMIntPredicate(pred), lhs.C, rhs.C, cname)
1650 cname := C.CString(name)
1651 defer C.free(unsafe.Pointer(cname))
1652 v.C = C.LLVMBuildFCmp(b.C, C.LLVMRealPredicate(pred), lhs.C, rhs.C, cname)
1658 cname := C.CString(name)
1659 defer C.free(unsafe.Pointer(cname))
1660 v.C = C.LLVMBuildPhi(b.C, t.C, cname)
1664 cname := C.CString(name)
1665 defer C.free(unsafe.Pointer(cname))
1667 v.C = C.LLVMBuildCall(b.C, fn.C, ptr, nvals, cname)
1672 cname := C.CString(name)
1673 defer C.free(unsafe.Pointer(cname))
1674 v.C = C.LLVMBuildSelect(b.C, ifv.C, thenv.C, elsev.C, cname)
1679 cname := C.CString(name)
1680 defer C.free(unsafe.Pointer(cname))
1681 v.C = C.LLVMBuildVAArg(b.C, list.C, t.C, cname)
1685 cname := C.CString(name)
1686 defer C.free(unsafe.Pointer(cname))
1687 v.C = C.LLVMBuildExtractElement(b.C, vec.C, i.C, cname)
1691 cname := C.CString(name)
1692 defer C.free(unsafe.Pointer(cname))
1693 v.C = C.LLVMBuildInsertElement(b.C, vec.C, elt.C, i.C, cname)
1697 cname := C.CString(name)
1698 defer C.free(unsafe.Pointer(cname))
1699 v.C = C.LLVMBuildShuffleVector(b.C, v1.C, v2.C, mask.C, cname)
1703 cname := C.CString(name)
1704 defer C.free(unsafe.Pointer(cname))
1705 v.C = C.LLVMBuildExtractValue(b.C, agg.C, C.unsigned(i), cname)
1709 cname := C.CString(name)
1710 defer C.free(unsafe.Pointer(cname))
1711 v.C = C.LLVMBuildInsertValue(b.C, agg.C, elt.C, C.unsigned(i), cname)
1716 cname := C.CString(name)
1717 defer C.free(unsafe.Pointer(cname))
1718 v.C = C.LLVMBuildIsNull(b.C, val.C, cname)
1722 cname := C.CString(name)
1723 defer C.free(unsafe.Pointer(cname))
1724 v.C = C.LLVMBuildIsNotNull(b.C, val.C, cname)
1728 cname := C.CString(name)
1729 defer C.free(unsafe.Pointer(cname))
1730 v.C = C.LLVMBuildPtrDiff(b.C, lhs.C, rhs.C, cname)
1735 cname := C.CString(name)
1736 defer C.free(unsafe.Pointer(cname))
1737 l.C = C.LLVMBuildLandingPad(b.C, t.C, nil, C.unsigned(nclauses), cname)
1742 C.LLVMAddClause(l.C, v.C)
1746 C.LLVMSetCleanup(l.C, boolToLLVMBool(cleanup))
1750 v.C = C.LLVMBuildResume(b.C, ex.C)
1761 mp.C = C.LLVMCreateModuleProviderForExistingModule(m.C)
1766 func (mp ModuleProvider) Dispose() { C.LLVMDisposeModuleProvider(mp.C) }
1773 var cmsg *C.char
1774 cpath := C.CString(path)
1775 defer C.free(unsafe.Pointer(cpath))
1776 fail := C.LLVMCreateMemoryBufferWithContentsOfFile(cpath, &b.C, &cmsg)
1778 b.C = nil
1779 err = errors.New(C.GoString(cmsg))
1780 C.LLVMDisposeMessage(cmsg)
1786 var cmsg *C.char
1787 fail := C.LLVMCreateMemoryBufferWithSTDIN(&b.C, &cmsg)
1789 b.C = nil
1790 err = errors.New(C.GoString(cmsg))
1791 C.LLVMDisposeMessage(cmsg)
1797 cstart := C.LLVMGetBufferStart(b.C)
1798 csize := C.LLVMGetBufferSize(b.C)
1799 return C.GoBytes(unsafe.Pointer(cstart), C.int(csize))
1802 func (b MemoryBuffer) Dispose() { C.LLVMDisposeMemoryBuffer(b.C) }
1811 func NewPassManager() (pm PassManager) { pm.C = C.LLVMCreatePassManager(); return }
1818 pm.C = C.LLVMCreateFunctionPassManagerForModule(m.C)
1825 func (pm PassManager) Run(m Module) bool { return C.LLVMRunPassManager(pm.C, m.C) != 0 }
1830 func (pm PassManager) InitializeFunc() bool { return C.LLVMInitializeFunctionPassManager(pm.C) != 0…
1836 func (pm PassManager) RunFunc(f Value) bool { return C.LLVMRunFunctionPassManager(pm.C, f.C) != 0 }
1841 func (pm PassManager) FinalizeFunc() bool { return C.LLVMFinalizeFunctionPassManager(pm.C) != 0 }
1846 func (pm PassManager) Dispose() { C.LLVMDisposePassManager(pm.C) }
1853 C.LLVMMetadataReplaceAllUsesWith(md.C, new.C)