1 #![allow(non_camel_case_types)]
2 #![allow(non_upper_case_globals)]
4 use rustc_codegen_ssa
::coverageinfo
::map
as coverage_map
;
6 use super::debuginfo
::{
7 DIArray
, DIBasicType
, DIBuilder
, DICompositeType
, DIDerivedType
, DIDescriptor
, DIEnumerator
,
8 DIFile
, DIFlags
, DIGlobalVariableExpression
, DILexicalBlock
, DILocation
, DINameSpace
,
9 DISPFlags
, DIScope
, DISubprogram
, DISubrange
, DITemplateTypeParameter
, DIType
, DIVariable
,
13 use libc
::{c_char, c_int, c_uint, size_t}
;
14 use libc
::{c_ulonglong, c_void}
;
16 use std
::marker
::PhantomData
;
18 use super::RustString
;
20 pub type Bool
= c_uint
;
22 pub const True
: Bool
= 1 as Bool
;
23 pub const False
: Bool
= 0 as Bool
;
25 #[derive(Copy, Clone, PartialEq)]
27 #[allow(dead_code)] // Variants constructed by C++.
28 pub enum LLVMRustResult
{
32 // Consts for the LLVM CallConv type, pre-cast to usize.
34 /// LLVM CallingConv::ID. Should we wrap this?
35 #[derive(Copy, Clone, PartialEq, Debug)]
41 X86StdcallCallConv
= 64,
42 X86FastcallCallConv
= 65,
43 ArmAapcsCallConv
= 67,
51 AvrNonBlockingInterrupt
= 84,
61 AvailableExternallyLinkage
= 1,
62 LinkOnceAnyLinkage
= 2,
63 LinkOnceODRLinkage
= 3,
69 ExternalWeakLinkage
= 9,
83 pub enum UnnamedAddr
{
89 /// LLVMDLLStorageClass
90 #[derive(Copy, Clone)]
92 pub enum DLLStorageClass
{
95 DllImport
= 1, // Function to be imported from DLL.
97 DllExport
= 2, // Function to be accessible from DLL.
100 /// Matches LLVMRustAttribute in LLVMWrapper.h
101 /// Semantically a subset of the C++ enum llvm::Attribute::AttrKind,
102 /// though it is not ABI compatible (since it's a C++ enum)
104 #[derive(Copy, Clone, Debug)]
119 OptimizeForSize
= 13,
127 SanitizeAddress
= 21,
133 InaccessibleMemOnly
= 27,
137 #[derive(Copy, Clone)]
139 pub enum IntPredicate
{
153 pub fn from_generic(intpre
: rustc_codegen_ssa
::common
::IntPredicate
) -> Self {
155 rustc_codegen_ssa
::common
::IntPredicate
::IntEQ
=> IntPredicate
::IntEQ
,
156 rustc_codegen_ssa
::common
::IntPredicate
::IntNE
=> IntPredicate
::IntNE
,
157 rustc_codegen_ssa
::common
::IntPredicate
::IntUGT
=> IntPredicate
::IntUGT
,
158 rustc_codegen_ssa
::common
::IntPredicate
::IntUGE
=> IntPredicate
::IntUGE
,
159 rustc_codegen_ssa
::common
::IntPredicate
::IntULT
=> IntPredicate
::IntULT
,
160 rustc_codegen_ssa
::common
::IntPredicate
::IntULE
=> IntPredicate
::IntULE
,
161 rustc_codegen_ssa
::common
::IntPredicate
::IntSGT
=> IntPredicate
::IntSGT
,
162 rustc_codegen_ssa
::common
::IntPredicate
::IntSGE
=> IntPredicate
::IntSGE
,
163 rustc_codegen_ssa
::common
::IntPredicate
::IntSLT
=> IntPredicate
::IntSLT
,
164 rustc_codegen_ssa
::common
::IntPredicate
::IntSLE
=> IntPredicate
::IntSLE
,
169 /// LLVMRealPredicate
170 #[derive(Copy, Clone)]
172 pub enum RealPredicate
{
173 RealPredicateFalse
= 0,
188 RealPredicateTrue
= 15,
192 pub fn from_generic(realpred
: rustc_codegen_ssa
::common
::RealPredicate
) -> Self {
194 rustc_codegen_ssa
::common
::RealPredicate
::RealPredicateFalse
=> {
195 RealPredicate
::RealPredicateFalse
197 rustc_codegen_ssa
::common
::RealPredicate
::RealOEQ
=> RealPredicate
::RealOEQ
,
198 rustc_codegen_ssa
::common
::RealPredicate
::RealOGT
=> RealPredicate
::RealOGT
,
199 rustc_codegen_ssa
::common
::RealPredicate
::RealOGE
=> RealPredicate
::RealOGE
,
200 rustc_codegen_ssa
::common
::RealPredicate
::RealOLT
=> RealPredicate
::RealOLT
,
201 rustc_codegen_ssa
::common
::RealPredicate
::RealOLE
=> RealPredicate
::RealOLE
,
202 rustc_codegen_ssa
::common
::RealPredicate
::RealONE
=> RealPredicate
::RealONE
,
203 rustc_codegen_ssa
::common
::RealPredicate
::RealORD
=> RealPredicate
::RealORD
,
204 rustc_codegen_ssa
::common
::RealPredicate
::RealUNO
=> RealPredicate
::RealUNO
,
205 rustc_codegen_ssa
::common
::RealPredicate
::RealUEQ
=> RealPredicate
::RealUEQ
,
206 rustc_codegen_ssa
::common
::RealPredicate
::RealUGT
=> RealPredicate
::RealUGT
,
207 rustc_codegen_ssa
::common
::RealPredicate
::RealUGE
=> RealPredicate
::RealUGE
,
208 rustc_codegen_ssa
::common
::RealPredicate
::RealULT
=> RealPredicate
::RealULT
,
209 rustc_codegen_ssa
::common
::RealPredicate
::RealULE
=> RealPredicate
::RealULE
,
210 rustc_codegen_ssa
::common
::RealPredicate
::RealUNE
=> RealPredicate
::RealUNE
,
211 rustc_codegen_ssa
::common
::RealPredicate
::RealPredicateTrue
=> {
212 RealPredicate
::RealPredicateTrue
219 #[derive(Copy, Clone, PartialEq, Debug)]
244 pub fn to_generic(self) -> rustc_codegen_ssa
::common
::TypeKind
{
246 TypeKind
::Void
=> rustc_codegen_ssa
::common
::TypeKind
::Void
,
247 TypeKind
::Half
=> rustc_codegen_ssa
::common
::TypeKind
::Half
,
248 TypeKind
::Float
=> rustc_codegen_ssa
::common
::TypeKind
::Float
,
249 TypeKind
::Double
=> rustc_codegen_ssa
::common
::TypeKind
::Double
,
250 TypeKind
::X86_FP80
=> rustc_codegen_ssa
::common
::TypeKind
::X86_FP80
,
251 TypeKind
::FP128
=> rustc_codegen_ssa
::common
::TypeKind
::FP128
,
252 TypeKind
::PPC_FP128
=> rustc_codegen_ssa
::common
::TypeKind
::PPC_FP128
,
253 TypeKind
::Label
=> rustc_codegen_ssa
::common
::TypeKind
::Label
,
254 TypeKind
::Integer
=> rustc_codegen_ssa
::common
::TypeKind
::Integer
,
255 TypeKind
::Function
=> rustc_codegen_ssa
::common
::TypeKind
::Function
,
256 TypeKind
::Struct
=> rustc_codegen_ssa
::common
::TypeKind
::Struct
,
257 TypeKind
::Array
=> rustc_codegen_ssa
::common
::TypeKind
::Array
,
258 TypeKind
::Pointer
=> rustc_codegen_ssa
::common
::TypeKind
::Pointer
,
259 TypeKind
::Vector
=> rustc_codegen_ssa
::common
::TypeKind
::Vector
,
260 TypeKind
::Metadata
=> rustc_codegen_ssa
::common
::TypeKind
::Metadata
,
261 TypeKind
::X86_MMX
=> rustc_codegen_ssa
::common
::TypeKind
::X86_MMX
,
262 TypeKind
::Token
=> rustc_codegen_ssa
::common
::TypeKind
::Token
,
263 TypeKind
::ScalableVector
=> rustc_codegen_ssa
::common
::TypeKind
::ScalableVector
,
264 TypeKind
::BFloat
=> rustc_codegen_ssa
::common
::TypeKind
::BFloat
,
269 /// LLVMAtomicRmwBinOp
270 #[derive(Copy, Clone)]
272 pub enum AtomicRmwBinOp
{
286 impl AtomicRmwBinOp
{
287 pub fn from_generic(op
: rustc_codegen_ssa
::common
::AtomicRmwBinOp
) -> Self {
289 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicXchg
=> AtomicRmwBinOp
::AtomicXchg
,
290 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicAdd
=> AtomicRmwBinOp
::AtomicAdd
,
291 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicSub
=> AtomicRmwBinOp
::AtomicSub
,
292 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicAnd
=> AtomicRmwBinOp
::AtomicAnd
,
293 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicNand
=> AtomicRmwBinOp
::AtomicNand
,
294 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicOr
=> AtomicRmwBinOp
::AtomicOr
,
295 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicXor
=> AtomicRmwBinOp
::AtomicXor
,
296 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicMax
=> AtomicRmwBinOp
::AtomicMax
,
297 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicMin
=> AtomicRmwBinOp
::AtomicMin
,
298 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicUMax
=> AtomicRmwBinOp
::AtomicUMax
,
299 rustc_codegen_ssa
::common
::AtomicRmwBinOp
::AtomicUMin
=> AtomicRmwBinOp
::AtomicUMin
,
304 /// LLVMAtomicOrdering
305 #[derive(Copy, Clone)]
307 pub enum AtomicOrdering
{
312 // Consume = 3, // Not specified yet.
316 SequentiallyConsistent
= 7,
319 impl AtomicOrdering
{
320 pub fn from_generic(ao
: rustc_codegen_ssa
::common
::AtomicOrdering
) -> Self {
322 rustc_codegen_ssa
::common
::AtomicOrdering
::NotAtomic
=> AtomicOrdering
::NotAtomic
,
323 rustc_codegen_ssa
::common
::AtomicOrdering
::Unordered
=> AtomicOrdering
::Unordered
,
324 rustc_codegen_ssa
::common
::AtomicOrdering
::Monotonic
=> AtomicOrdering
::Monotonic
,
325 rustc_codegen_ssa
::common
::AtomicOrdering
::Acquire
=> AtomicOrdering
::Acquire
,
326 rustc_codegen_ssa
::common
::AtomicOrdering
::Release
=> AtomicOrdering
::Release
,
327 rustc_codegen_ssa
::common
::AtomicOrdering
::AcquireRelease
=> {
328 AtomicOrdering
::AcquireRelease
330 rustc_codegen_ssa
::common
::AtomicOrdering
::SequentiallyConsistent
=> {
331 AtomicOrdering
::SequentiallyConsistent
337 /// LLVMRustSynchronizationScope
338 #[derive(Copy, Clone)]
340 pub enum SynchronizationScope
{
345 impl SynchronizationScope
{
346 pub fn from_generic(sc
: rustc_codegen_ssa
::common
::SynchronizationScope
) -> Self {
348 rustc_codegen_ssa
::common
::SynchronizationScope
::SingleThread
=> {
349 SynchronizationScope
::SingleThread
351 rustc_codegen_ssa
::common
::SynchronizationScope
::CrossThread
=> {
352 SynchronizationScope
::CrossThread
359 #[derive(Copy, Clone)]
367 #[derive(Copy, Clone)]
369 pub enum MetadataType
{
376 MD_invariant_load
= 6,
380 MD_mem_parallel_loop_access
= 10,
384 /// LLVMRustAsmDialect
385 #[derive(Copy, Clone)]
387 pub enum AsmDialect
{
393 pub fn from_generic(asm
: rustc_ast
::LlvmAsmDialect
) -> Self {
395 rustc_ast
::LlvmAsmDialect
::Att
=> AsmDialect
::Att
,
396 rustc_ast
::LlvmAsmDialect
::Intel
=> AsmDialect
::Intel
,
401 /// LLVMRustCodeGenOptLevel
402 #[derive(Copy, Clone, PartialEq)]
404 pub enum CodeGenOptLevel
{
411 /// LLVMRustPassBuilderOptLevel
413 pub enum PassBuilderOptLevel
{
433 /// LLVMRustSanitizerOptions
435 pub struct SanitizerOptions
{
436 pub sanitize_address
: bool
,
437 pub sanitize_address_recover
: bool
,
438 pub sanitize_memory
: bool
,
439 pub sanitize_memory_recover
: bool
,
440 pub sanitize_memory_track_origins
: c_int
,
441 pub sanitize_thread
: bool
,
445 #[derive(Copy, Clone, PartialEq)]
447 pub enum RelocModel
{
456 /// LLVMRustCodeModel
457 #[derive(Copy, Clone)]
468 /// LLVMRustDiagnosticKind
469 #[derive(Copy, Clone)]
471 #[allow(dead_code)] // Variants constructed by C++.
472 pub enum DiagnosticKind
{
476 DebugMetadataVersion
,
479 OptimizationRemarkMissed
,
480 OptimizationRemarkAnalysis
,
481 OptimizationRemarkAnalysisFPCommute
,
482 OptimizationRemarkAnalysisAliasing
,
483 OptimizationRemarkOther
,
490 /// LLVMRustDiagnosticLevel
491 #[derive(Copy, Clone)]
493 #[allow(dead_code)] // Variants constructed by C++.
494 pub enum DiagnosticLevel
{
501 /// LLVMRustArchiveKind
502 #[derive(Copy, Clone)]
504 pub enum ArchiveKind
{
512 #[derive(Copy, Clone, PartialEq, Debug)]
514 #[allow(dead_code)] // Variants constructed by C++.
521 /// LLVMRustThinLTOData
523 pub type ThinLTOData
;
526 /// LLVMRustThinLTOBuffer
528 pub type ThinLTOBuffer
;
531 // LLVMRustModuleNameCallback
532 pub type ThinLTOModuleNameCallback
=
533 unsafe extern "C" fn(*mut c_void
, *const c_char
, *const c_char
);
535 /// LLVMRustThinLTOModule
537 pub struct ThinLTOModule
{
538 pub identifier
: *const c_char
,
543 /// LLVMThreadLocalMode
544 #[derive(Copy, Clone)]
546 pub enum ThreadLocalMode
{
554 /// LLVMRustChecksumKind
555 #[derive(Copy, Clone)]
557 pub enum ChecksumKind
{
568 struct InvariantOpaque
<'a
> {
569 _marker
: PhantomData
<&'a
mut &'
a ()>,
573 // Opaque pointer types
587 pub type ConstantInt
;
596 pub struct Builder
<'a
>(InvariantOpaque
<'a
>);
598 pub type MemoryBuffer
;
601 pub struct PassManager
<'a
>(InvariantOpaque
<'a
>);
603 pub type PassManagerBuilder
;
609 pub struct SectionIterator
<'a
>(InvariantOpaque
<'a
>);
614 pub type TargetMachine
;
620 pub struct ArchiveIterator
<'a
>(InvariantOpaque
<'a
>);
622 pub struct ArchiveChild
<'a
>(InvariantOpaque
<'a
>);
627 pub type DiagnosticInfo
;
630 pub type SMDiagnostic
;
633 pub struct RustArchiveMember
<'a
>(InvariantOpaque
<'a
>);
635 pub struct OperandBundleDef
<'a
>(InvariantOpaque
<'a
>);
637 pub struct Linker
<'a
>(InvariantOpaque
<'a
>);
639 pub type DiagnosticHandler
= unsafe extern "C" fn(&DiagnosticInfo
, *mut c_void
);
640 pub type InlineAsmDiagHandler
= unsafe extern "C" fn(&SMDiagnostic
, *const c_void
, c_uint
);
642 pub mod coverageinfo
{
643 use super::coverage_map
;
645 /// Aligns with [llvm::coverage::CounterMappingRegion::RegionKind](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L206-L222)
646 #[derive(Copy, Clone, Debug)]
648 pub enum RegionKind
{
649 /// A CodeRegion associates some code with a counter
652 /// An ExpansionRegion represents a file expansion region that associates
653 /// a source range with the expansion of a virtual source file, such as
654 /// for a macro instantiation or #include file.
657 /// A SkippedRegion represents a source range with code that was skipped
658 /// by a preprocessor or similar means.
661 /// A GapRegion is like a CodeRegion, but its count is only set as the
662 /// line execution count when its the only region in the line.
666 /// This struct provides LLVM's representation of a "CoverageMappingRegion", encoded into the
667 /// coverage map, in accordance with the
668 /// [LLVM Code Coverage Mapping Format](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/docs/CoverageMappingFormat.rst#llvm-code-coverage-mapping-format).
669 /// The struct composes fields representing the `Counter` type and value(s) (injected counter
670 /// ID, or expression type and operands), the source file (an indirect index into a "filenames
671 /// array", encoded separately), and source location (start and end positions of the represented
674 /// Aligns with [llvm::coverage::CounterMappingRegion](https://github.com/rust-lang/llvm-project/blob/rustc/11.0-2020-10-12/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h#L224-L227)
675 /// Important: The Rust struct layout (order and types of fields) must match its C++
677 #[derive(Copy, Clone, Debug)]
679 pub struct CounterMappingRegion
{
680 /// The counter type and type-dependent counter data, if any.
681 counter
: coverage_map
::Counter
,
683 /// An indirect reference to the source filename. In the LLVM Coverage Mapping Format, the
684 /// file_id is an index into a function-specific `virtual_file_mapping` array of indexes
685 /// that, in turn, are used to look up the filename for this region.
688 /// If the `RegionKind` is an `ExpansionRegion`, the `expanded_file_id` can be used to find
689 /// the mapping regions created as a result of macro expansion, by checking if their file id
690 /// matches the expanded file id.
691 expanded_file_id
: u32,
693 /// 1-based starting line of the mapping region.
696 /// 1-based starting column of the mapping region.
699 /// 1-based ending line of the mapping region.
702 /// 1-based ending column of the mapping region. If the high bit is set, the current
703 /// mapping region is a gap area.
709 impl CounterMappingRegion
{
711 counter
: coverage_map
::Counter
,
726 kind
: RegionKind
::CodeRegion
,
730 pub fn expansion_region(
732 expanded_file_id
: u32,
739 counter
: coverage_map
::Counter
::zero(),
746 kind
: RegionKind
::ExpansionRegion
,
750 pub fn skipped_region(
758 counter
: coverage_map
::Counter
::zero(),
765 kind
: RegionKind
::SkippedRegion
,
770 counter
: coverage_map
::Counter
,
784 end_col
: ((1 as u32) << 31) | end_col
,
785 kind
: RegionKind
::GapRegion
,
792 use super::{InvariantOpaque, Metadata}
;
793 use bitflags
::bitflags
;
796 pub struct DIBuilder
<'a
>(InvariantOpaque
<'a
>);
798 pub type DIDescriptor
= Metadata
;
799 pub type DILocation
= Metadata
;
800 pub type DIScope
= DIDescriptor
;
801 pub type DIFile
= DIScope
;
802 pub type DILexicalBlock
= DIScope
;
803 pub type DISubprogram
= DIScope
;
804 pub type DINameSpace
= DIScope
;
805 pub type DIType
= DIDescriptor
;
806 pub type DIBasicType
= DIType
;
807 pub type DIDerivedType
= DIType
;
808 pub type DICompositeType
= DIDerivedType
;
809 pub type DIVariable
= DIDescriptor
;
810 pub type DIGlobalVariableExpression
= DIDescriptor
;
811 pub type DIArray
= DIDescriptor
;
812 pub type DISubrange
= DIDescriptor
;
813 pub type DIEnumerator
= DIDescriptor
;
814 pub type DITemplateTypeParameter
= DIDescriptor
;
816 // These values **must** match with LLVMRustDIFlags!!
820 pub struct DIFlags
: u32 {
822 const FlagPrivate
= 1;
823 const FlagProtected
= 2;
824 const FlagPublic
= 3;
825 const FlagFwdDecl
= (1 << 2);
826 const FlagAppleBlock
= (1 << 3);
827 const FlagBlockByrefStruct
= (1 << 4);
828 const FlagVirtual
= (1 << 5);
829 const FlagArtificial
= (1 << 6);
830 const FlagExplicit
= (1 << 7);
831 const FlagPrototyped
= (1 << 8);
832 const FlagObjcClassComplete
= (1 << 9);
833 const FlagObjectPointer
= (1 << 10);
834 const FlagVector
= (1 << 11);
835 const FlagStaticMember
= (1 << 12);
836 const FlagLValueReference
= (1 << 13);
837 const FlagRValueReference
= (1 << 14);
838 const FlagExternalTypeRef
= (1 << 15);
839 const FlagIntroducedVirtual
= (1 << 18);
840 const FlagBitField
= (1 << 19);
841 const FlagNoReturn
= (1 << 20);
845 // These values **must** match with LLVMRustDISPFlags!!
849 pub struct DISPFlags
: u32 {
850 const SPFlagZero
= 0;
851 const SPFlagVirtual
= 1;
852 const SPFlagPureVirtual
= 2;
853 const SPFlagLocalToUnit
= (1 << 2);
854 const SPFlagDefinition
= (1 << 3);
855 const SPFlagOptimized
= (1 << 4);
856 const SPFlagMainSubprogram
= (1 << 5);
860 /// LLVMRustDebugEmissionKind
861 #[derive(Copy, Clone)]
863 pub enum DebugEmissionKind
{
869 impl DebugEmissionKind
{
870 pub fn from_generic(kind
: rustc_session
::config
::DebugInfo
) -> Self {
871 use rustc_session
::config
::DebugInfo
;
873 DebugInfo
::None
=> DebugEmissionKind
::NoDebug
,
874 DebugInfo
::Limited
=> DebugEmissionKind
::LineTablesOnly
,
875 DebugInfo
::Full
=> DebugEmissionKind
::FullDebug
,
882 pub type ModuleBuffer
;
885 pub type SelfProfileBeforePassCallback
=
886 unsafe extern "C" fn(*mut c_void
, *const c_char
, *const c_char
);
887 pub type SelfProfileAfterPassCallback
= unsafe extern "C" fn(*mut c_void
);
890 pub fn LLVMRustInstallFatalErrorHandler();
892 // Create and destroy contexts.
893 pub fn LLVMRustContextCreate(shouldDiscardNames
: bool
) -> &'
static mut Context
;
894 pub fn LLVMContextDispose(C
: &'
static mut Context
);
895 pub fn LLVMGetMDKindIDInContext(C
: &Context
, Name
: *const c_char
, SLen
: c_uint
) -> c_uint
;
898 pub fn LLVMModuleCreateWithNameInContext(ModuleID
: *const c_char
, C
: &Context
) -> &Module
;
899 pub fn LLVMGetModuleContext(M
: &Module
) -> &Context
;
900 pub fn LLVMCloneModule(M
: &Module
) -> &Module
;
902 /// Data layout. See Module::getDataLayout.
903 pub fn LLVMGetDataLayoutStr(M
: &Module
) -> *const c_char
;
904 pub fn LLVMSetDataLayout(M
: &Module
, Triple
: *const c_char
);
906 /// See Module::setModuleInlineAsm.
907 pub fn LLVMSetModuleInlineAsm2(M
: &Module
, Asm
: *const c_char
, AsmLen
: size_t
);
908 pub fn LLVMRustAppendModuleInlineAsm(M
: &Module
, Asm
: *const c_char
, AsmLen
: size_t
);
910 /// See llvm::LLVMTypeKind::getTypeID.
911 pub fn LLVMRustGetTypeKind(Ty
: &Type
) -> TypeKind
;
913 // Operations on integer types
914 pub fn LLVMInt1TypeInContext(C
: &Context
) -> &Type
;
915 pub fn LLVMInt8TypeInContext(C
: &Context
) -> &Type
;
916 pub fn LLVMInt16TypeInContext(C
: &Context
) -> &Type
;
917 pub fn LLVMInt32TypeInContext(C
: &Context
) -> &Type
;
918 pub fn LLVMInt64TypeInContext(C
: &Context
) -> &Type
;
919 pub fn LLVMIntTypeInContext(C
: &Context
, NumBits
: c_uint
) -> &Type
;
921 pub fn LLVMGetIntTypeWidth(IntegerTy
: &Type
) -> c_uint
;
923 // Operations on real types
924 pub fn LLVMFloatTypeInContext(C
: &Context
) -> &Type
;
925 pub fn LLVMDoubleTypeInContext(C
: &Context
) -> &Type
;
927 // Operations on function types
928 pub fn LLVMFunctionType(
929 ReturnType
: &'a Type
,
930 ParamTypes
: *const &'a Type
,
934 pub fn LLVMCountParamTypes(FunctionTy
: &Type
) -> c_uint
;
935 pub fn LLVMGetParamTypes(FunctionTy
: &'a Type
, Dest
: *mut &'a Type
);
937 // Operations on struct types
938 pub fn LLVMStructTypeInContext(
940 ElementTypes
: *const &'a Type
,
941 ElementCount
: c_uint
,
945 // Operations on array, pointer, and vector types (sequence types)
946 pub fn LLVMRustArrayType(ElementType
: &Type
, ElementCount
: u64) -> &Type
;
947 pub fn LLVMPointerType(ElementType
: &Type
, AddressSpace
: c_uint
) -> &Type
;
948 pub fn LLVMVectorType(ElementType
: &Type
, ElementCount
: c_uint
) -> &Type
;
950 pub fn LLVMGetElementType(Ty
: &Type
) -> &Type
;
951 pub fn LLVMGetVectorSize(VectorTy
: &Type
) -> c_uint
;
953 // Operations on other types
954 pub fn LLVMVoidTypeInContext(C
: &Context
) -> &Type
;
955 pub fn LLVMRustMetadataTypeInContext(C
: &Context
) -> &Type
;
957 // Operations on all values
958 pub fn LLVMTypeOf(Val
: &Value
) -> &Type
;
959 pub fn LLVMGetValueName2(Val
: &Value
, Length
: *mut size_t
) -> *const c_char
;
960 pub fn LLVMSetValueName2(Val
: &Value
, Name
: *const c_char
, NameLen
: size_t
);
961 pub fn LLVMReplaceAllUsesWith(OldVal
: &'a Value
, NewVal
: &'a Value
);
962 pub fn LLVMSetMetadata(Val
: &'a Value
, KindID
: c_uint
, Node
: &'a Value
);
964 // Operations on constants of any type
965 pub fn LLVMConstNull(Ty
: &Type
) -> &Value
;
966 pub fn LLVMGetUndef(Ty
: &Type
) -> &Value
;
968 // Operations on metadata
969 pub fn LLVMMDStringInContext(C
: &Context
, Str
: *const c_char
, SLen
: c_uint
) -> &Value
;
970 pub fn LLVMMDNodeInContext(C
: &'a Context
, Vals
: *const &'a Value
, Count
: c_uint
) -> &'a Value
;
971 pub fn LLVMAddNamedMetadataOperand(M
: &'a Module
, Name
: *const c_char
, Val
: &'a Value
);
973 // Operations on scalar constants
974 pub fn LLVMConstInt(IntTy
: &Type
, N
: c_ulonglong
, SignExtend
: Bool
) -> &Value
;
975 pub fn LLVMConstIntOfArbitraryPrecision(IntTy
: &Type
, Wn
: c_uint
, Ws
: *const u64) -> &Value
;
976 pub fn LLVMConstReal(RealTy
: &Type
, N
: f64) -> &Value
;
977 pub fn LLVMConstIntGetZExtValue(ConstantVal
: &ConstantInt
) -> c_ulonglong
;
978 pub fn LLVMRustConstInt128Get(
979 ConstantVal
: &ConstantInt
,
985 // Operations on composite constants
986 pub fn LLVMConstStringInContext(
990 DontNullTerminate
: Bool
,
992 pub fn LLVMConstStructInContext(
994 ConstantVals
: *const &'a Value
,
999 pub fn LLVMConstArray(
1000 ElementTy
: &'a Type
,
1001 ConstantVals
: *const &'a Value
,
1004 pub fn LLVMConstVector(ScalarConstantVals
: *const &Value
, Size
: c_uint
) -> &Value
;
1006 // Constant expressions
1007 pub fn LLVMConstInBoundsGEP(
1008 ConstantVal
: &'a Value
,
1009 ConstantIndices
: *const &'a Value
,
1012 pub fn LLVMConstZExt(ConstantVal
: &'a Value
, ToType
: &'a Type
) -> &'a Value
;
1013 pub fn LLVMConstPtrToInt(ConstantVal
: &'a Value
, ToType
: &'a Type
) -> &'a Value
;
1014 pub fn LLVMConstIntToPtr(ConstantVal
: &'a Value
, ToType
: &'a Type
) -> &'a Value
;
1015 pub fn LLVMConstBitCast(ConstantVal
: &'a Value
, ToType
: &'a Type
) -> &'a Value
;
1016 pub fn LLVMConstPointerCast(ConstantVal
: &'a Value
, ToType
: &'a Type
) -> &'a Value
;
1017 pub fn LLVMConstExtractValue(
1018 AggConstant
: &Value
,
1019 IdxList
: *const c_uint
,
1023 // Operations on global variables, functions, and aliases (globals)
1024 pub fn LLVMIsDeclaration(Global
: &Value
) -> Bool
;
1025 pub fn LLVMRustGetLinkage(Global
: &Value
) -> Linkage
;
1026 pub fn LLVMRustSetLinkage(Global
: &Value
, RustLinkage
: Linkage
);
1027 pub fn LLVMSetSection(Global
: &Value
, Section
: *const c_char
);
1028 pub fn LLVMRustGetVisibility(Global
: &Value
) -> Visibility
;
1029 pub fn LLVMRustSetVisibility(Global
: &Value
, Viz
: Visibility
);
1030 pub fn LLVMGetAlignment(Global
: &Value
) -> c_uint
;
1031 pub fn LLVMSetAlignment(Global
: &Value
, Bytes
: c_uint
);
1032 pub fn LLVMSetDLLStorageClass(V
: &Value
, C
: DLLStorageClass
);
1034 // Operations on global variables
1035 pub fn LLVMIsAGlobalVariable(GlobalVar
: &Value
) -> Option
<&Value
>;
1036 pub fn LLVMAddGlobal(M
: &'a Module
, Ty
: &'a Type
, Name
: *const c_char
) -> &'a Value
;
1037 pub fn LLVMGetNamedGlobal(M
: &Module
, Name
: *const c_char
) -> Option
<&Value
>;
1038 pub fn LLVMRustGetOrInsertGlobal(
1040 Name
: *const c_char
,
1044 pub fn LLVMRustInsertPrivateGlobal(M
: &'a Module
, T
: &'a Type
) -> &'a Value
;
1045 pub fn LLVMGetFirstGlobal(M
: &Module
) -> Option
<&Value
>;
1046 pub fn LLVMGetNextGlobal(GlobalVar
: &Value
) -> Option
<&Value
>;
1047 pub fn LLVMDeleteGlobal(GlobalVar
: &Value
);
1048 pub fn LLVMGetInitializer(GlobalVar
: &Value
) -> Option
<&Value
>;
1049 pub fn LLVMSetInitializer(GlobalVar
: &'a Value
, ConstantVal
: &'a Value
);
1050 pub fn LLVMSetThreadLocal(GlobalVar
: &Value
, IsThreadLocal
: Bool
);
1051 pub fn LLVMSetThreadLocalMode(GlobalVar
: &Value
, Mode
: ThreadLocalMode
);
1052 pub fn LLVMIsGlobalConstant(GlobalVar
: &Value
) -> Bool
;
1053 pub fn LLVMSetGlobalConstant(GlobalVar
: &Value
, IsConstant
: Bool
);
1054 pub fn LLVMRustGetNamedValue(
1056 Name
: *const c_char
,
1058 ) -> Option
<&Value
>;
1059 pub fn LLVMSetTailCall(CallInst
: &Value
, IsTailCall
: Bool
);
1061 // Operations on functions
1062 pub fn LLVMRustGetOrInsertFunction(
1064 Name
: *const c_char
,
1066 FunctionTy
: &'a Type
,
1068 pub fn LLVMSetFunctionCallConv(Fn
: &Value
, CC
: c_uint
);
1069 pub fn LLVMRustAddAlignmentAttr(Fn
: &Value
, index
: c_uint
, bytes
: u32);
1070 pub fn LLVMRustAddDereferenceableAttr(Fn
: &Value
, index
: c_uint
, bytes
: u64);
1071 pub fn LLVMRustAddDereferenceableOrNullAttr(Fn
: &Value
, index
: c_uint
, bytes
: u64);
1072 pub fn LLVMRustAddByValAttr(Fn
: &Value
, index
: c_uint
, ty
: &Type
);
1073 pub fn LLVMRustAddFunctionAttribute(Fn
: &Value
, index
: c_uint
, attr
: Attribute
);
1074 pub fn LLVMRustAddFunctionAttrStringValue(
1077 Name
: *const c_char
,
1078 Value
: *const c_char
,
1080 pub fn LLVMRustRemoveFunctionAttributes(Fn
: &Value
, index
: c_uint
, attr
: Attribute
);
1082 // Operations on parameters
1083 pub fn LLVMIsAArgument(Val
: &Value
) -> Option
<&Value
>;
1084 pub fn LLVMCountParams(Fn
: &Value
) -> c_uint
;
1085 pub fn LLVMGetParam(Fn
: &Value
, Index
: c_uint
) -> &Value
;
1087 // Operations on basic blocks
1088 pub fn LLVMGetBasicBlockParent(BB
: &BasicBlock
) -> &Value
;
1089 pub fn LLVMAppendBasicBlockInContext(
1092 Name
: *const c_char
,
1093 ) -> &'a BasicBlock
;
1094 pub fn LLVMDeleteBasicBlock(BB
: &BasicBlock
);
1096 // Operations on instructions
1097 pub fn LLVMIsAInstruction(Val
: &Value
) -> Option
<&Value
>;
1098 pub fn LLVMGetFirstBasicBlock(Fn
: &Value
) -> &BasicBlock
;
1100 // Operations on call sites
1101 pub fn LLVMSetInstructionCallConv(Instr
: &Value
, CC
: c_uint
);
1102 pub fn LLVMRustAddCallSiteAttribute(Instr
: &Value
, index
: c_uint
, attr
: Attribute
);
1103 pub fn LLVMRustAddCallSiteAttrString(Instr
: &Value
, index
: c_uint
, Name
: *const c_char
);
1104 pub fn LLVMRustAddAlignmentCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u32);
1105 pub fn LLVMRustAddDereferenceableCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u64);
1106 pub fn LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u64);
1107 pub fn LLVMRustAddByValCallSiteAttr(Instr
: &Value
, index
: c_uint
, ty
: &Type
);
1109 // Operations on load/store instructions (only)
1110 pub fn LLVMSetVolatile(MemoryAccessInst
: &Value
, volatile
: Bool
);
1112 // Operations on phi nodes
1113 pub fn LLVMAddIncoming(
1115 IncomingValues
: *const &'a Value
,
1116 IncomingBlocks
: *const &'a BasicBlock
,
1120 // Instruction builders
1121 pub fn LLVMCreateBuilderInContext(C
: &'a Context
) -> &'a
mut Builder
<'a
>;
1122 pub fn LLVMPositionBuilderAtEnd(Builder
: &Builder
<'a
>, Block
: &'a BasicBlock
);
1123 pub fn LLVMGetInsertBlock(Builder
: &Builder
<'a
>) -> &'a BasicBlock
;
1124 pub fn LLVMDisposeBuilder(Builder
: &'a
mut Builder
<'a
>);
1127 pub fn LLVMSetCurrentDebugLocation(Builder
: &Builder
<'a
>, L
: &'a Value
);
1130 pub fn LLVMBuildRetVoid(B
: &Builder
<'a
>) -> &'a Value
;
1131 pub fn LLVMBuildRet(B
: &Builder
<'a
>, V
: &'a Value
) -> &'a Value
;
1132 pub fn LLVMBuildBr(B
: &Builder
<'a
>, Dest
: &'a BasicBlock
) -> &'a Value
;
1133 pub fn LLVMBuildCondBr(
1136 Then
: &'a BasicBlock
,
1137 Else
: &'a BasicBlock
,
1139 pub fn LLVMBuildSwitch(
1142 Else
: &'a BasicBlock
,
1145 pub fn LLVMRustBuildInvoke(
1148 Args
: *const &'a Value
,
1150 Then
: &'a BasicBlock
,
1151 Catch
: &'a BasicBlock
,
1152 Bundle
: Option
<&OperandBundleDef
<'a
>>,
1153 Name
: *const c_char
,
1155 pub fn LLVMBuildLandingPad(
1160 Name
: *const c_char
,
1162 pub fn LLVMBuildResume(B
: &Builder
<'a
>, Exn
: &'a Value
) -> &'a Value
;
1163 pub fn LLVMBuildUnreachable(B
: &Builder
<'a
>) -> &'a Value
;
1165 pub fn LLVMRustBuildCleanupPad(
1167 ParentPad
: Option
<&'a Value
>,
1169 Args
: *const &'a Value
,
1170 Name
: *const c_char
,
1171 ) -> Option
<&'a Value
>;
1172 pub fn LLVMRustBuildCleanupRet(
1174 CleanupPad
: &'a Value
,
1175 UnwindBB
: Option
<&'a BasicBlock
>,
1176 ) -> Option
<&'a Value
>;
1177 pub fn LLVMRustBuildCatchPad(
1179 ParentPad
: &'a Value
,
1181 Args
: *const &'a Value
,
1182 Name
: *const c_char
,
1183 ) -> Option
<&'a Value
>;
1184 pub fn LLVMRustBuildCatchRet(
1188 ) -> Option
<&'a Value
>;
1189 pub fn LLVMRustBuildCatchSwitch(
1190 Builder
: &Builder
<'a
>,
1191 ParentPad
: Option
<&'a Value
>,
1192 BB
: Option
<&'a BasicBlock
>,
1193 NumHandlers
: c_uint
,
1194 Name
: *const c_char
,
1195 ) -> Option
<&'a Value
>;
1196 pub fn LLVMRustAddHandler(CatchSwitch
: &'a Value
, Handler
: &'a BasicBlock
);
1197 pub fn LLVMSetPersonalityFn(Func
: &'a Value
, Pers
: &'a Value
);
1199 // Add a case to the switch instruction
1200 pub fn LLVMAddCase(Switch
: &'a Value
, OnVal
: &'a Value
, Dest
: &'a BasicBlock
);
1202 // Add a clause to the landing pad instruction
1203 pub fn LLVMAddClause(LandingPad
: &'a Value
, ClauseVal
: &'a Value
);
1205 // Set the cleanup on a landing pad instruction
1206 pub fn LLVMSetCleanup(LandingPad
: &Value
, Val
: Bool
);
1209 pub fn LLVMBuildAdd(
1213 Name
: *const c_char
,
1215 pub fn LLVMBuildFAdd(
1219 Name
: *const c_char
,
1221 pub fn LLVMBuildSub(
1225 Name
: *const c_char
,
1227 pub fn LLVMBuildFSub(
1231 Name
: *const c_char
,
1233 pub fn LLVMBuildMul(
1237 Name
: *const c_char
,
1239 pub fn LLVMBuildFMul(
1243 Name
: *const c_char
,
1245 pub fn LLVMBuildUDiv(
1249 Name
: *const c_char
,
1251 pub fn LLVMBuildExactUDiv(
1255 Name
: *const c_char
,
1257 pub fn LLVMBuildSDiv(
1261 Name
: *const c_char
,
1263 pub fn LLVMBuildExactSDiv(
1267 Name
: *const c_char
,
1269 pub fn LLVMBuildFDiv(
1273 Name
: *const c_char
,
1275 pub fn LLVMBuildURem(
1279 Name
: *const c_char
,
1281 pub fn LLVMBuildSRem(
1285 Name
: *const c_char
,
1287 pub fn LLVMBuildFRem(
1291 Name
: *const c_char
,
1293 pub fn LLVMBuildShl(
1297 Name
: *const c_char
,
1299 pub fn LLVMBuildLShr(
1303 Name
: *const c_char
,
1305 pub fn LLVMBuildAShr(
1309 Name
: *const c_char
,
1311 pub fn LLVMBuildNSWAdd(
1315 Name
: *const c_char
,
1317 pub fn LLVMBuildNUWAdd(
1321 Name
: *const c_char
,
1323 pub fn LLVMBuildNSWSub(
1327 Name
: *const c_char
,
1329 pub fn LLVMBuildNUWSub(
1333 Name
: *const c_char
,
1335 pub fn LLVMBuildNSWMul(
1339 Name
: *const c_char
,
1341 pub fn LLVMBuildNUWMul(
1345 Name
: *const c_char
,
1347 pub fn LLVMBuildAnd(
1351 Name
: *const c_char
,
1357 Name
: *const c_char
,
1359 pub fn LLVMBuildXor(
1363 Name
: *const c_char
,
1365 pub fn LLVMBuildNeg(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1366 pub fn LLVMBuildFNeg(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1367 pub fn LLVMBuildNot(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1368 pub fn LLVMRustSetHasUnsafeAlgebra(Instr
: &Value
);
1371 pub fn LLVMBuildAlloca(B
: &Builder
<'a
>, Ty
: &'a Type
, Name
: *const c_char
) -> &'a Value
;
1372 pub fn LLVMBuildArrayAlloca(
1376 Name
: *const c_char
,
1378 pub fn LLVMBuildLoad(B
: &Builder
<'a
>, PointerVal
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1380 pub fn LLVMBuildStore(B
: &Builder
<'a
>, Val
: &'a Value
, Ptr
: &'a Value
) -> &'a Value
;
1382 pub fn LLVMBuildGEP(
1385 Indices
: *const &'a Value
,
1387 Name
: *const c_char
,
1389 pub fn LLVMBuildInBoundsGEP(
1392 Indices
: *const &'a Value
,
1394 Name
: *const c_char
,
1396 pub fn LLVMBuildStructGEP(
1400 Name
: *const c_char
,
1404 pub fn LLVMBuildTrunc(
1408 Name
: *const c_char
,
1410 pub fn LLVMBuildZExt(
1414 Name
: *const c_char
,
1416 pub fn LLVMBuildSExt(
1420 Name
: *const c_char
,
1422 pub fn LLVMBuildFPToUI(
1426 Name
: *const c_char
,
1428 pub fn LLVMBuildFPToSI(
1432 Name
: *const c_char
,
1434 pub fn LLVMBuildUIToFP(
1438 Name
: *const c_char
,
1440 pub fn LLVMBuildSIToFP(
1444 Name
: *const c_char
,
1446 pub fn LLVMBuildFPTrunc(
1450 Name
: *const c_char
,
1452 pub fn LLVMBuildFPExt(
1456 Name
: *const c_char
,
1458 pub fn LLVMBuildPtrToInt(
1462 Name
: *const c_char
,
1464 pub fn LLVMBuildIntToPtr(
1468 Name
: *const c_char
,
1470 pub fn LLVMBuildBitCast(
1474 Name
: *const c_char
,
1476 pub fn LLVMBuildPointerCast(
1480 Name
: *const c_char
,
1482 pub fn LLVMRustBuildIntCast(
1490 pub fn LLVMBuildICmp(
1495 Name
: *const c_char
,
1497 pub fn LLVMBuildFCmp(
1502 Name
: *const c_char
,
1505 // Miscellaneous instructions
1506 pub fn LLVMBuildPhi(B
: &Builder
<'a
>, Ty
: &'a Type
, Name
: *const c_char
) -> &'a Value
;
1507 pub fn LLVMRustGetInstrProfIncrementIntrinsic(M
: &Module
) -> &'a Value
;
1508 pub fn LLVMRustBuildCall(
1511 Args
: *const &'a Value
,
1513 Bundle
: Option
<&OperandBundleDef
<'a
>>,
1515 pub fn LLVMRustBuildMemCpy(
1524 pub fn LLVMRustBuildMemMove(
1533 pub fn LLVMRustBuildMemSet(
1541 pub fn LLVMBuildSelect(
1546 Name
: *const c_char
,
1548 pub fn LLVMBuildVAArg(
1552 Name
: *const c_char
,
1554 pub fn LLVMBuildExtractElement(
1558 Name
: *const c_char
,
1560 pub fn LLVMBuildInsertElement(
1565 Name
: *const c_char
,
1567 pub fn LLVMBuildShuffleVector(
1572 Name
: *const c_char
,
1574 pub fn LLVMBuildExtractValue(
1578 Name
: *const c_char
,
1580 pub fn LLVMBuildInsertValue(
1585 Name
: *const c_char
,
1588 pub fn LLVMRustBuildVectorReduceFAdd(
1593 pub fn LLVMRustBuildVectorReduceFMul(
1598 pub fn LLVMRustBuildVectorReduceAdd(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1599 pub fn LLVMRustBuildVectorReduceMul(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1600 pub fn LLVMRustBuildVectorReduceAnd(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1601 pub fn LLVMRustBuildVectorReduceOr(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1602 pub fn LLVMRustBuildVectorReduceXor(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1603 pub fn LLVMRustBuildVectorReduceMin(
1608 pub fn LLVMRustBuildVectorReduceMax(
1613 pub fn LLVMRustBuildVectorReduceFMin(B
: &Builder
<'a
>, Src
: &'a Value
, IsNaN
: bool
)
1615 pub fn LLVMRustBuildVectorReduceFMax(B
: &Builder
<'a
>, Src
: &'a Value
, IsNaN
: bool
)
1618 pub fn LLVMRustBuildMinNum(B
: &Builder
<'a
>, LHS
: &'a Value
, LHS
: &'a Value
) -> &'a Value
;
1619 pub fn LLVMRustBuildMaxNum(B
: &Builder
<'a
>, LHS
: &'a Value
, LHS
: &'a Value
) -> &'a Value
;
1621 // Atomic Operations
1622 pub fn LLVMRustBuildAtomicLoad(
1624 PointerVal
: &'a Value
,
1625 Name
: *const c_char
,
1626 Order
: AtomicOrdering
,
1629 pub fn LLVMRustBuildAtomicStore(
1633 Order
: AtomicOrdering
,
1636 pub fn LLVMRustBuildAtomicCmpXchg(
1641 Order
: AtomicOrdering
,
1642 FailureOrder
: AtomicOrdering
,
1646 pub fn LLVMBuildAtomicRMW(
1651 Order
: AtomicOrdering
,
1652 SingleThreaded
: Bool
,
1655 pub fn LLVMRustBuildAtomicFence(
1657 Order
: AtomicOrdering
,
1658 Scope
: SynchronizationScope
,
1661 /// Writes a module to the specified path. Returns 0 on success.
1662 pub fn LLVMWriteBitcodeToFile(M
: &Module
, Path
: *const c_char
) -> c_int
;
1664 /// Creates a pass manager.
1665 pub fn LLVMCreatePassManager() -> &'a
mut PassManager
<'a
>;
1667 /// Creates a function-by-function pass manager
1668 pub fn LLVMCreateFunctionPassManagerForModule(M
: &'a Module
) -> &'a
mut PassManager
<'a
>;
1670 /// Disposes a pass manager.
1671 pub fn LLVMDisposePassManager(PM
: &'a
mut PassManager
<'a
>);
1673 /// Runs a pass manager on a module.
1674 pub fn LLVMRunPassManager(PM
: &PassManager
<'a
>, M
: &'a Module
) -> Bool
;
1676 pub fn LLVMInitializePasses();
1678 pub fn LLVMTimeTraceProfilerInitialize();
1680 pub fn LLVMTimeTraceProfilerFinish(FileName
: *const c_char
);
1682 pub fn LLVMAddAnalysisPasses(T
: &'a TargetMachine
, PM
: &PassManager
<'a
>);
1684 pub fn LLVMPassManagerBuilderCreate() -> &'
static mut PassManagerBuilder
;
1685 pub fn LLVMPassManagerBuilderDispose(PMB
: &'
static mut PassManagerBuilder
);
1686 pub fn LLVMPassManagerBuilderSetSizeLevel(PMB
: &PassManagerBuilder
, Value
: Bool
);
1687 pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(PMB
: &PassManagerBuilder
, Value
: Bool
);
1688 pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
1689 PMB
: &PassManagerBuilder
,
1692 pub fn LLVMPassManagerBuilderPopulateModulePassManager(
1693 PMB
: &PassManagerBuilder
,
1694 PM
: &PassManager
<'_
>,
1697 pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
1698 PMB
: &PassManagerBuilder
,
1699 PM
: &PassManager
<'_
>,
1701 pub fn LLVMPassManagerBuilderPopulateLTOPassManager(
1702 PMB
: &PassManagerBuilder
,
1703 PM
: &PassManager
<'_
>,
1707 pub fn LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
1708 PMB
: &PassManagerBuilder
,
1709 PM
: &PassManager
<'_
>,
1712 pub fn LLVMGetHostCPUFeatures() -> *mut c_char
;
1714 pub fn LLVMDisposeMessage(message
: *mut c_char
);
1716 // Stuff that's in llvm-wrapper/ because it's not upstream yet.
1718 /// Opens an object file.
1719 pub fn LLVMCreateObjectFile(
1720 MemBuf
: &'
static mut MemoryBuffer
,
1721 ) -> Option
<&'
static mut ObjectFile
>;
1722 /// Closes an object file.
1723 pub fn LLVMDisposeObjectFile(ObjFile
: &'
static mut ObjectFile
);
1725 /// Enumerates the sections in an object file.
1726 pub fn LLVMGetSections(ObjFile
: &'a ObjectFile
) -> &'a
mut SectionIterator
<'a
>;
1727 /// Destroys a section iterator.
1728 pub fn LLVMDisposeSectionIterator(SI
: &'a
mut SectionIterator
<'a
>);
1729 /// Returns `true` if the section iterator is at the end of the section
1731 pub fn LLVMIsSectionIteratorAtEnd(ObjFile
: &'a ObjectFile
, SI
: &SectionIterator
<'a
>) -> Bool
;
1732 /// Moves the section iterator to point to the next section.
1733 pub fn LLVMMoveToNextSection(SI
: &SectionIterator
<'_
>);
1734 /// Returns the current section size.
1735 pub fn LLVMGetSectionSize(SI
: &SectionIterator
<'_
>) -> c_ulonglong
;
1736 /// Returns the current section contents as a string buffer.
1737 pub fn LLVMGetSectionContents(SI
: &SectionIterator
<'_
>) -> *const c_char
;
1739 /// Reads the given file and returns it as a memory buffer. Use
1740 /// LLVMDisposeMemoryBuffer() to get rid of it.
1741 pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(
1742 Path
: *const c_char
,
1743 ) -> Option
<&'
static mut MemoryBuffer
>;
1745 pub fn LLVMStartMultithreaded() -> Bool
;
1747 /// Returns a string describing the last error caused by an LLVMRust* call.
1748 pub fn LLVMRustGetLastError() -> *const c_char
;
1750 /// Print the pass timings since static dtors aren't picking them up.
1751 pub fn LLVMRustPrintPassTimings();
1753 pub fn LLVMStructCreateNamed(C
: &Context
, Name
: *const c_char
) -> &Type
;
1755 pub fn LLVMStructSetBody(
1757 ElementTypes
: *const &'a Type
,
1758 ElementCount
: c_uint
,
1762 /// Prepares inline assembly.
1763 pub fn LLVMRustInlineAsm(
1765 AsmString
: *const c_char
,
1766 AsmStringLen
: size_t
,
1767 Constraints
: *const c_char
,
1768 ConstraintsLen
: size_t
,
1771 Dialect
: AsmDialect
,
1773 pub fn LLVMRustInlineAsmVerify(
1775 Constraints
: *const c_char
,
1776 ConstraintsLen
: size_t
,
1779 #[allow(improper_ctypes)]
1780 pub fn LLVMRustCoverageWriteFilenamesSectionToBuffer(
1781 Filenames
: *const *const c_char
,
1782 FilenamesLen
: size_t
,
1783 BufferOut
: &RustString
,
1786 #[allow(improper_ctypes)]
1787 pub fn LLVMRustCoverageWriteMappingToBuffer(
1788 VirtualFileMappingIDs
: *const c_uint
,
1789 NumVirtualFileMappingIDs
: c_uint
,
1790 Expressions
: *const coverage_map
::CounterExpression
,
1791 NumExpressions
: c_uint
,
1792 MappingRegions
: *mut coverageinfo
::CounterMappingRegion
,
1793 NumMappingRegions
: c_uint
,
1794 BufferOut
: &RustString
,
1797 pub fn LLVMRustCoverageCreatePGOFuncNameVar(F
: &'a Value
, FuncName
: *const c_char
)
1799 pub fn LLVMRustCoverageHashCString(StrVal
: *const c_char
) -> u64;
1800 pub fn LLVMRustCoverageHashByteArray(Bytes
: *const c_char
, NumBytes
: size_t
) -> u64;
1802 #[allow(improper_ctypes)]
1803 pub fn LLVMRustCoverageWriteMapSectionNameToString(M
: &Module
, Str
: &RustString
);
1805 #[allow(improper_ctypes)]
1806 pub fn LLVMRustCoverageWriteFuncSectionNameToString(M
: &Module
, Str
: &RustString
);
1808 #[allow(improper_ctypes)]
1809 pub fn LLVMRustCoverageWriteMappingVarNameToString(Str
: &RustString
);
1811 pub fn LLVMRustCoverageMappingVersion() -> u32;
1812 pub fn LLVMRustDebugMetadataVersion() -> u32;
1813 pub fn LLVMRustVersionMajor() -> u32;
1814 pub fn LLVMRustVersionMinor() -> u32;
1815 pub fn LLVMRustVersionPatch() -> u32;
1817 pub fn LLVMRustAddModuleFlag(M
: &Module
, name
: *const c_char
, value
: u32);
1819 pub fn LLVMRustMetadataAsValue(C
: &'a Context
, MD
: &'a Metadata
) -> &'a Value
;
1821 pub fn LLVMRustDIBuilderCreate(M
: &'a Module
) -> &'a
mut DIBuilder
<'a
>;
1823 pub fn LLVMRustDIBuilderDispose(Builder
: &'a
mut DIBuilder
<'a
>);
1825 pub fn LLVMRustDIBuilderFinalize(Builder
: &DIBuilder
<'_
>);
1827 pub fn LLVMRustDIBuilderCreateCompileUnit(
1828 Builder
: &DIBuilder
<'a
>,
1831 Producer
: *const c_char
,
1832 ProducerLen
: size_t
,
1834 Flags
: *const c_char
,
1836 SplitName
: *const c_char
,
1837 SplitNameLen
: size_t
,
1838 kind
: DebugEmissionKind
,
1840 SplitDebugInlining
: bool
,
1841 ) -> &'a DIDescriptor
;
1843 pub fn LLVMRustDIBuilderCreateFile(
1844 Builder
: &DIBuilder
<'a
>,
1845 Filename
: *const c_char
,
1846 FilenameLen
: size_t
,
1847 Directory
: *const c_char
,
1848 DirectoryLen
: size_t
,
1849 CSKind
: ChecksumKind
,
1850 Checksum
: *const c_char
,
1851 ChecksumLen
: size_t
,
1854 pub fn LLVMRustDIBuilderCreateSubroutineType(
1855 Builder
: &DIBuilder
<'a
>,
1856 ParameterTypes
: &'a DIArray
,
1857 ) -> &'a DICompositeType
;
1859 pub fn LLVMRustDIBuilderCreateFunction(
1860 Builder
: &DIBuilder
<'a
>,
1861 Scope
: &'a DIDescriptor
,
1862 Name
: *const c_char
,
1864 LinkageName
: *const c_char
,
1865 LinkageNameLen
: size_t
,
1872 MaybeFn
: Option
<&'a Value
>,
1873 TParam
: &'a DIArray
,
1874 Decl
: Option
<&'a DIDescriptor
>,
1875 ) -> &'a DISubprogram
;
1877 pub fn LLVMRustDIBuilderCreateBasicType(
1878 Builder
: &DIBuilder
<'a
>,
1879 Name
: *const c_char
,
1883 ) -> &'a DIBasicType
;
1885 pub fn LLVMRustDIBuilderCreateTypedef(
1886 Builder
: &DIBuilder
<'a
>,
1887 Type
: &'a DIBasicType
,
1888 Name
: *const c_char
,
1892 Scope
: Option
<&'a DIScope
>,
1893 ) -> &'a DIDerivedType
;
1895 pub fn LLVMRustDIBuilderCreatePointerType(
1896 Builder
: &DIBuilder
<'a
>,
1897 PointeeTy
: &'a DIType
,
1900 AddressSpace
: c_uint
,
1901 Name
: *const c_char
,
1903 ) -> &'a DIDerivedType
;
1905 pub fn LLVMRustDIBuilderCreateStructType(
1906 Builder
: &DIBuilder
<'a
>,
1907 Scope
: Option
<&'a DIDescriptor
>,
1908 Name
: *const c_char
,
1915 DerivedFrom
: Option
<&'a DIType
>,
1916 Elements
: &'a DIArray
,
1917 RunTimeLang
: c_uint
,
1918 VTableHolder
: Option
<&'a DIType
>,
1919 UniqueId
: *const c_char
,
1920 UniqueIdLen
: size_t
,
1921 ) -> &'a DICompositeType
;
1923 pub fn LLVMRustDIBuilderCreateMemberType(
1924 Builder
: &DIBuilder
<'a
>,
1925 Scope
: &'a DIDescriptor
,
1926 Name
: *const c_char
,
1935 ) -> &'a DIDerivedType
;
1937 pub fn LLVMRustDIBuilderCreateVariantMemberType(
1938 Builder
: &DIBuilder
<'a
>,
1940 Name
: *const c_char
,
1947 Discriminant
: Option
<&'a Value
>,
1952 pub fn LLVMRustDIBuilderCreateLexicalBlock(
1953 Builder
: &DIBuilder
<'a
>,
1958 ) -> &'a DILexicalBlock
;
1960 pub fn LLVMRustDIBuilderCreateLexicalBlockFile(
1961 Builder
: &DIBuilder
<'a
>,
1964 ) -> &'a DILexicalBlock
;
1966 pub fn LLVMRustDIBuilderCreateStaticVariable(
1967 Builder
: &DIBuilder
<'a
>,
1968 Context
: Option
<&'a DIScope
>,
1969 Name
: *const c_char
,
1971 LinkageName
: *const c_char
,
1972 LinkageNameLen
: size_t
,
1976 isLocalToUnit
: bool
,
1978 Decl
: Option
<&'a DIDescriptor
>,
1980 ) -> &'a DIGlobalVariableExpression
;
1982 pub fn LLVMRustDIBuilderCreateVariable(
1983 Builder
: &DIBuilder
<'a
>,
1985 Scope
: &'a DIDescriptor
,
1986 Name
: *const c_char
,
1991 AlwaysPreserve
: bool
,
1995 ) -> &'a DIVariable
;
1997 pub fn LLVMRustDIBuilderCreateArrayType(
1998 Builder
: &DIBuilder
<'a
>,
2002 Subscripts
: &'a DIArray
,
2005 pub fn LLVMRustDIBuilderGetOrCreateSubrange(
2006 Builder
: &DIBuilder
<'a
>,
2009 ) -> &'a DISubrange
;
2011 pub fn LLVMRustDIBuilderGetOrCreateArray(
2012 Builder
: &DIBuilder
<'a
>,
2013 Ptr
: *const Option
<&'a DIDescriptor
>,
2017 pub fn LLVMRustDIBuilderInsertDeclareAtEnd(
2018 Builder
: &DIBuilder
<'a
>,
2020 VarInfo
: &'a DIVariable
,
2021 AddrOps
: *const i64,
2022 AddrOpsCount
: c_uint
,
2024 InsertAtEnd
: &'a BasicBlock
,
2027 pub fn LLVMRustDIBuilderCreateEnumerator(
2028 Builder
: &DIBuilder
<'a
>,
2029 Name
: *const c_char
,
2033 ) -> &'a DIEnumerator
;
2035 pub fn LLVMRustDIBuilderCreateEnumerationType(
2036 Builder
: &DIBuilder
<'a
>,
2038 Name
: *const c_char
,
2044 Elements
: &'a DIArray
,
2045 ClassType
: &'a DIType
,
2049 pub fn LLVMRustDIBuilderCreateUnionType(
2050 Builder
: &DIBuilder
<'a
>,
2052 Name
: *const c_char
,
2059 Elements
: Option
<&'a DIArray
>,
2060 RunTimeLang
: c_uint
,
2061 UniqueId
: *const c_char
,
2062 UniqueIdLen
: size_t
,
2065 pub fn LLVMRustDIBuilderCreateVariantPart(
2066 Builder
: &DIBuilder
<'a
>,
2068 Name
: *const c_char
,
2075 Discriminator
: Option
<&'a DIDerivedType
>,
2076 Elements
: &'a DIArray
,
2077 UniqueId
: *const c_char
,
2078 UniqueIdLen
: size_t
,
2079 ) -> &'a DIDerivedType
;
2081 pub fn LLVMSetUnnamedAddress(Global
: &Value
, UnnamedAddr
: UnnamedAddr
);
2083 pub fn LLVMRustDIBuilderCreateTemplateTypeParameter(
2084 Builder
: &DIBuilder
<'a
>,
2085 Scope
: Option
<&'a DIScope
>,
2086 Name
: *const c_char
,
2089 ) -> &'a DITemplateTypeParameter
;
2091 pub fn LLVMRustDIBuilderCreateNameSpace(
2092 Builder
: &DIBuilder
<'a
>,
2093 Scope
: Option
<&'a DIScope
>,
2094 Name
: *const c_char
,
2096 ExportSymbols
: bool
,
2097 ) -> &'a DINameSpace
;
2099 pub fn LLVMRustDICompositeTypeReplaceArrays(
2100 Builder
: &DIBuilder
<'a
>,
2101 CompositeType
: &'a DIType
,
2102 Elements
: Option
<&'a DIArray
>,
2103 Params
: Option
<&'a DIArray
>,
2106 pub fn LLVMRustDIBuilderCreateDebugLocation(
2110 InlinedAt
: Option
<&'a DILocation
>,
2111 ) -> &'a DILocation
;
2112 pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
2113 pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64;
2115 #[allow(improper_ctypes)]
2116 pub fn LLVMRustWriteTypeToString(Type
: &Type
, s
: &RustString
);
2117 #[allow(improper_ctypes)]
2118 pub fn LLVMRustWriteValueToString(value_ref
: &Value
, s
: &RustString
);
2120 pub fn LLVMIsAConstantInt(value_ref
: &Value
) -> Option
<&ConstantInt
>;
2122 pub fn LLVMRustPassKind(Pass
: &Pass
) -> PassKind
;
2123 pub fn LLVMRustFindAndCreatePass(Pass
: *const c_char
) -> Option
<&'
static mut Pass
>;
2124 pub fn LLVMRustCreateAddressSanitizerFunctionPass(Recover
: bool
) -> &'
static mut Pass
;
2125 pub fn LLVMRustCreateModuleAddressSanitizerPass(Recover
: bool
) -> &'
static mut Pass
;
2126 pub fn LLVMRustCreateMemorySanitizerPass(
2127 TrackOrigins
: c_int
,
2129 ) -> &'
static mut Pass
;
2130 pub fn LLVMRustCreateThreadSanitizerPass() -> &'
static mut Pass
;
2131 pub fn LLVMRustAddPass(PM
: &PassManager
<'_
>, Pass
: &'
static mut Pass
);
2132 pub fn LLVMRustAddLastExtensionPasses(
2133 PMB
: &PassManagerBuilder
,
2134 Passes
: *const &'
static mut Pass
,
2138 pub fn LLVMRustHasFeature(T
: &TargetMachine
, s
: *const c_char
) -> bool
;
2140 pub fn LLVMRustPrintTargetCPUs(T
: &TargetMachine
);
2141 pub fn LLVMRustPrintTargetFeatures(T
: &TargetMachine
);
2143 pub fn LLVMRustGetHostCPUName(len
: *mut usize) -> *const c_char
;
2144 pub fn LLVMRustCreateTargetMachine(
2145 Triple
: *const c_char
,
2147 Features
: *const c_char
,
2151 Level
: CodeGenOptLevel
,
2153 FunctionSections
: bool
,
2155 TrapUnreachable
: bool
,
2158 EmitStackSizeSection
: bool
,
2159 RelaxELFRelocations
: bool
,
2161 SplitDwarfFile
: *const c_char
,
2162 ) -> Option
<&'
static mut TargetMachine
>;
2163 pub fn LLVMRustDisposeTargetMachine(T
: &'
static mut TargetMachine
);
2164 pub fn LLVMRustAddBuilderLibraryInfo(
2165 PMB
: &'a PassManagerBuilder
,
2167 DisableSimplifyLibCalls
: bool
,
2169 pub fn LLVMRustConfigurePassManagerBuilder(
2170 PMB
: &PassManagerBuilder
,
2171 OptLevel
: CodeGenOptLevel
,
2172 MergeFunctions
: bool
,
2174 LoopVectorize
: bool
,
2175 PrepareForThinLTO
: bool
,
2176 PGOGenPath
: *const c_char
,
2177 PGOUsePath
: *const c_char
,
2179 pub fn LLVMRustAddLibraryInfo(
2180 PM
: &PassManager
<'a
>,
2182 DisableSimplifyLibCalls
: bool
,
2184 pub fn LLVMRustRunFunctionPassManager(PM
: &PassManager
<'a
>, M
: &'a Module
);
2185 pub fn LLVMRustWriteOutputFile(
2186 T
: &'a TargetMachine
,
2187 PM
: &PassManager
<'a
>,
2189 Output
: *const c_char
,
2190 DwoOutput
: *const c_char
,
2192 ) -> LLVMRustResult
;
2193 pub fn LLVMRustOptimizeWithNewPassManager(
2195 TM
: &'a TargetMachine
,
2196 OptLevel
: PassBuilderOptLevel
,
2198 NoPrepopulatePasses
: bool
,
2200 UseThinLTOBuffers
: bool
,
2201 MergeFunctions
: bool
,
2204 LoopVectorize
: bool
,
2205 DisableSimplifyLibCalls
: bool
,
2206 EmitLifetimeMarkers
: bool
,
2207 SanitizerOptions
: Option
<&SanitizerOptions
>,
2208 PGOGenPath
: *const c_char
,
2209 PGOUsePath
: *const c_char
,
2210 llvm_selfprofiler
: *mut c_void
,
2211 begin_callback
: SelfProfileBeforePassCallback
,
2212 end_callback
: SelfProfileAfterPassCallback
,
2214 pub fn LLVMRustPrintModule(
2216 Output
: *const c_char
,
2217 Demangle
: extern "C" fn(*const c_char
, size_t
, *mut c_char
, size_t
) -> size_t
,
2218 ) -> LLVMRustResult
;
2219 pub fn LLVMRustSetLLVMOptions(Argc
: c_int
, Argv
: *const *const c_char
);
2220 pub fn LLVMRustPrintPasses();
2221 pub fn LLVMRustGetInstructionCount(M
: &Module
) -> u32;
2222 pub fn LLVMRustSetNormalizedTarget(M
: &Module
, triple
: *const c_char
);
2223 pub fn LLVMRustAddAlwaysInlinePass(P
: &PassManagerBuilder
, AddLifetimes
: bool
);
2224 pub fn LLVMRustRunRestrictionPass(M
: &Module
, syms
: *const *const c_char
, len
: size_t
);
2225 pub fn LLVMRustMarkAllFunctionsNounwind(M
: &Module
);
2227 pub fn LLVMRustOpenArchive(path
: *const c_char
) -> Option
<&'
static mut Archive
>;
2228 pub fn LLVMRustArchiveIteratorNew(AR
: &'a Archive
) -> &'a
mut ArchiveIterator
<'a
>;
2229 pub fn LLVMRustArchiveIteratorNext(
2230 AIR
: &ArchiveIterator
<'a
>,
2231 ) -> Option
<&'a
mut ArchiveChild
<'a
>>;
2232 pub fn LLVMRustArchiveChildName(ACR
: &ArchiveChild
<'_
>, size
: &mut size_t
) -> *const c_char
;
2233 pub fn LLVMRustArchiveChildData(ACR
: &ArchiveChild
<'_
>, size
: &mut size_t
) -> *const c_char
;
2234 pub fn LLVMRustArchiveChildFree(ACR
: &'a
mut ArchiveChild
<'a
>);
2235 pub fn LLVMRustArchiveIteratorFree(AIR
: &'a
mut ArchiveIterator
<'a
>);
2236 pub fn LLVMRustDestroyArchive(AR
: &'
static mut Archive
);
2238 #[allow(improper_ctypes)]
2239 pub fn LLVMRustGetSectionName(
2240 SI
: &SectionIterator
<'_
>,
2241 data
: &mut Option
<std
::ptr
::NonNull
<c_char
>>,
2244 #[allow(improper_ctypes)]
2245 pub fn LLVMRustWriteTwineToString(T
: &Twine
, s
: &RustString
);
2247 pub fn LLVMContextSetDiagnosticHandler(
2249 Handler
: DiagnosticHandler
,
2250 DiagnosticContext
: *mut c_void
,
2253 #[allow(improper_ctypes)]
2254 pub fn LLVMRustUnpackOptimizationDiagnostic(
2255 DI
: &'a DiagnosticInfo
,
2256 pass_name_out
: &RustString
,
2257 function_out
: &mut Option
<&'a Value
>,
2258 loc_line_out
: &mut c_uint
,
2259 loc_column_out
: &mut c_uint
,
2260 loc_filename_out
: &RustString
,
2261 message_out
: &RustString
,
2264 pub fn LLVMRustUnpackInlineAsmDiagnostic(
2265 DI
: &'a DiagnosticInfo
,
2266 level_out
: &mut DiagnosticLevel
,
2267 cookie_out
: &mut c_uint
,
2268 message_out
: &mut Option
<&'a Twine
>,
2269 instruction_out
: &mut Option
<&'a Value
>,
2272 #[allow(improper_ctypes)]
2273 pub fn LLVMRustWriteDiagnosticInfoToString(DI
: &DiagnosticInfo
, s
: &RustString
);
2274 pub fn LLVMRustGetDiagInfoKind(DI
: &DiagnosticInfo
) -> DiagnosticKind
;
2276 pub fn LLVMRustSetInlineAsmDiagnosticHandler(
2278 H
: InlineAsmDiagHandler
,
2282 #[allow(improper_ctypes)]
2283 pub fn LLVMRustUnpackSMDiagnostic(
2285 message_out
: &RustString
,
2286 buffer_out
: &RustString
,
2287 level_out
: &mut DiagnosticLevel
,
2288 loc_out
: &mut c_uint
,
2289 ranges_out
: *mut c_uint
,
2290 num_ranges
: &mut usize,
2293 pub fn LLVMRustWriteArchive(
2296 Members
: *const &RustArchiveMember
<'_
>,
2299 ) -> LLVMRustResult
;
2300 pub fn LLVMRustArchiveMemberNew(
2301 Filename
: *const c_char
,
2302 Name
: *const c_char
,
2303 Child
: Option
<&ArchiveChild
<'a
>>,
2304 ) -> &'a
mut RustArchiveMember
<'a
>;
2305 pub fn LLVMRustArchiveMemberFree(Member
: &'a
mut RustArchiveMember
<'a
>);
2307 pub fn LLVMRustSetDataLayoutFromTargetMachine(M
: &'a Module
, TM
: &'a TargetMachine
);
2309 pub fn LLVMRustBuildOperandBundleDef(
2310 Name
: *const c_char
,
2311 Inputs
: *const &'a Value
,
2313 ) -> &'a
mut OperandBundleDef
<'a
>;
2314 pub fn LLVMRustFreeOperandBundleDef(Bundle
: &'a
mut OperandBundleDef
<'a
>);
2316 pub fn LLVMRustPositionBuilderAtStart(B
: &Builder
<'a
>, BB
: &'a BasicBlock
);
2318 pub fn LLVMRustSetComdat(M
: &'a Module
, V
: &'a Value
, Name
: *const c_char
, NameLen
: size_t
);
2319 pub fn LLVMRustUnsetComdat(V
: &Value
);
2320 pub fn LLVMRustSetModulePICLevel(M
: &Module
);
2321 pub fn LLVMRustSetModulePIELevel(M
: &Module
);
2322 pub fn LLVMRustModuleBufferCreate(M
: &Module
) -> &'
static mut ModuleBuffer
;
2323 pub fn LLVMRustModuleBufferPtr(p
: &ModuleBuffer
) -> *const u8;
2324 pub fn LLVMRustModuleBufferLen(p
: &ModuleBuffer
) -> usize;
2325 pub fn LLVMRustModuleBufferFree(p
: &'
static mut ModuleBuffer
);
2326 pub fn LLVMRustModuleCost(M
: &Module
) -> u64;
2328 pub fn LLVMRustThinLTOBufferCreate(M
: &Module
) -> &'
static mut ThinLTOBuffer
;
2329 pub fn LLVMRustThinLTOBufferFree(M
: &'
static mut ThinLTOBuffer
);
2330 pub fn LLVMRustThinLTOBufferPtr(M
: &ThinLTOBuffer
) -> *const c_char
;
2331 pub fn LLVMRustThinLTOBufferLen(M
: &ThinLTOBuffer
) -> size_t
;
2332 pub fn LLVMRustCreateThinLTOData(
2333 Modules
: *const ThinLTOModule
,
2335 PreservedSymbols
: *const *const c_char
,
2336 PreservedSymbolsLen
: c_uint
,
2337 ) -> Option
<&'
static mut ThinLTOData
>;
2338 pub fn LLVMRustPrepareThinLTORename(
2341 Target
: &TargetMachine
,
2343 pub fn LLVMRustPrepareThinLTOResolveWeak(Data
: &ThinLTOData
, Module
: &Module
) -> bool
;
2344 pub fn LLVMRustPrepareThinLTOInternalize(Data
: &ThinLTOData
, Module
: &Module
) -> bool
;
2345 pub fn LLVMRustPrepareThinLTOImport(
2348 Target
: &TargetMachine
,
2350 pub fn LLVMRustGetThinLTOModuleImports(
2351 Data
: *const ThinLTOData
,
2352 ModuleNameCallback
: ThinLTOModuleNameCallback
,
2353 CallbackPayload
: *mut c_void
,
2355 pub fn LLVMRustFreeThinLTOData(Data
: &'
static mut ThinLTOData
);
2356 pub fn LLVMRustParseBitcodeForLTO(
2360 Identifier
: *const c_char
,
2361 ) -> Option
<&Module
>;
2362 pub fn LLVMRustGetBitcodeSliceFromObjectData(
2365 out_len
: &mut usize,
2367 pub fn LLVMRustThinLTOGetDICompileUnit(
2369 CU1
: &mut *mut c_void
,
2370 CU2
: &mut *mut c_void
,
2372 pub fn LLVMRustThinLTOPatchDICompileUnit(M
: &Module
, CU
: *mut c_void
);
2374 pub fn LLVMRustLinkerNew(M
: &'a Module
) -> &'a
mut Linker
<'a
>;
2375 pub fn LLVMRustLinkerAdd(
2376 linker
: &Linker
<'_
>,
2377 bytecode
: *const c_char
,
2378 bytecode_len
: usize,
2380 pub fn LLVMRustLinkerFree(linker
: &'a
mut Linker
<'a
>);
2381 #[allow(improper_ctypes)]
2382 pub fn LLVMRustComputeLTOCacheKey(
2383 key_out
: &RustString
,
2384 mod_id
: *const c_char
,