1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use debuginfo
::{DIBuilderRef
, DIDescriptor
,
12 DIFile
, DILexicalBlock
, DISubprogram
, DIType
,
13 DIBasicType
, DIDerivedType
, DICompositeType
, DIScope
,
14 DIVariable
, DIGlobalVariable
, DIArray
, DISubrange
,
15 DITemplateTypeParameter
, DIEnumerator
, DINameSpace
};
17 use libc
::{c_uint, c_int, size_t, c_char}
;
18 use libc
::{c_longlong, c_ulonglong, c_void}
;
22 pub type Opcode
= u32;
23 pub type Bool
= c_uint
;
25 pub const True
: Bool
= 1 as Bool
;
26 pub const False
: Bool
= 0 as Bool
;
28 #[derive(Copy, Clone, PartialEq)]
30 pub enum LLVMRustResult
{
34 // Consts for the LLVM CallConv type, pre-cast to usize.
36 /// LLVM CallingConv::ID. Should we wrap this?
37 #[derive(Copy, Clone, PartialEq)]
43 X86StdcallCallConv
= 64,
44 X86FastcallCallConv
= 65,
51 /// This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
52 /// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
53 /// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
54 /// they've been removed in upstream LLVM commit r203866.
55 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
59 AvailableExternallyLinkage
= 1,
60 LinkOnceAnyLinkage
= 2,
61 LinkOnceODRLinkage
= 3,
67 ExternalWeakLinkage
= 12,
71 /// LLVMDiagnosticSeverity
72 #[derive(Copy, Clone, Debug)]
74 pub enum DiagnosticSeverity
{
81 /// LLVMDLLStorageClass
82 #[derive(Copy, Clone)]
84 pub enum DLLStorageClass
{
86 DllImport
= 1, /* Function to be imported from DLL. */
87 DllExport
= 2, /* Function to be accessible from DLL. */
91 #[derive(Default, Debug)]
92 flags Attribute
: u64 {
95 const NoReturn
= 1 << 2,
97 const StructRet
= 1 << 4,
98 const NoUnwind
= 1 << 5,
99 const NoAlias
= 1 << 6,
100 const ByVal
= 1 << 7,
102 const ReadNone
= 1 << 9,
103 const ReadOnly
= 1 << 10,
104 const NoInline
= 1 << 11,
105 const AlwaysInline
= 1 << 12,
106 const OptimizeForSize
= 1 << 13,
107 const StackProtect
= 1 << 14,
108 const StackProtectReq
= 1 << 15,
109 const NoCapture
= 1 << 21,
110 const NoRedZone
= 1 << 22,
111 const NoImplicitFloat
= 1 << 23,
112 const Naked
= 1 << 24,
113 const InlineHint
= 1 << 25,
114 const ReturnsTwice
= 1 << 29,
115 const UWTable
= 1 << 30,
116 const NonLazyBind
= 1 << 31,
118 // Some of these are missing from the LLVM C API, the rest are
119 // present, but commented out, and preceded by the following warning:
120 // FIXME: These attributes are currently not included in the C API as
121 // a temporary measure until the API/ABI impact to the C API is understood
122 // and the path forward agreed upon.
123 const SanitizeAddress
= 1 << 32,
124 const MinSize
= 1 << 33,
125 const NoDuplicate
= 1 << 34,
126 const StackProtectStrong
= 1 << 35,
127 const SanitizeThread
= 1 << 36,
128 const SanitizeMemory
= 1 << 37,
129 const NoBuiltin
= 1 << 38,
130 const Returned
= 1 << 39,
131 const Cold
= 1 << 40,
132 const Builtin
= 1 << 41,
133 const OptimizeNone
= 1 << 42,
134 const InAlloca
= 1 << 43,
135 const NonNull
= 1 << 44,
136 const JumpTable
= 1 << 45,
137 const Convergent
= 1 << 46,
138 const SafeStack
= 1 << 47,
139 const NoRecurse
= 1 << 48,
140 const InaccessibleMemOnly
= 1 << 49,
141 const InaccessibleMemOrArgMemOnly
= 1 << 50,
146 #[derive(Copy, Clone)]
148 pub enum IntPredicate
{
161 /// LLVMRealPredicate
162 #[derive(Copy, Clone)]
164 pub enum RealPredicate
{
165 RealPredicateFalse
= 0,
180 RealPredicateTrue
= 15,
184 #[derive(Copy, Clone, PartialEq, Debug)]
206 /// LLVMAtomicRmwBinOp
207 #[derive(Copy, Clone)]
209 pub enum AtomicRmwBinOp
{
223 /// LLVMAtomicOrdering
224 #[derive(Copy, Clone)]
226 pub enum AtomicOrdering
{
230 // Consume = 3, // Not specified yet.
234 SequentiallyConsistent
= 7
237 /// LLVMRustSynchronizationScope
238 #[derive(Copy, Clone)]
240 pub enum SynchronizationScope
{
247 #[derive(Copy, Clone)]
255 /// Enum pinned in LLVMContext, used in
256 /// LLVMSetMetadata so ABI-stable.
257 #[derive(Copy, Clone)]
259 pub enum MetadataType
{
266 MD_invariant_load
= 6,
270 MD_mem_parallel_loop_access
= 10,
274 /// LLVMRustAsmDialect
275 #[derive(Copy, Clone)]
277 pub enum AsmDialect
{
283 /// LLVMRustCodeGenOptLevel
284 #[derive(Copy, Clone, PartialEq)]
286 pub enum CodeGenOptLevel
{
295 #[derive(Copy, Clone, PartialEq)]
304 /// LLVMRustCodeModel
305 #[derive(Copy, Clone)]
317 /// LLVMRustDiagnosticKind
318 #[derive(Copy, Clone)]
320 pub enum DiagnosticKind
{
324 DebugMetadataVersion
,
327 OptimizationRemarkMissed
,
328 OptimizationRemarkAnalysis
,
329 OptimizationRemarkAnalysisFPCommute
,
330 OptimizationRemarkAnalysisAliasing
,
331 OptimizationRemarkOther
,
335 /// LLVMRustArchiveKind
336 #[derive(Copy, Clone)]
338 pub enum ArchiveKind
{
347 #[derive(Copy, Clone, PartialEq, Debug)]
355 // Opaque pointer types
356 #[allow(missing_copy_implementations)]
357 pub enum Module_opaque {}
358 pub type ModuleRef
= *mut Module_opaque
;
359 #[allow(missing_copy_implementations)]
360 pub enum Context_opaque {}
361 pub type ContextRef
= *mut Context_opaque
;
362 #[allow(missing_copy_implementations)]
363 pub enum Type_opaque {}
364 pub type TypeRef
= *mut Type_opaque
;
365 #[allow(missing_copy_implementations)]
366 pub enum Value_opaque {}
367 pub type ValueRef
= *mut Value_opaque
;
368 #[allow(missing_copy_implementations)]
369 pub enum Metadata_opaque {}
370 pub type MetadataRef
= *mut Metadata_opaque
;
371 #[allow(missing_copy_implementations)]
372 pub enum BasicBlock_opaque {}
373 pub type BasicBlockRef
= *mut BasicBlock_opaque
;
374 #[allow(missing_copy_implementations)]
375 pub enum Builder_opaque {}
376 pub type BuilderRef
= *mut Builder_opaque
;
377 #[allow(missing_copy_implementations)]
378 pub enum ExecutionEngine_opaque {}
379 pub type ExecutionEngineRef
= *mut ExecutionEngine_opaque
;
380 #[allow(missing_copy_implementations)]
381 pub enum MemoryBuffer_opaque {}
382 pub type MemoryBufferRef
= *mut MemoryBuffer_opaque
;
383 #[allow(missing_copy_implementations)]
384 pub enum PassManager_opaque {}
385 pub type PassManagerRef
= *mut PassManager_opaque
;
386 #[allow(missing_copy_implementations)]
387 pub enum PassManagerBuilder_opaque {}
388 pub type PassManagerBuilderRef
= *mut PassManagerBuilder_opaque
;
389 #[allow(missing_copy_implementations)]
390 pub enum Use_opaque {}
391 pub type UseRef
= *mut Use_opaque
;
392 #[allow(missing_copy_implementations)]
393 pub enum TargetData_opaque {}
394 pub type TargetDataRef
= *mut TargetData_opaque
;
395 #[allow(missing_copy_implementations)]
396 pub enum ObjectFile_opaque {}
397 pub type ObjectFileRef
= *mut ObjectFile_opaque
;
398 #[allow(missing_copy_implementations)]
399 pub enum SectionIterator_opaque {}
400 pub type SectionIteratorRef
= *mut SectionIterator_opaque
;
401 #[allow(missing_copy_implementations)]
402 pub enum Pass_opaque {}
403 pub type PassRef
= *mut Pass_opaque
;
404 #[allow(missing_copy_implementations)]
405 pub enum TargetMachine_opaque {}
406 pub type TargetMachineRef
= *mut TargetMachine_opaque
;
407 pub enum Archive_opaque {}
408 pub type ArchiveRef
= *mut Archive_opaque
;
409 pub enum ArchiveIterator_opaque {}
410 pub type ArchiveIteratorRef
= *mut ArchiveIterator_opaque
;
411 pub enum ArchiveChild_opaque {}
412 pub type ArchiveChildRef
= *mut ArchiveChild_opaque
;
413 #[allow(missing_copy_implementations)]
414 pub enum Twine_opaque {}
415 pub type TwineRef
= *mut Twine_opaque
;
416 #[allow(missing_copy_implementations)]
417 pub enum DiagnosticInfo_opaque {}
418 pub type DiagnosticInfoRef
= *mut DiagnosticInfo_opaque
;
419 #[allow(missing_copy_implementations)]
420 pub enum DebugLoc_opaque {}
421 pub type DebugLocRef
= *mut DebugLoc_opaque
;
422 #[allow(missing_copy_implementations)]
423 pub enum SMDiagnostic_opaque {}
424 pub type SMDiagnosticRef
= *mut SMDiagnostic_opaque
;
425 #[allow(missing_copy_implementations)]
426 pub enum RustArchiveMember_opaque {}
427 pub type RustArchiveMemberRef
= *mut RustArchiveMember_opaque
;
428 #[allow(missing_copy_implementations)]
429 pub enum OperandBundleDef_opaque {}
430 pub type OperandBundleDefRef
= *mut OperandBundleDef_opaque
;
432 pub type DiagnosticHandler
= unsafe extern "C" fn(DiagnosticInfoRef
, *mut c_void
);
433 pub type InlineAsmDiagHandler
= unsafe extern "C" fn(SMDiagnosticRef
, *const c_void
, c_uint
);
436 pub use self::DIDescriptorFlags
::*;
437 use super::{MetadataRef}
;
439 #[allow(missing_copy_implementations)]
440 pub enum DIBuilder_opaque {}
441 pub type DIBuilderRef
= *mut DIBuilder_opaque
;
443 pub type DIDescriptor
= MetadataRef
;
444 pub type DIScope
= DIDescriptor
;
445 pub type DILocation
= DIDescriptor
;
446 pub type DIFile
= DIScope
;
447 pub type DILexicalBlock
= DIScope
;
448 pub type DISubprogram
= DIScope
;
449 pub type DINameSpace
= DIScope
;
450 pub type DIType
= DIDescriptor
;
451 pub type DIBasicType
= DIType
;
452 pub type DIDerivedType
= DIType
;
453 pub type DICompositeType
= DIDerivedType
;
454 pub type DIVariable
= DIDescriptor
;
455 pub type DIGlobalVariable
= DIDescriptor
;
456 pub type DIArray
= DIDescriptor
;
457 pub type DISubrange
= DIDescriptor
;
458 pub type DIEnumerator
= DIDescriptor
;
459 pub type DITemplateTypeParameter
= DIDescriptor
;
461 #[derive(Copy, Clone)]
462 pub enum DIDescriptorFlags
{
463 FlagPrivate
= 1 << 0,
464 FlagProtected
= 1 << 1,
465 FlagFwdDecl
= 1 << 2,
466 FlagAppleBlock
= 1 << 3,
467 FlagBlockByrefStruct
= 1 << 4,
468 FlagVirtual
= 1 << 5,
469 FlagArtificial
= 1 << 6,
470 FlagExplicit
= 1 << 7,
471 FlagPrototyped
= 1 << 8,
472 FlagObjcClassComplete
= 1 << 9,
473 FlagObjectPointer
= 1 << 10,
474 FlagVector
= 1 << 11,
475 FlagStaticMember
= 1 << 12,
476 FlagIndirectVariable
= 1 << 13,
477 FlagLValueReference
= 1 << 14,
478 FlagRValueReference
= 1 << 15
483 // Link to our native llvm bindings (things that we need to use the C++ api
484 // for) and because llvm is written in C++ we need to link against libstdc++
486 // You'll probably notice that there is an omission of all LLVM libraries
487 // from this location. This is because the set of LLVM libraries that we
488 // link to is mostly defined by LLVM, and the `llvm-config` tool is used to
489 // figure out the exact set of libraries. To do this, the build system
490 // generates an llvmdeps.rs file next to this one which will be
491 // automatically updated whenever LLVM is updated to include an up-to-date
492 // set of the libraries we need to link to LLVM for.
493 #[link(name = "rustllvm", kind = "static")]
494 #[cfg(not(cargobuild))]
497 #[linked_from = "rustllvm"] // not quite true but good enough
499 /* Create and destroy contexts. */
500 pub fn LLVMContextCreate() -> ContextRef
;
501 pub fn LLVMContextDispose(C
: ContextRef
);
502 pub fn LLVMGetMDKindIDInContext(C
: ContextRef
,
507 /* Create and destroy modules. */
508 pub fn LLVMModuleCreateWithNameInContext(ModuleID
: *const c_char
,
511 pub fn LLVMGetModuleContext(M
: ModuleRef
) -> ContextRef
;
512 pub fn LLVMCloneModule(M
: ModuleRef
) -> ModuleRef
;
513 pub fn LLVMDisposeModule(M
: ModuleRef
);
515 /// Data layout. See Module::getDataLayout.
516 pub fn LLVMGetDataLayout(M
: ModuleRef
) -> *const c_char
;
517 pub fn LLVMSetDataLayout(M
: ModuleRef
, Triple
: *const c_char
);
519 /// Target triple. See Module::getTargetTriple.
520 pub fn LLVMGetTarget(M
: ModuleRef
) -> *const c_char
;
521 pub fn LLVMSetTarget(M
: ModuleRef
, Triple
: *const c_char
);
523 /// See Module::dump.
524 pub fn LLVMDumpModule(M
: ModuleRef
);
526 /// See Module::setModuleInlineAsm.
527 pub fn LLVMSetModuleInlineAsm(M
: ModuleRef
, Asm
: *const c_char
);
529 /// See llvm::LLVMTypeKind::getTypeID.
530 pub fn LLVMRustGetTypeKind(Ty
: TypeRef
) -> TypeKind
;
532 /// See llvm::LLVMType::getContext.
533 pub fn LLVMGetTypeContext(Ty
: TypeRef
) -> ContextRef
;
535 /* Operations on integer types */
536 pub fn LLVMInt1TypeInContext(C
: ContextRef
) -> TypeRef
;
537 pub fn LLVMInt8TypeInContext(C
: ContextRef
) -> TypeRef
;
538 pub fn LLVMInt16TypeInContext(C
: ContextRef
) -> TypeRef
;
539 pub fn LLVMInt32TypeInContext(C
: ContextRef
) -> TypeRef
;
540 pub fn LLVMInt64TypeInContext(C
: ContextRef
) -> TypeRef
;
541 pub fn LLVMIntTypeInContext(C
: ContextRef
, NumBits
: c_uint
)
544 pub fn LLVMGetIntTypeWidth(IntegerTy
: TypeRef
) -> c_uint
;
546 /* Operations on real types */
547 pub fn LLVMFloatTypeInContext(C
: ContextRef
) -> TypeRef
;
548 pub fn LLVMDoubleTypeInContext(C
: ContextRef
) -> TypeRef
;
549 pub fn LLVMX86FP80TypeInContext(C
: ContextRef
) -> TypeRef
;
550 pub fn LLVMFP128TypeInContext(C
: ContextRef
) -> TypeRef
;
551 pub fn LLVMPPCFP128TypeInContext(C
: ContextRef
) -> TypeRef
;
553 /* Operations on function types */
554 pub fn LLVMFunctionType(ReturnType
: TypeRef
,
555 ParamTypes
: *const TypeRef
,
559 pub fn LLVMIsFunctionVarArg(FunctionTy
: TypeRef
) -> Bool
;
560 pub fn LLVMGetReturnType(FunctionTy
: TypeRef
) -> TypeRef
;
561 pub fn LLVMCountParamTypes(FunctionTy
: TypeRef
) -> c_uint
;
562 pub fn LLVMGetParamTypes(FunctionTy
: TypeRef
, Dest
: *mut TypeRef
);
564 /* Operations on struct types */
565 pub fn LLVMStructTypeInContext(C
: ContextRef
,
566 ElementTypes
: *const TypeRef
,
567 ElementCount
: c_uint
,
570 pub fn LLVMCountStructElementTypes(StructTy
: TypeRef
) -> c_uint
;
571 pub fn LLVMGetStructElementTypes(StructTy
: TypeRef
,
573 pub fn LLVMIsPackedStruct(StructTy
: TypeRef
) -> Bool
;
575 /* Operations on array, pointer, and vector types (sequence types) */
576 pub fn LLVMRustArrayType(ElementType
: TypeRef
, ElementCount
: u64) -> TypeRef
;
577 pub fn LLVMPointerType(ElementType
: TypeRef
, AddressSpace
: c_uint
)
579 pub fn LLVMVectorType(ElementType
: TypeRef
, ElementCount
: c_uint
)
582 pub fn LLVMGetElementType(Ty
: TypeRef
) -> TypeRef
;
583 pub fn LLVMGetArrayLength(ArrayTy
: TypeRef
) -> c_uint
;
584 pub fn LLVMGetPointerAddressSpace(PointerTy
: TypeRef
) -> c_uint
;
585 pub fn LLVMGetPointerToGlobal(EE
: ExecutionEngineRef
, V
: ValueRef
)
587 pub fn LLVMGetVectorSize(VectorTy
: TypeRef
) -> c_uint
;
589 /* Operations on other types */
590 pub fn LLVMVoidTypeInContext(C
: ContextRef
) -> TypeRef
;
591 pub fn LLVMLabelTypeInContext(C
: ContextRef
) -> TypeRef
;
592 pub fn LLVMRustMetadataTypeInContext(C
: ContextRef
) -> TypeRef
;
594 /* Operations on all values */
595 pub fn LLVMTypeOf(Val
: ValueRef
) -> TypeRef
;
596 pub fn LLVMGetValueName(Val
: ValueRef
) -> *const c_char
;
597 pub fn LLVMSetValueName(Val
: ValueRef
, Name
: *const c_char
);
598 pub fn LLVMDumpValue(Val
: ValueRef
);
599 pub fn LLVMReplaceAllUsesWith(OldVal
: ValueRef
, NewVal
: ValueRef
);
600 pub fn LLVMSetMetadata(Val
: ValueRef
, KindID
: c_uint
, Node
: ValueRef
);
602 /* Operations on Uses */
603 pub fn LLVMGetFirstUse(Val
: ValueRef
) -> UseRef
;
604 pub fn LLVMGetNextUse(U
: UseRef
) -> UseRef
;
605 pub fn LLVMGetUser(U
: UseRef
) -> ValueRef
;
606 pub fn LLVMGetUsedValue(U
: UseRef
) -> ValueRef
;
608 /* Operations on Users */
609 pub fn LLVMGetNumOperands(Val
: ValueRef
) -> c_int
;
610 pub fn LLVMGetOperand(Val
: ValueRef
, Index
: c_uint
) -> ValueRef
;
611 pub fn LLVMSetOperand(Val
: ValueRef
, Index
: c_uint
, Op
: ValueRef
);
613 /* Operations on constants of any type */
614 pub fn LLVMConstNull(Ty
: TypeRef
) -> ValueRef
;
616 pub fn LLVMConstAllOnes(Ty
: TypeRef
) -> ValueRef
;
617 pub fn LLVMConstICmp(Pred
: IntPredicate
, V1
: ValueRef
, V2
: ValueRef
)
619 pub fn LLVMConstFCmp(Pred
: RealPredicate
, V1
: ValueRef
, V2
: ValueRef
)
621 /* only for isize/vector */
622 pub fn LLVMGetUndef(Ty
: TypeRef
) -> ValueRef
;
623 pub fn LLVMIsConstant(Val
: ValueRef
) -> Bool
;
624 pub fn LLVMIsNull(Val
: ValueRef
) -> Bool
;
625 pub fn LLVMIsUndef(Val
: ValueRef
) -> Bool
;
626 pub fn LLVMConstPointerNull(Ty
: TypeRef
) -> ValueRef
;
628 /* Operations on metadata */
629 pub fn LLVMMDStringInContext(C
: ContextRef
,
633 pub fn LLVMMDNodeInContext(C
: ContextRef
,
634 Vals
: *const ValueRef
,
637 pub fn LLVMAddNamedMetadataOperand(M
: ModuleRef
,
641 /* Operations on scalar constants */
642 pub fn LLVMConstInt(IntTy
: TypeRef
, N
: c_ulonglong
, SignExtend
: Bool
)
644 pub fn LLVMConstIntOfString(IntTy
: TypeRef
, Text
: *const c_char
, Radix
: u8)
646 pub fn LLVMConstIntOfStringAndSize(IntTy
: TypeRef
,
651 pub fn LLVMConstReal(RealTy
: TypeRef
, N
: f64) -> ValueRef
;
652 pub fn LLVMConstRealOfString(RealTy
: TypeRef
, Text
: *const c_char
)
654 pub fn LLVMConstRealOfStringAndSize(RealTy
: TypeRef
,
658 pub fn LLVMConstIntGetZExtValue(ConstantVal
: ValueRef
) -> c_ulonglong
;
659 pub fn LLVMConstIntGetSExtValue(ConstantVal
: ValueRef
) -> c_longlong
;
662 /* Operations on composite constants */
663 pub fn LLVMConstStringInContext(C
: ContextRef
,
666 DontNullTerminate
: Bool
)
668 pub fn LLVMConstStructInContext(C
: ContextRef
,
669 ConstantVals
: *const ValueRef
,
674 pub fn LLVMConstArray(ElementTy
: TypeRef
,
675 ConstantVals
: *const ValueRef
,
678 pub fn LLVMConstVector(ScalarConstantVals
: *const ValueRef
, Size
: c_uint
)
681 /* Constant expressions */
682 pub fn LLVMAlignOf(Ty
: TypeRef
) -> ValueRef
;
683 pub fn LLVMSizeOf(Ty
: TypeRef
) -> ValueRef
;
684 pub fn LLVMConstNeg(ConstantVal
: ValueRef
) -> ValueRef
;
685 pub fn LLVMConstNSWNeg(ConstantVal
: ValueRef
) -> ValueRef
;
686 pub fn LLVMConstNUWNeg(ConstantVal
: ValueRef
) -> ValueRef
;
687 pub fn LLVMConstFNeg(ConstantVal
: ValueRef
) -> ValueRef
;
688 pub fn LLVMConstNot(ConstantVal
: ValueRef
) -> ValueRef
;
689 pub fn LLVMConstAdd(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
691 pub fn LLVMConstNSWAdd(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
693 pub fn LLVMConstNUWAdd(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
695 pub fn LLVMConstFAdd(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
697 pub fn LLVMConstSub(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
699 pub fn LLVMConstNSWSub(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
701 pub fn LLVMConstNUWSub(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
703 pub fn LLVMConstFSub(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
705 pub fn LLVMConstMul(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
707 pub fn LLVMConstNSWMul(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
709 pub fn LLVMConstNUWMul(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
711 pub fn LLVMConstFMul(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
713 pub fn LLVMConstUDiv(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
715 pub fn LLVMConstSDiv(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
717 pub fn LLVMConstExactSDiv(LHSConstant
: ValueRef
,
718 RHSConstant
: ValueRef
)
720 pub fn LLVMConstFDiv(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
722 pub fn LLVMConstURem(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
724 pub fn LLVMConstSRem(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
726 pub fn LLVMConstFRem(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
728 pub fn LLVMConstAnd(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
730 pub fn LLVMConstOr(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
732 pub fn LLVMConstXor(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
734 pub fn LLVMConstShl(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
736 pub fn LLVMConstLShr(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
738 pub fn LLVMConstAShr(LHSConstant
: ValueRef
, RHSConstant
: ValueRef
)
740 pub fn LLVMConstGEP(ConstantVal
: ValueRef
,
741 ConstantIndices
: *const ValueRef
,
744 pub fn LLVMConstInBoundsGEP(ConstantVal
: ValueRef
,
745 ConstantIndices
: *const ValueRef
,
748 pub fn LLVMConstTrunc(ConstantVal
: ValueRef
, ToType
: TypeRef
)
750 pub fn LLVMConstSExt(ConstantVal
: ValueRef
, ToType
: TypeRef
)
752 pub fn LLVMConstZExt(ConstantVal
: ValueRef
, ToType
: TypeRef
)
754 pub fn LLVMConstFPTrunc(ConstantVal
: ValueRef
, ToType
: TypeRef
)
756 pub fn LLVMConstFPExt(ConstantVal
: ValueRef
, ToType
: TypeRef
)
758 pub fn LLVMConstUIToFP(ConstantVal
: ValueRef
, ToType
: TypeRef
)
760 pub fn LLVMConstSIToFP(ConstantVal
: ValueRef
, ToType
: TypeRef
)
762 pub fn LLVMConstFPToUI(ConstantVal
: ValueRef
, ToType
: TypeRef
)
764 pub fn LLVMConstFPToSI(ConstantVal
: ValueRef
, ToType
: TypeRef
)
766 pub fn LLVMConstPtrToInt(ConstantVal
: ValueRef
, ToType
: TypeRef
)
768 pub fn LLVMConstIntToPtr(ConstantVal
: ValueRef
, ToType
: TypeRef
)
770 pub fn LLVMConstBitCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
772 pub fn LLVMConstZExtOrBitCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
774 pub fn LLVMConstSExtOrBitCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
776 pub fn LLVMConstTruncOrBitCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
778 pub fn LLVMConstPointerCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
780 pub fn LLVMConstIntCast(ConstantVal
: ValueRef
,
784 pub fn LLVMConstFPCast(ConstantVal
: ValueRef
, ToType
: TypeRef
)
786 pub fn LLVMConstSelect(ConstantCondition
: ValueRef
,
787 ConstantIfTrue
: ValueRef
,
788 ConstantIfFalse
: ValueRef
)
790 pub fn LLVMConstExtractElement(VectorConstant
: ValueRef
,
791 IndexConstant
: ValueRef
)
793 pub fn LLVMConstInsertElement(VectorConstant
: ValueRef
,
794 ElementValueConstant
: ValueRef
,
795 IndexConstant
: ValueRef
)
797 pub fn LLVMConstShuffleVector(VectorAConstant
: ValueRef
,
798 VectorBConstant
: ValueRef
,
799 MaskConstant
: ValueRef
)
801 pub fn LLVMConstExtractValue(AggConstant
: ValueRef
,
802 IdxList
: *const c_uint
,
805 pub fn LLVMConstInsertValue(AggConstant
: ValueRef
,
806 ElementValueConstant
: ValueRef
,
807 IdxList
: *const c_uint
,
810 pub fn LLVMConstInlineAsm(Ty
: TypeRef
,
811 AsmString
: *const c_char
,
812 Constraints
: *const c_char
,
813 HasSideEffects
: Bool
,
816 pub fn LLVMBlockAddress(F
: ValueRef
, BB
: BasicBlockRef
) -> ValueRef
;
820 /* Operations on global variables, functions, and aliases (globals) */
821 pub fn LLVMGetGlobalParent(Global
: ValueRef
) -> ModuleRef
;
822 pub fn LLVMIsDeclaration(Global
: ValueRef
) -> Bool
;
823 pub fn LLVMGetLinkage(Global
: ValueRef
) -> c_uint
;
824 pub fn LLVMSetLinkage(Global
: ValueRef
, Link
: Linkage
);
825 pub fn LLVMGetSection(Global
: ValueRef
) -> *const c_char
;
826 pub fn LLVMSetSection(Global
: ValueRef
, Section
: *const c_char
);
827 pub fn LLVMGetVisibility(Global
: ValueRef
) -> c_uint
;
828 pub fn LLVMSetVisibility(Global
: ValueRef
, Viz
: c_uint
);
829 pub fn LLVMGetAlignment(Global
: ValueRef
) -> c_uint
;
830 pub fn LLVMSetAlignment(Global
: ValueRef
, Bytes
: c_uint
);
831 pub fn LLVMSetDLLStorageClass(V
: ValueRef
,
835 /* Operations on global variables */
836 pub fn LLVMIsAGlobalVariable(GlobalVar
: ValueRef
) -> ValueRef
;
837 pub fn LLVMAddGlobal(M
: ModuleRef
, Ty
: TypeRef
, Name
: *const c_char
)
839 pub fn LLVMAddGlobalInAddressSpace(M
: ModuleRef
,
842 AddressSpace
: c_uint
)
844 pub fn LLVMGetNamedGlobal(M
: ModuleRef
,
847 pub fn LLVMRustGetOrInsertGlobal(M
: ModuleRef
,
851 pub fn LLVMGetFirstGlobal(M
: ModuleRef
) -> ValueRef
;
852 pub fn LLVMGetLastGlobal(M
: ModuleRef
) -> ValueRef
;
853 pub fn LLVMGetNextGlobal(GlobalVar
: ValueRef
) -> ValueRef
;
854 pub fn LLVMGetPreviousGlobal(GlobalVar
: ValueRef
) -> ValueRef
;
855 pub fn LLVMDeleteGlobal(GlobalVar
: ValueRef
);
856 pub fn LLVMGetInitializer(GlobalVar
: ValueRef
) -> ValueRef
;
857 pub fn LLVMSetInitializer(GlobalVar
: ValueRef
,
858 ConstantVal
: ValueRef
);
859 pub fn LLVMIsThreadLocal(GlobalVar
: ValueRef
) -> Bool
;
860 pub fn LLVMSetThreadLocal(GlobalVar
: ValueRef
, IsThreadLocal
: Bool
);
861 pub fn LLVMIsGlobalConstant(GlobalVar
: ValueRef
) -> Bool
;
862 pub fn LLVMSetGlobalConstant(GlobalVar
: ValueRef
, IsConstant
: Bool
);
863 pub fn LLVMRustGetNamedValue(M
: ModuleRef
, Name
: *const c_char
) -> ValueRef
;
865 /* Operations on aliases */
866 pub fn LLVMAddAlias(M
: ModuleRef
,
872 /* Operations on functions */
873 pub fn LLVMAddFunction(M
: ModuleRef
,
877 pub fn LLVMGetNamedFunction(M
: ModuleRef
, Name
: *const c_char
) -> ValueRef
;
878 pub fn LLVMGetFirstFunction(M
: ModuleRef
) -> ValueRef
;
879 pub fn LLVMGetLastFunction(M
: ModuleRef
) -> ValueRef
;
880 pub fn LLVMGetNextFunction(Fn
: ValueRef
) -> ValueRef
;
881 pub fn LLVMGetPreviousFunction(Fn
: ValueRef
) -> ValueRef
;
882 pub fn LLVMDeleteFunction(Fn
: ValueRef
);
883 pub fn LLVMRustGetOrInsertFunction(M
: ModuleRef
,
887 pub fn LLVMGetIntrinsicID(Fn
: ValueRef
) -> c_uint
;
888 pub fn LLVMGetFunctionCallConv(Fn
: ValueRef
) -> c_uint
;
889 pub fn LLVMSetFunctionCallConv(Fn
: ValueRef
, CC
: c_uint
);
890 pub fn LLVMGetGC(Fn
: ValueRef
) -> *const c_char
;
891 pub fn LLVMSetGC(Fn
: ValueRef
, Name
: *const c_char
);
892 pub fn LLVMRustAddDereferenceableAttr(Fn
: ValueRef
, index
: c_uint
, bytes
: u64);
893 pub fn LLVMRustAddFunctionAttribute(Fn
: ValueRef
, index
: c_uint
, PA
: u64);
894 pub fn LLVMRustAddFunctionAttrString(Fn
: ValueRef
, index
: c_uint
, Name
: *const c_char
);
895 pub fn LLVMRustAddFunctionAttrStringValue(Fn
: ValueRef
, index
: c_uint
,
897 Value
: *const c_char
);
898 pub fn LLVMRustRemoveFunctionAttributes(Fn
: ValueRef
,
901 pub fn LLVMRustRemoveFunctionAttrString(Fn
: ValueRef
,
903 Name
: *const c_char
);
904 pub fn LLVMGetFunctionAttr(Fn
: ValueRef
) -> c_uint
;
905 pub fn LLVMRemoveFunctionAttr(Fn
: ValueRef
, val
: c_uint
);
907 /* Operations on parameters */
908 pub fn LLVMCountParams(Fn
: ValueRef
) -> c_uint
;
909 pub fn LLVMGetParams(Fn
: ValueRef
, Params
: *const ValueRef
);
910 pub fn LLVMGetParam(Fn
: ValueRef
, Index
: c_uint
) -> ValueRef
;
911 pub fn LLVMGetParamParent(Inst
: ValueRef
) -> ValueRef
;
912 pub fn LLVMGetFirstParam(Fn
: ValueRef
) -> ValueRef
;
913 pub fn LLVMGetLastParam(Fn
: ValueRef
) -> ValueRef
;
914 pub fn LLVMGetNextParam(Arg
: ValueRef
) -> ValueRef
;
915 pub fn LLVMGetPreviousParam(Arg
: ValueRef
) -> ValueRef
;
916 pub fn LLVMAddAttribute(Arg
: ValueRef
, PA
: c_uint
);
917 pub fn LLVMRemoveAttribute(Arg
: ValueRef
, PA
: c_uint
);
918 pub fn LLVMGetAttribute(Arg
: ValueRef
) -> c_uint
;
919 pub fn LLVMSetParamAlignment(Arg
: ValueRef
, align
: c_uint
);
921 /* Operations on basic blocks */
922 pub fn LLVMBasicBlockAsValue(BB
: BasicBlockRef
) -> ValueRef
;
923 pub fn LLVMValueIsBasicBlock(Val
: ValueRef
) -> Bool
;
924 pub fn LLVMValueAsBasicBlock(Val
: ValueRef
) -> BasicBlockRef
;
925 pub fn LLVMGetBasicBlockParent(BB
: BasicBlockRef
) -> ValueRef
;
926 pub fn LLVMCountBasicBlocks(Fn
: ValueRef
) -> c_uint
;
927 pub fn LLVMGetBasicBlocks(Fn
: ValueRef
, BasicBlocks
: *const ValueRef
);
928 pub fn LLVMGetFirstBasicBlock(Fn
: ValueRef
) -> BasicBlockRef
;
929 pub fn LLVMGetLastBasicBlock(Fn
: ValueRef
) -> BasicBlockRef
;
930 pub fn LLVMGetNextBasicBlock(BB
: BasicBlockRef
) -> BasicBlockRef
;
931 pub fn LLVMGetPreviousBasicBlock(BB
: BasicBlockRef
) -> BasicBlockRef
;
932 pub fn LLVMGetEntryBasicBlock(Fn
: ValueRef
) -> BasicBlockRef
;
934 pub fn LLVMAppendBasicBlockInContext(C
: ContextRef
,
938 pub fn LLVMInsertBasicBlockInContext(C
: ContextRef
,
942 pub fn LLVMDeleteBasicBlock(BB
: BasicBlockRef
);
944 pub fn LLVMMoveBasicBlockAfter(BB
: BasicBlockRef
,
945 MoveAfter
: BasicBlockRef
);
947 pub fn LLVMMoveBasicBlockBefore(BB
: BasicBlockRef
,
948 MoveBefore
: BasicBlockRef
);
950 /* Operations on instructions */
951 pub fn LLVMGetInstructionParent(Inst
: ValueRef
) -> BasicBlockRef
;
952 pub fn LLVMGetFirstInstruction(BB
: BasicBlockRef
) -> ValueRef
;
953 pub fn LLVMGetLastInstruction(BB
: BasicBlockRef
) -> ValueRef
;
954 pub fn LLVMGetNextInstruction(Inst
: ValueRef
) -> ValueRef
;
955 pub fn LLVMGetPreviousInstruction(Inst
: ValueRef
) -> ValueRef
;
956 pub fn LLVMInstructionEraseFromParent(Inst
: ValueRef
);
958 /* Operations on call sites */
959 pub fn LLVMSetInstructionCallConv(Instr
: ValueRef
, CC
: c_uint
);
960 pub fn LLVMGetInstructionCallConv(Instr
: ValueRef
) -> c_uint
;
961 pub fn LLVMAddInstrAttribute(Instr
: ValueRef
,
964 pub fn LLVMRemoveInstrAttribute(Instr
: ValueRef
,
967 pub fn LLVMSetInstrParamAlignment(Instr
: ValueRef
,
970 pub fn LLVMRustAddCallSiteAttribute(Instr
: ValueRef
,
973 pub fn LLVMRustAddDereferenceableCallSiteAttr(Instr
: ValueRef
,
977 /* Operations on call instructions (only) */
978 pub fn LLVMIsTailCall(CallInst
: ValueRef
) -> Bool
;
979 pub fn LLVMSetTailCall(CallInst
: ValueRef
, IsTailCall
: Bool
);
981 /* Operations on load/store instructions (only) */
982 pub fn LLVMGetVolatile(MemoryAccessInst
: ValueRef
) -> Bool
;
983 pub fn LLVMSetVolatile(MemoryAccessInst
: ValueRef
, volatile
: Bool
);
985 /* Operations on phi nodes */
986 pub fn LLVMAddIncoming(PhiNode
: ValueRef
,
987 IncomingValues
: *const ValueRef
,
988 IncomingBlocks
: *const BasicBlockRef
,
990 pub fn LLVMCountIncoming(PhiNode
: ValueRef
) -> c_uint
;
991 pub fn LLVMGetIncomingValue(PhiNode
: ValueRef
, Index
: c_uint
)
993 pub fn LLVMGetIncomingBlock(PhiNode
: ValueRef
, Index
: c_uint
)
996 /* Instruction builders */
997 pub fn LLVMCreateBuilderInContext(C
: ContextRef
) -> BuilderRef
;
998 pub fn LLVMPositionBuilder(Builder
: BuilderRef
,
999 Block
: BasicBlockRef
,
1001 pub fn LLVMPositionBuilderBefore(Builder
: BuilderRef
,
1003 pub fn LLVMPositionBuilderAtEnd(Builder
: BuilderRef
,
1004 Block
: BasicBlockRef
);
1005 pub fn LLVMGetInsertBlock(Builder
: BuilderRef
) -> BasicBlockRef
;
1006 pub fn LLVMClearInsertionPosition(Builder
: BuilderRef
);
1007 pub fn LLVMInsertIntoBuilder(Builder
: BuilderRef
, Instr
: ValueRef
);
1008 pub fn LLVMInsertIntoBuilderWithName(Builder
: BuilderRef
,
1010 Name
: *const c_char
);
1011 pub fn LLVMDisposeBuilder(Builder
: BuilderRef
);
1014 pub fn LLVMSetCurrentDebugLocation(Builder
: BuilderRef
, L
: ValueRef
);
1015 pub fn LLVMGetCurrentDebugLocation(Builder
: BuilderRef
) -> ValueRef
;
1016 pub fn LLVMSetInstDebugLocation(Builder
: BuilderRef
, Inst
: ValueRef
);
1019 pub fn LLVMBuildRetVoid(B
: BuilderRef
) -> ValueRef
;
1020 pub fn LLVMBuildRet(B
: BuilderRef
, V
: ValueRef
) -> ValueRef
;
1021 pub fn LLVMBuildAggregateRet(B
: BuilderRef
,
1022 RetVals
: *const ValueRef
,
1025 pub fn LLVMBuildBr(B
: BuilderRef
, Dest
: BasicBlockRef
) -> ValueRef
;
1026 pub fn LLVMBuildCondBr(B
: BuilderRef
,
1028 Then
: BasicBlockRef
,
1029 Else
: BasicBlockRef
)
1031 pub fn LLVMBuildSwitch(B
: BuilderRef
,
1033 Else
: BasicBlockRef
,
1036 pub fn LLVMBuildIndirectBr(B
: BuilderRef
,
1040 pub fn LLVMRustBuildInvoke(B
: BuilderRef
,
1042 Args
: *const ValueRef
,
1044 Then
: BasicBlockRef
,
1045 Catch
: BasicBlockRef
,
1046 Bundle
: OperandBundleDefRef
,
1047 Name
: *const c_char
)
1049 pub fn LLVMRustBuildLandingPad(B
: BuilderRef
,
1053 Name
: *const c_char
,
1056 pub fn LLVMBuildResume(B
: BuilderRef
, Exn
: ValueRef
) -> ValueRef
;
1057 pub fn LLVMBuildUnreachable(B
: BuilderRef
) -> ValueRef
;
1059 pub fn LLVMRustBuildCleanupPad(B
: BuilderRef
,
1060 ParentPad
: ValueRef
,
1062 Args
: *const ValueRef
,
1063 Name
: *const c_char
) -> ValueRef
;
1064 pub fn LLVMRustBuildCleanupRet(B
: BuilderRef
,
1065 CleanupPad
: ValueRef
,
1066 UnwindBB
: BasicBlockRef
) -> ValueRef
;
1067 pub fn LLVMRustBuildCatchPad(B
: BuilderRef
,
1068 ParentPad
: ValueRef
,
1070 Args
: *const ValueRef
,
1071 Name
: *const c_char
) -> ValueRef
;
1072 pub fn LLVMRustBuildCatchRet(B
: BuilderRef
,
1074 BB
: BasicBlockRef
) -> ValueRef
;
1075 pub fn LLVMRustBuildCatchSwitch(Builder
: BuilderRef
,
1076 ParentPad
: ValueRef
,
1078 NumHandlers
: c_uint
,
1079 Name
: *const c_char
) -> ValueRef
;
1080 pub fn LLVMRustAddHandler(CatchSwitch
: ValueRef
,
1081 Handler
: BasicBlockRef
);
1082 pub fn LLVMRustSetPersonalityFn(B
: BuilderRef
, Pers
: ValueRef
);
1084 /* Add a case to the switch instruction */
1085 pub fn LLVMAddCase(Switch
: ValueRef
,
1087 Dest
: BasicBlockRef
);
1089 /* Add a destination to the indirectbr instruction */
1090 pub fn LLVMAddDestination(IndirectBr
: ValueRef
, Dest
: BasicBlockRef
);
1092 /* Add a clause to the landing pad instruction */
1093 pub fn LLVMAddClause(LandingPad
: ValueRef
, ClauseVal
: ValueRef
);
1095 /* Set the cleanup on a landing pad instruction */
1096 pub fn LLVMSetCleanup(LandingPad
: ValueRef
, Val
: Bool
);
1099 pub fn LLVMBuildAdd(B
: BuilderRef
,
1102 Name
: *const c_char
)
1104 pub fn LLVMBuildNSWAdd(B
: BuilderRef
,
1107 Name
: *const c_char
)
1109 pub fn LLVMBuildNUWAdd(B
: BuilderRef
,
1112 Name
: *const c_char
)
1114 pub fn LLVMBuildFAdd(B
: BuilderRef
,
1117 Name
: *const c_char
)
1119 pub fn LLVMBuildSub(B
: BuilderRef
,
1122 Name
: *const c_char
)
1124 pub fn LLVMBuildNSWSub(B
: BuilderRef
,
1127 Name
: *const c_char
)
1129 pub fn LLVMBuildNUWSub(B
: BuilderRef
,
1132 Name
: *const c_char
)
1134 pub fn LLVMBuildFSub(B
: BuilderRef
,
1137 Name
: *const c_char
)
1139 pub fn LLVMBuildMul(B
: BuilderRef
,
1142 Name
: *const c_char
)
1144 pub fn LLVMBuildNSWMul(B
: BuilderRef
,
1147 Name
: *const c_char
)
1149 pub fn LLVMBuildNUWMul(B
: BuilderRef
,
1152 Name
: *const c_char
)
1154 pub fn LLVMBuildFMul(B
: BuilderRef
,
1157 Name
: *const c_char
)
1159 pub fn LLVMBuildUDiv(B
: BuilderRef
,
1162 Name
: *const c_char
)
1164 pub fn LLVMBuildSDiv(B
: BuilderRef
,
1167 Name
: *const c_char
)
1169 pub fn LLVMBuildExactSDiv(B
: BuilderRef
,
1172 Name
: *const c_char
)
1174 pub fn LLVMBuildFDiv(B
: BuilderRef
,
1177 Name
: *const c_char
)
1179 pub fn LLVMBuildURem(B
: BuilderRef
,
1182 Name
: *const c_char
)
1184 pub fn LLVMBuildSRem(B
: BuilderRef
,
1187 Name
: *const c_char
)
1189 pub fn LLVMBuildFRem(B
: BuilderRef
,
1192 Name
: *const c_char
)
1194 pub fn LLVMBuildShl(B
: BuilderRef
,
1197 Name
: *const c_char
)
1199 pub fn LLVMBuildLShr(B
: BuilderRef
,
1202 Name
: *const c_char
)
1204 pub fn LLVMBuildAShr(B
: BuilderRef
,
1207 Name
: *const c_char
)
1209 pub fn LLVMBuildAnd(B
: BuilderRef
,
1212 Name
: *const c_char
)
1214 pub fn LLVMBuildOr(B
: BuilderRef
,
1217 Name
: *const c_char
)
1219 pub fn LLVMBuildXor(B
: BuilderRef
,
1222 Name
: *const c_char
)
1224 pub fn LLVMBuildBinOp(B
: BuilderRef
,
1228 Name
: *const c_char
)
1230 pub fn LLVMBuildNeg(B
: BuilderRef
, V
: ValueRef
, Name
: *const c_char
)
1232 pub fn LLVMBuildNSWNeg(B
: BuilderRef
, V
: ValueRef
, Name
: *const c_char
)
1234 pub fn LLVMBuildNUWNeg(B
: BuilderRef
, V
: ValueRef
, Name
: *const c_char
)
1236 pub fn LLVMBuildFNeg(B
: BuilderRef
, V
: ValueRef
, Name
: *const c_char
)
1238 pub fn LLVMBuildNot(B
: BuilderRef
, V
: ValueRef
, Name
: *const c_char
)
1240 pub fn LLVMRustSetHasUnsafeAlgebra(Instr
: ValueRef
);
1243 pub fn LLVMBuildAlloca(B
: BuilderRef
, Ty
: TypeRef
, Name
: *const c_char
)
1245 pub fn LLVMBuildFree(B
: BuilderRef
, PointerVal
: ValueRef
) -> ValueRef
;
1246 pub fn LLVMBuildLoad(B
: BuilderRef
,
1247 PointerVal
: ValueRef
,
1248 Name
: *const c_char
)
1251 pub fn LLVMBuildStore(B
: BuilderRef
, Val
: ValueRef
, Ptr
: ValueRef
)
1254 pub fn LLVMBuildGEP(B
: BuilderRef
,
1256 Indices
: *const ValueRef
,
1258 Name
: *const c_char
)
1260 pub fn LLVMBuildInBoundsGEP(B
: BuilderRef
,
1262 Indices
: *const ValueRef
,
1264 Name
: *const c_char
)
1266 pub fn LLVMBuildStructGEP(B
: BuilderRef
,
1269 Name
: *const c_char
)
1271 pub fn LLVMBuildGlobalString(B
: BuilderRef
,
1273 Name
: *const c_char
)
1275 pub fn LLVMBuildGlobalStringPtr(B
: BuilderRef
,
1277 Name
: *const c_char
)
1281 pub fn LLVMBuildTrunc(B
: BuilderRef
,
1284 Name
: *const c_char
)
1286 pub fn LLVMBuildZExt(B
: BuilderRef
,
1289 Name
: *const c_char
)
1291 pub fn LLVMBuildSExt(B
: BuilderRef
,
1294 Name
: *const c_char
)
1296 pub fn LLVMBuildFPToUI(B
: BuilderRef
,
1299 Name
: *const c_char
)
1301 pub fn LLVMBuildFPToSI(B
: BuilderRef
,
1304 Name
: *const c_char
)
1306 pub fn LLVMBuildUIToFP(B
: BuilderRef
,
1309 Name
: *const c_char
)
1311 pub fn LLVMBuildSIToFP(B
: BuilderRef
,
1314 Name
: *const c_char
)
1316 pub fn LLVMBuildFPTrunc(B
: BuilderRef
,
1319 Name
: *const c_char
)
1321 pub fn LLVMBuildFPExt(B
: BuilderRef
,
1324 Name
: *const c_char
)
1326 pub fn LLVMBuildPtrToInt(B
: BuilderRef
,
1329 Name
: *const c_char
)
1331 pub fn LLVMBuildIntToPtr(B
: BuilderRef
,
1334 Name
: *const c_char
)
1336 pub fn LLVMBuildBitCast(B
: BuilderRef
,
1339 Name
: *const c_char
)
1341 pub fn LLVMBuildZExtOrBitCast(B
: BuilderRef
,
1344 Name
: *const c_char
)
1346 pub fn LLVMBuildSExtOrBitCast(B
: BuilderRef
,
1349 Name
: *const c_char
)
1351 pub fn LLVMBuildTruncOrBitCast(B
: BuilderRef
,
1354 Name
: *const c_char
)
1356 pub fn LLVMBuildCast(B
: BuilderRef
,
1360 Name
: *const c_char
) -> ValueRef
;
1361 pub fn LLVMBuildPointerCast(B
: BuilderRef
,
1364 Name
: *const c_char
)
1366 pub fn LLVMBuildIntCast(B
: BuilderRef
,
1369 Name
: *const c_char
)
1371 pub fn LLVMBuildFPCast(B
: BuilderRef
,
1374 Name
: *const c_char
)
1378 pub fn LLVMBuildICmp(B
: BuilderRef
,
1382 Name
: *const c_char
)
1384 pub fn LLVMBuildFCmp(B
: BuilderRef
,
1388 Name
: *const c_char
)
1391 /* Miscellaneous instructions */
1392 pub fn LLVMBuildPhi(B
: BuilderRef
, Ty
: TypeRef
, Name
: *const c_char
)
1394 pub fn LLVMRustBuildCall(B
: BuilderRef
,
1396 Args
: *const ValueRef
,
1398 Bundle
: OperandBundleDefRef
,
1399 Name
: *const c_char
)
1401 pub fn LLVMBuildSelect(B
: BuilderRef
,
1405 Name
: *const c_char
)
1407 pub fn LLVMBuildVAArg(B
: BuilderRef
,
1410 Name
: *const c_char
)
1412 pub fn LLVMBuildExtractElement(B
: BuilderRef
,
1415 Name
: *const c_char
)
1417 pub fn LLVMBuildInsertElement(B
: BuilderRef
,
1421 Name
: *const c_char
)
1423 pub fn LLVMBuildShuffleVector(B
: BuilderRef
,
1427 Name
: *const c_char
)
1429 pub fn LLVMBuildExtractValue(B
: BuilderRef
,
1432 Name
: *const c_char
)
1434 pub fn LLVMBuildInsertValue(B
: BuilderRef
,
1438 Name
: *const c_char
)
1441 pub fn LLVMBuildIsNull(B
: BuilderRef
, Val
: ValueRef
, Name
: *const c_char
)
1443 pub fn LLVMBuildIsNotNull(B
: BuilderRef
, Val
: ValueRef
, Name
: *const c_char
)
1445 pub fn LLVMBuildPtrDiff(B
: BuilderRef
,
1448 Name
: *const c_char
)
1451 /* Atomic Operations */
1452 pub fn LLVMRustBuildAtomicLoad(B
: BuilderRef
,
1453 PointerVal
: ValueRef
,
1454 Name
: *const c_char
,
1455 Order
: AtomicOrdering
,
1459 pub fn LLVMRustBuildAtomicStore(B
: BuilderRef
,
1462 Order
: AtomicOrdering
,
1466 pub fn LLVMRustBuildAtomicCmpXchg(B
: BuilderRef
,
1470 Order
: AtomicOrdering
,
1471 FailureOrder
: AtomicOrdering
,
1475 pub fn LLVMBuildAtomicRMW(B
: BuilderRef
,
1479 Order
: AtomicOrdering
,
1480 SingleThreaded
: Bool
)
1483 pub fn LLVMRustBuildAtomicFence(B
: BuilderRef
,
1484 Order
: AtomicOrdering
,
1485 Scope
: SynchronizationScope
);
1488 /* Selected entries from the downcasts. */
1489 pub fn LLVMIsATerminatorInst(Inst
: ValueRef
) -> ValueRef
;
1490 pub fn LLVMIsAStoreInst(Inst
: ValueRef
) -> ValueRef
;
1492 /// Writes a module to the specified path. Returns 0 on success.
1493 pub fn LLVMWriteBitcodeToFile(M
: ModuleRef
, Path
: *const c_char
) -> c_int
;
1495 /// Creates target data from a target layout string.
1496 pub fn LLVMCreateTargetData(StringRep
: *const c_char
) -> TargetDataRef
;
1497 /// Number of bytes clobbered when doing a Store to *T.
1498 pub fn LLVMStoreSizeOfType(TD
: TargetDataRef
, Ty
: TypeRef
)
1501 /// Number of bytes clobbered when doing a Store to *T.
1502 pub fn LLVMSizeOfTypeInBits(TD
: TargetDataRef
, Ty
: TypeRef
)
1505 /// Distance between successive elements in an array of T. Includes ABI padding.
1506 pub fn LLVMABISizeOfType(TD
: TargetDataRef
, Ty
: TypeRef
) -> c_ulonglong
;
1508 /// Returns the preferred alignment of a type.
1509 pub fn LLVMPreferredAlignmentOfType(TD
: TargetDataRef
, Ty
: TypeRef
)
1511 /// Returns the minimum alignment of a type.
1512 pub fn LLVMABIAlignmentOfType(TD
: TargetDataRef
, Ty
: TypeRef
)
1515 /// Computes the byte offset of the indexed struct element for a
1517 pub fn LLVMOffsetOfElement(TD
: TargetDataRef
,
1522 /// Returns the minimum alignment of a type when part of a call frame.
1523 pub fn LLVMCallFrameAlignmentOfType(TD
: TargetDataRef
, Ty
: TypeRef
)
1526 /// Disposes target data.
1527 pub fn LLVMDisposeTargetData(TD
: TargetDataRef
);
1529 /// Creates a pass manager.
1530 pub fn LLVMCreatePassManager() -> PassManagerRef
;
1532 /// Creates a function-by-function pass manager
1533 pub fn LLVMCreateFunctionPassManagerForModule(M
: ModuleRef
)
1536 /// Disposes a pass manager.
1537 pub fn LLVMDisposePassManager(PM
: PassManagerRef
);
1539 /// Runs a pass manager on a module.
1540 pub fn LLVMRunPassManager(PM
: PassManagerRef
, M
: ModuleRef
) -> Bool
;
1542 /// Runs the function passes on the provided function.
1543 pub fn LLVMRunFunctionPassManager(FPM
: PassManagerRef
, F
: ValueRef
)
1546 /// Initializes all the function passes scheduled in the manager
1547 pub fn LLVMInitializeFunctionPassManager(FPM
: PassManagerRef
) -> Bool
;
1549 /// Finalizes all the function passes scheduled in the manager
1550 pub fn LLVMFinalizeFunctionPassManager(FPM
: PassManagerRef
) -> Bool
;
1552 pub fn LLVMInitializePasses();
1554 /// Adds a verification pass.
1555 pub fn LLVMAddVerifierPass(PM
: PassManagerRef
);
1557 pub fn LLVMAddGlobalOptimizerPass(PM
: PassManagerRef
);
1558 pub fn LLVMAddIPSCCPPass(PM
: PassManagerRef
);
1559 pub fn LLVMAddDeadArgEliminationPass(PM
: PassManagerRef
);
1560 pub fn LLVMAddInstructionCombiningPass(PM
: PassManagerRef
);
1561 pub fn LLVMAddCFGSimplificationPass(PM
: PassManagerRef
);
1562 pub fn LLVMAddFunctionInliningPass(PM
: PassManagerRef
);
1563 pub fn LLVMAddFunctionAttrsPass(PM
: PassManagerRef
);
1564 pub fn LLVMAddScalarReplAggregatesPass(PM
: PassManagerRef
);
1565 pub fn LLVMAddScalarReplAggregatesPassSSA(PM
: PassManagerRef
);
1566 pub fn LLVMAddJumpThreadingPass(PM
: PassManagerRef
);
1567 pub fn LLVMAddConstantPropagationPass(PM
: PassManagerRef
);
1568 pub fn LLVMAddReassociatePass(PM
: PassManagerRef
);
1569 pub fn LLVMAddLoopRotatePass(PM
: PassManagerRef
);
1570 pub fn LLVMAddLICMPass(PM
: PassManagerRef
);
1571 pub fn LLVMAddLoopUnswitchPass(PM
: PassManagerRef
);
1572 pub fn LLVMAddLoopDeletionPass(PM
: PassManagerRef
);
1573 pub fn LLVMAddLoopUnrollPass(PM
: PassManagerRef
);
1574 pub fn LLVMAddGVNPass(PM
: PassManagerRef
);
1575 pub fn LLVMAddMemCpyOptPass(PM
: PassManagerRef
);
1576 pub fn LLVMAddSCCPPass(PM
: PassManagerRef
);
1577 pub fn LLVMAddDeadStoreEliminationPass(PM
: PassManagerRef
);
1578 pub fn LLVMAddStripDeadPrototypesPass(PM
: PassManagerRef
);
1579 pub fn LLVMAddConstantMergePass(PM
: PassManagerRef
);
1580 pub fn LLVMAddArgumentPromotionPass(PM
: PassManagerRef
);
1581 pub fn LLVMAddTailCallEliminationPass(PM
: PassManagerRef
);
1582 pub fn LLVMAddIndVarSimplifyPass(PM
: PassManagerRef
);
1583 pub fn LLVMAddAggressiveDCEPass(PM
: PassManagerRef
);
1584 pub fn LLVMAddGlobalDCEPass(PM
: PassManagerRef
);
1585 pub fn LLVMAddCorrelatedValuePropagationPass(PM
: PassManagerRef
);
1586 pub fn LLVMAddPruneEHPass(PM
: PassManagerRef
);
1587 pub fn LLVMAddSimplifyLibCallsPass(PM
: PassManagerRef
);
1588 pub fn LLVMAddLoopIdiomPass(PM
: PassManagerRef
);
1589 pub fn LLVMAddEarlyCSEPass(PM
: PassManagerRef
);
1590 pub fn LLVMAddTypeBasedAliasAnalysisPass(PM
: PassManagerRef
);
1591 pub fn LLVMAddBasicAliasAnalysisPass(PM
: PassManagerRef
);
1593 pub fn LLVMPassManagerBuilderCreate() -> PassManagerBuilderRef
;
1594 pub fn LLVMPassManagerBuilderDispose(PMB
: PassManagerBuilderRef
);
1595 pub fn LLVMPassManagerBuilderSetOptLevel(PMB
: PassManagerBuilderRef
,
1596 OptimizationLevel
: c_uint
);
1597 pub fn LLVMPassManagerBuilderSetSizeLevel(PMB
: PassManagerBuilderRef
,
1599 pub fn LLVMPassManagerBuilderSetDisableUnitAtATime(
1600 PMB
: PassManagerBuilderRef
,
1602 pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(
1603 PMB
: PassManagerBuilderRef
,
1605 pub fn LLVMPassManagerBuilderSetDisableSimplifyLibCalls(
1606 PMB
: PassManagerBuilderRef
,
1608 pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
1609 PMB
: PassManagerBuilderRef
,
1611 pub fn LLVMPassManagerBuilderPopulateModulePassManager(
1612 PMB
: PassManagerBuilderRef
,
1613 PM
: PassManagerRef
);
1615 pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
1616 PMB
: PassManagerBuilderRef
,
1617 PM
: PassManagerRef
);
1618 pub fn LLVMPassManagerBuilderPopulateLTOPassManager(
1619 PMB
: PassManagerBuilderRef
,
1624 /// Destroys a memory buffer.
1625 pub fn LLVMDisposeMemoryBuffer(MemBuf
: MemoryBufferRef
);
1628 /* Stuff that's in rustllvm/ because it's not upstream yet. */
1630 /// Opens an object file.
1631 pub fn LLVMCreateObjectFile(MemBuf
: MemoryBufferRef
) -> ObjectFileRef
;
1632 /// Closes an object file.
1633 pub fn LLVMDisposeObjectFile(ObjFile
: ObjectFileRef
);
1635 /// Enumerates the sections in an object file.
1636 pub fn LLVMGetSections(ObjFile
: ObjectFileRef
) -> SectionIteratorRef
;
1637 /// Destroys a section iterator.
1638 pub fn LLVMDisposeSectionIterator(SI
: SectionIteratorRef
);
1639 /// Returns true if the section iterator is at the end of the section
1641 pub fn LLVMIsSectionIteratorAtEnd(ObjFile
: ObjectFileRef
,
1642 SI
: SectionIteratorRef
)
1644 /// Moves the section iterator to point to the next section.
1645 pub fn LLVMMoveToNextSection(SI
: SectionIteratorRef
);
1646 /// Returns the current section size.
1647 pub fn LLVMGetSectionSize(SI
: SectionIteratorRef
) -> c_ulonglong
;
1648 /// Returns the current section contents as a string buffer.
1649 pub fn LLVMGetSectionContents(SI
: SectionIteratorRef
) -> *const c_char
;
1651 /// Reads the given file and returns it as a memory buffer. Use
1652 /// LLVMDisposeMemoryBuffer() to get rid of it.
1653 pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path
: *const c_char
)
1655 /// Borrows the contents of the memory buffer (doesn't copy it)
1656 pub fn LLVMCreateMemoryBufferWithMemoryRange(InputData
: *const c_char
,
1657 InputDataLength
: size_t
,
1658 BufferName
: *const c_char
,
1661 pub fn LLVMCreateMemoryBufferWithMemoryRangeCopy(InputData
: *const c_char
,
1662 InputDataLength
: size_t
,
1663 BufferName
: *const c_char
)
1666 pub fn LLVMIsMultithreaded() -> Bool
;
1667 pub fn LLVMStartMultithreaded() -> Bool
;
1669 /// Returns a string describing the last error caused by an LLVMRust* call.
1670 pub fn LLVMRustGetLastError() -> *const c_char
;
1672 /// Print the pass timings since static dtors aren't picking them up.
1673 pub fn LLVMRustPrintPassTimings();
1675 pub fn LLVMStructCreateNamed(C
: ContextRef
, Name
: *const c_char
) -> TypeRef
;
1677 pub fn LLVMStructSetBody(StructTy
: TypeRef
,
1678 ElementTypes
: *const TypeRef
,
1679 ElementCount
: c_uint
,
1682 pub fn LLVMConstNamedStruct(S
: TypeRef
,
1683 ConstantVals
: *const ValueRef
,
1687 /// Enables LLVM debug output.
1688 pub fn LLVMRustSetDebug(Enabled
: c_int
);
1690 /// Prepares inline assembly.
1691 pub fn LLVMRustInlineAsm(Ty
: TypeRef
,
1692 AsmString
: *const c_char
,
1693 Constraints
: *const c_char
,
1696 Dialect
: AsmDialect
)
1699 pub fn LLVMRustDebugMetadataVersion() -> u32;
1700 pub fn LLVMRustVersionMajor() -> u32;
1701 pub fn LLVMRustVersionMinor() -> u32;
1703 pub fn LLVMRustAddModuleFlag(M
: ModuleRef
,
1704 name
: *const c_char
,
1707 pub fn LLVMRustDIBuilderCreate(M
: ModuleRef
) -> DIBuilderRef
;
1709 pub fn LLVMRustDIBuilderDispose(Builder
: DIBuilderRef
);
1711 pub fn LLVMRustDIBuilderFinalize(Builder
: DIBuilderRef
);
1713 pub fn LLVMRustDIBuilderCreateCompileUnit(Builder
: DIBuilderRef
,
1715 File
: *const c_char
,
1717 Producer
: *const c_char
,
1719 Flags
: *const c_char
,
1721 SplitName
: *const c_char
)
1724 pub fn LLVMRustDIBuilderCreateFile(Builder
: DIBuilderRef
,
1725 Filename
: *const c_char
,
1726 Directory
: *const c_char
)
1729 pub fn LLVMRustDIBuilderCreateSubroutineType(Builder
: DIBuilderRef
,
1731 ParameterTypes
: DIArray
)
1734 pub fn LLVMRustDIBuilderCreateFunction(Builder
: DIBuilderRef
,
1735 Scope
: DIDescriptor
,
1736 Name
: *const c_char
,
1737 LinkageName
: *const c_char
,
1741 isLocalToUnit
: bool
,
1751 pub fn LLVMRustDIBuilderCreateBasicType(Builder
: DIBuilderRef
,
1752 Name
: *const c_char
,
1758 pub fn LLVMRustDIBuilderCreatePointerType(Builder
: DIBuilderRef
,
1762 Name
: *const c_char
)
1765 pub fn LLVMRustDIBuilderCreateStructType(Builder
: DIBuilderRef
,
1766 Scope
: DIDescriptor
,
1767 Name
: *const c_char
,
1773 DerivedFrom
: DIType
,
1775 RunTimeLang
: c_uint
,
1776 VTableHolder
: DIType
,
1777 UniqueId
: *const c_char
)
1780 pub fn LLVMRustDIBuilderCreateMemberType(Builder
: DIBuilderRef
,
1781 Scope
: DIDescriptor
,
1782 Name
: *const c_char
,
1792 pub fn LLVMRustDIBuilderCreateLexicalBlock(Builder
: DIBuilderRef
,
1799 pub fn LLVMRustDIBuilderCreateStaticVariable(Builder
: DIBuilderRef
,
1801 Name
: *const c_char
,
1802 LinkageName
: *const c_char
,
1806 isLocalToUnit
: bool
,
1809 -> DIGlobalVariable
;
1811 pub fn LLVMRustDIBuilderCreateVariable(Builder
: DIBuilderRef
,
1813 Scope
: DIDescriptor
,
1814 Name
: *const c_char
,
1818 AlwaysPreserve
: bool
,
1820 AddrOps
: *const i64,
1821 AddrOpsCount
: c_uint
,
1825 pub fn LLVMRustDIBuilderCreateArrayType(Builder
: DIBuilderRef
,
1829 Subscripts
: DIArray
)
1832 pub fn LLVMRustDIBuilderCreateVectorType(Builder
: DIBuilderRef
,
1836 Subscripts
: DIArray
)
1839 pub fn LLVMRustDIBuilderGetOrCreateSubrange(Builder
: DIBuilderRef
,
1844 pub fn LLVMRustDIBuilderGetOrCreateArray(Builder
: DIBuilderRef
,
1845 Ptr
: *const DIDescriptor
,
1849 pub fn LLVMRustDIBuilderInsertDeclareAtEnd(Builder
: DIBuilderRef
,
1851 VarInfo
: DIVariable
,
1852 AddrOps
: *const i64,
1853 AddrOpsCount
: c_uint
,
1855 InsertAtEnd
: BasicBlockRef
)
1858 pub fn LLVMRustDIBuilderInsertDeclareBefore(Builder
: DIBuilderRef
,
1860 VarInfo
: DIVariable
,
1861 AddrOps
: *const i64,
1862 AddrOpsCount
: c_uint
,
1864 InsertBefore
: ValueRef
)
1867 pub fn LLVMRustDIBuilderCreateEnumerator(Builder
: DIBuilderRef
,
1868 Name
: *const c_char
,
1872 pub fn LLVMRustDIBuilderCreateEnumerationType(Builder
: DIBuilderRef
,
1874 Name
: *const c_char
,
1883 pub fn LLVMRustDIBuilderCreateUnionType(Builder
: DIBuilderRef
,
1885 Name
: *const c_char
,
1892 RunTimeLang
: c_uint
,
1893 UniqueId
: *const c_char
)
1896 pub fn LLVMSetUnnamedAddr(GlobalVar
: ValueRef
, UnnamedAddr
: Bool
);
1898 pub fn LLVMRustDIBuilderCreateTemplateTypeParameter(Builder
: DIBuilderRef
,
1900 Name
: *const c_char
,
1905 -> DITemplateTypeParameter
;
1908 pub fn LLVMRustDIBuilderCreateNameSpace(Builder
: DIBuilderRef
,
1910 Name
: *const c_char
,
1914 pub fn LLVMRustDICompositeTypeSetTypeArray(Builder
: DIBuilderRef
,
1915 CompositeType
: DIType
,
1916 TypeArray
: DIArray
);
1919 pub fn LLVMRustDIBuilderCreateDebugLocation(Context
: ContextRef
,
1923 InlinedAt
: MetadataRef
)
1925 pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
1926 pub fn LLVMRustDIBuilderCreateOpPlus() -> i64;
1928 pub fn LLVMRustWriteTypeToString(Type
: TypeRef
, s
: RustStringRef
);
1929 pub fn LLVMRustWriteValueToString(value_ref
: ValueRef
, s
: RustStringRef
);
1931 pub fn LLVMIsAArgument(value_ref
: ValueRef
) -> ValueRef
;
1933 pub fn LLVMIsAAllocaInst(value_ref
: ValueRef
) -> ValueRef
;
1934 pub fn LLVMIsAConstantInt(value_ref
: ValueRef
) -> ValueRef
;
1936 pub fn LLVMRustPassKind(Pass
: PassRef
) -> PassKind
;
1937 pub fn LLVMRustFindAndCreatePass(Pass
: *const c_char
) -> PassRef
;
1938 pub fn LLVMRustAddPass(PM
: PassManagerRef
, Pass
: PassRef
);
1940 pub fn LLVMRustHasFeature(T
: TargetMachineRef
,
1941 s
: *const c_char
) -> bool
;
1943 pub fn LLVMRustPrintTargetCPUs(T
: TargetMachineRef
);
1944 pub fn LLVMRustPrintTargetFeatures(T
: TargetMachineRef
);
1946 pub fn LLVMRustCreateTargetMachine(Triple
: *const c_char
,
1948 Features
: *const c_char
,
1951 Level
: CodeGenOptLevel
,
1953 PositionIndependentExecutable
: bool
,
1954 FunctionSections
: bool
,
1955 DataSections
: bool
) -> TargetMachineRef
;
1956 pub fn LLVMRustDisposeTargetMachine(T
: TargetMachineRef
);
1957 pub fn LLVMRustAddAnalysisPasses(T
: TargetMachineRef
,
1960 pub fn LLVMRustAddBuilderLibraryInfo(PMB
: PassManagerBuilderRef
,
1962 DisableSimplifyLibCalls
: bool
);
1963 pub fn LLVMRustConfigurePassManagerBuilder(PMB
: PassManagerBuilderRef
,
1964 OptLevel
: CodeGenOptLevel
,
1965 MergeFunctions
: bool
,
1967 LoopVectorize
: bool
);
1968 pub fn LLVMRustAddLibraryInfo(PM
: PassManagerRef
, M
: ModuleRef
,
1969 DisableSimplifyLibCalls
: bool
);
1970 pub fn LLVMRustRunFunctionPassManager(PM
: PassManagerRef
, M
: ModuleRef
);
1971 pub fn LLVMRustWriteOutputFile(T
: TargetMachineRef
,
1974 Output
: *const c_char
,
1977 pub fn LLVMRustPrintModule(PM
: PassManagerRef
,
1979 Output
: *const c_char
);
1980 pub fn LLVMRustSetLLVMOptions(Argc
: c_int
, Argv
: *const *const c_char
);
1981 pub fn LLVMRustPrintPasses();
1982 pub fn LLVMRustSetNormalizedTarget(M
: ModuleRef
, triple
: *const c_char
);
1983 pub fn LLVMRustAddAlwaysInlinePass(P
: PassManagerBuilderRef
,
1984 AddLifetimes
: bool
);
1985 pub fn LLVMRustLinkInExternalBitcode(M
: ModuleRef
,
1987 len
: size_t
) -> bool
;
1988 pub fn LLVMRustRunRestrictionPass(M
: ModuleRef
,
1989 syms
: *const *const c_char
,
1991 pub fn LLVMRustMarkAllFunctionsNounwind(M
: ModuleRef
);
1993 pub fn LLVMRustOpenArchive(path
: *const c_char
) -> ArchiveRef
;
1994 pub fn LLVMRustArchiveIteratorNew(AR
: ArchiveRef
) -> ArchiveIteratorRef
;
1995 pub fn LLVMRustArchiveIteratorNext(AIR
: ArchiveIteratorRef
) -> ArchiveChildRef
;
1996 pub fn LLVMRustArchiveChildName(ACR
: ArchiveChildRef
,
1997 size
: *mut size_t
) -> *const c_char
;
1998 pub fn LLVMRustArchiveChildData(ACR
: ArchiveChildRef
,
1999 size
: *mut size_t
) -> *const c_char
;
2000 pub fn LLVMRustArchiveChildFree(ACR
: ArchiveChildRef
);
2001 pub fn LLVMRustArchiveIteratorFree(AIR
: ArchiveIteratorRef
);
2002 pub fn LLVMRustDestroyArchive(AR
: ArchiveRef
);
2004 pub fn LLVMRustGetSectionName(SI
: SectionIteratorRef
,
2005 data
: *mut *const c_char
) -> size_t
;
2007 pub fn LLVMRustWriteTwineToString(T
: TwineRef
, s
: RustStringRef
);
2009 pub fn LLVMContextSetDiagnosticHandler(C
: ContextRef
,
2010 Handler
: DiagnosticHandler
,
2011 DiagnosticContext
: *mut c_void
);
2013 pub fn LLVMRustUnpackOptimizationDiagnostic(DI
: DiagnosticInfoRef
,
2014 pass_name_out
: *mut *const c_char
,
2015 function_out
: *mut ValueRef
,
2016 debugloc_out
: *mut DebugLocRef
,
2017 message_out
: *mut TwineRef
);
2018 pub fn LLVMRustUnpackInlineAsmDiagnostic(DI
: DiagnosticInfoRef
,
2019 cookie_out
: *mut c_uint
,
2020 message_out
: *mut TwineRef
,
2021 instruction_out
: *mut ValueRef
);
2023 pub fn LLVMRustWriteDiagnosticInfoToString(DI
: DiagnosticInfoRef
,
2025 pub fn LLVMGetDiagInfoSeverity(DI
: DiagnosticInfoRef
) -> DiagnosticSeverity
;
2026 pub fn LLVMRustGetDiagInfoKind(DI
: DiagnosticInfoRef
) -> DiagnosticKind
;
2028 pub fn LLVMRustWriteDebugLocToString(C
: ContextRef
,
2032 pub fn LLVMRustSetInlineAsmDiagnosticHandler(C
: ContextRef
,
2033 H
: InlineAsmDiagHandler
,
2036 pub fn LLVMRustWriteSMDiagnosticToString(d
: SMDiagnosticRef
, s
: RustStringRef
);
2038 pub fn LLVMRustWriteArchive(Dst
: *const c_char
,
2040 Members
: *const RustArchiveMemberRef
,
2042 Kind
: ArchiveKind
) ->
2044 pub fn LLVMRustArchiveMemberNew(Filename
: *const c_char
,
2045 Name
: *const c_char
,
2046 Child
: ArchiveChildRef
) -> RustArchiveMemberRef
;
2047 pub fn LLVMRustArchiveMemberFree(Member
: RustArchiveMemberRef
);
2049 pub fn LLVMRustSetDataLayoutFromTargetMachine(M
: ModuleRef
,
2050 TM
: TargetMachineRef
);
2051 pub fn LLVMRustGetModuleDataLayout(M
: ModuleRef
) -> TargetDataRef
;
2053 pub fn LLVMRustBuildOperandBundleDef(Name
: *const c_char
,
2054 Inputs
: *const ValueRef
,
2056 -> OperandBundleDefRef
;
2057 pub fn LLVMRustFreeOperandBundleDef(Bundle
: OperandBundleDefRef
);
2059 pub fn LLVMRustPositionBuilderAtStart(B
: BuilderRef
, BB
: BasicBlockRef
);
2061 pub fn LLVMRustSetComdat(M
: ModuleRef
, V
: ValueRef
, Name
: *const c_char
);
2062 pub fn LLVMRustUnsetComdat(V
: ValueRef
);
2063 pub fn LLVMRustSetModulePIELevel(M
: ModuleRef
);
2067 // LLVM requires symbols from this library, but apparently they're not printed
2068 // during llvm-config?
2070 #[link(name = "ole32")]