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 LLVMRustAddAlignmentCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u32);
1104 pub fn LLVMRustAddDereferenceableCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u64);
1105 pub fn LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr
: &Value
, index
: c_uint
, bytes
: u64);
1106 pub fn LLVMRustAddByValCallSiteAttr(Instr
: &Value
, index
: c_uint
, ty
: &Type
);
1108 // Operations on load/store instructions (only)
1109 pub fn LLVMSetVolatile(MemoryAccessInst
: &Value
, volatile
: Bool
);
1111 // Operations on phi nodes
1112 pub fn LLVMAddIncoming(
1114 IncomingValues
: *const &'a Value
,
1115 IncomingBlocks
: *const &'a BasicBlock
,
1119 // Instruction builders
1120 pub fn LLVMCreateBuilderInContext(C
: &'a Context
) -> &'a
mut Builder
<'a
>;
1121 pub fn LLVMPositionBuilderAtEnd(Builder
: &Builder
<'a
>, Block
: &'a BasicBlock
);
1122 pub fn LLVMGetInsertBlock(Builder
: &Builder
<'a
>) -> &'a BasicBlock
;
1123 pub fn LLVMDisposeBuilder(Builder
: &'a
mut Builder
<'a
>);
1126 pub fn LLVMSetCurrentDebugLocation(Builder
: &Builder
<'a
>, L
: &'a Value
);
1129 pub fn LLVMBuildRetVoid(B
: &Builder
<'a
>) -> &'a Value
;
1130 pub fn LLVMBuildRet(B
: &Builder
<'a
>, V
: &'a Value
) -> &'a Value
;
1131 pub fn LLVMBuildBr(B
: &Builder
<'a
>, Dest
: &'a BasicBlock
) -> &'a Value
;
1132 pub fn LLVMBuildCondBr(
1135 Then
: &'a BasicBlock
,
1136 Else
: &'a BasicBlock
,
1138 pub fn LLVMBuildSwitch(
1141 Else
: &'a BasicBlock
,
1144 pub fn LLVMRustBuildInvoke(
1147 Args
: *const &'a Value
,
1149 Then
: &'a BasicBlock
,
1150 Catch
: &'a BasicBlock
,
1151 Bundle
: Option
<&OperandBundleDef
<'a
>>,
1152 Name
: *const c_char
,
1154 pub fn LLVMBuildLandingPad(
1159 Name
: *const c_char
,
1161 pub fn LLVMBuildResume(B
: &Builder
<'a
>, Exn
: &'a Value
) -> &'a Value
;
1162 pub fn LLVMBuildUnreachable(B
: &Builder
<'a
>) -> &'a Value
;
1164 pub fn LLVMRustBuildCleanupPad(
1166 ParentPad
: Option
<&'a Value
>,
1168 Args
: *const &'a Value
,
1169 Name
: *const c_char
,
1170 ) -> Option
<&'a Value
>;
1171 pub fn LLVMRustBuildCleanupRet(
1173 CleanupPad
: &'a Value
,
1174 UnwindBB
: Option
<&'a BasicBlock
>,
1175 ) -> Option
<&'a Value
>;
1176 pub fn LLVMRustBuildCatchPad(
1178 ParentPad
: &'a Value
,
1180 Args
: *const &'a Value
,
1181 Name
: *const c_char
,
1182 ) -> Option
<&'a Value
>;
1183 pub fn LLVMRustBuildCatchRet(
1187 ) -> Option
<&'a Value
>;
1188 pub fn LLVMRustBuildCatchSwitch(
1189 Builder
: &Builder
<'a
>,
1190 ParentPad
: Option
<&'a Value
>,
1191 BB
: Option
<&'a BasicBlock
>,
1192 NumHandlers
: c_uint
,
1193 Name
: *const c_char
,
1194 ) -> Option
<&'a Value
>;
1195 pub fn LLVMRustAddHandler(CatchSwitch
: &'a Value
, Handler
: &'a BasicBlock
);
1196 pub fn LLVMSetPersonalityFn(Func
: &'a Value
, Pers
: &'a Value
);
1198 // Add a case to the switch instruction
1199 pub fn LLVMAddCase(Switch
: &'a Value
, OnVal
: &'a Value
, Dest
: &'a BasicBlock
);
1201 // Add a clause to the landing pad instruction
1202 pub fn LLVMAddClause(LandingPad
: &'a Value
, ClauseVal
: &'a Value
);
1204 // Set the cleanup on a landing pad instruction
1205 pub fn LLVMSetCleanup(LandingPad
: &Value
, Val
: Bool
);
1208 pub fn LLVMBuildAdd(
1212 Name
: *const c_char
,
1214 pub fn LLVMBuildFAdd(
1218 Name
: *const c_char
,
1220 pub fn LLVMBuildSub(
1224 Name
: *const c_char
,
1226 pub fn LLVMBuildFSub(
1230 Name
: *const c_char
,
1232 pub fn LLVMBuildMul(
1236 Name
: *const c_char
,
1238 pub fn LLVMBuildFMul(
1242 Name
: *const c_char
,
1244 pub fn LLVMBuildUDiv(
1248 Name
: *const c_char
,
1250 pub fn LLVMBuildExactUDiv(
1254 Name
: *const c_char
,
1256 pub fn LLVMBuildSDiv(
1260 Name
: *const c_char
,
1262 pub fn LLVMBuildExactSDiv(
1266 Name
: *const c_char
,
1268 pub fn LLVMBuildFDiv(
1272 Name
: *const c_char
,
1274 pub fn LLVMBuildURem(
1278 Name
: *const c_char
,
1280 pub fn LLVMBuildSRem(
1284 Name
: *const c_char
,
1286 pub fn LLVMBuildFRem(
1290 Name
: *const c_char
,
1292 pub fn LLVMBuildShl(
1296 Name
: *const c_char
,
1298 pub fn LLVMBuildLShr(
1302 Name
: *const c_char
,
1304 pub fn LLVMBuildAShr(
1308 Name
: *const c_char
,
1310 pub fn LLVMBuildNSWAdd(
1314 Name
: *const c_char
,
1316 pub fn LLVMBuildNUWAdd(
1320 Name
: *const c_char
,
1322 pub fn LLVMBuildNSWSub(
1326 Name
: *const c_char
,
1328 pub fn LLVMBuildNUWSub(
1332 Name
: *const c_char
,
1334 pub fn LLVMBuildNSWMul(
1338 Name
: *const c_char
,
1340 pub fn LLVMBuildNUWMul(
1344 Name
: *const c_char
,
1346 pub fn LLVMBuildAnd(
1350 Name
: *const c_char
,
1356 Name
: *const c_char
,
1358 pub fn LLVMBuildXor(
1362 Name
: *const c_char
,
1364 pub fn LLVMBuildNeg(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1365 pub fn LLVMBuildFNeg(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1366 pub fn LLVMBuildNot(B
: &Builder
<'a
>, V
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1367 pub fn LLVMRustSetHasUnsafeAlgebra(Instr
: &Value
);
1370 pub fn LLVMBuildAlloca(B
: &Builder
<'a
>, Ty
: &'a Type
, Name
: *const c_char
) -> &'a Value
;
1371 pub fn LLVMBuildArrayAlloca(
1375 Name
: *const c_char
,
1377 pub fn LLVMBuildLoad(B
: &Builder
<'a
>, PointerVal
: &'a Value
, Name
: *const c_char
) -> &'a Value
;
1379 pub fn LLVMBuildStore(B
: &Builder
<'a
>, Val
: &'a Value
, Ptr
: &'a Value
) -> &'a Value
;
1381 pub fn LLVMBuildGEP(
1384 Indices
: *const &'a Value
,
1386 Name
: *const c_char
,
1388 pub fn LLVMBuildInBoundsGEP(
1391 Indices
: *const &'a Value
,
1393 Name
: *const c_char
,
1395 pub fn LLVMBuildStructGEP(
1399 Name
: *const c_char
,
1403 pub fn LLVMBuildTrunc(
1407 Name
: *const c_char
,
1409 pub fn LLVMBuildZExt(
1413 Name
: *const c_char
,
1415 pub fn LLVMBuildSExt(
1419 Name
: *const c_char
,
1421 pub fn LLVMBuildFPToUI(
1425 Name
: *const c_char
,
1427 pub fn LLVMBuildFPToSI(
1431 Name
: *const c_char
,
1433 pub fn LLVMBuildUIToFP(
1437 Name
: *const c_char
,
1439 pub fn LLVMBuildSIToFP(
1443 Name
: *const c_char
,
1445 pub fn LLVMBuildFPTrunc(
1449 Name
: *const c_char
,
1451 pub fn LLVMBuildFPExt(
1455 Name
: *const c_char
,
1457 pub fn LLVMBuildPtrToInt(
1461 Name
: *const c_char
,
1463 pub fn LLVMBuildIntToPtr(
1467 Name
: *const c_char
,
1469 pub fn LLVMBuildBitCast(
1473 Name
: *const c_char
,
1475 pub fn LLVMBuildPointerCast(
1479 Name
: *const c_char
,
1481 pub fn LLVMRustBuildIntCast(
1489 pub fn LLVMBuildICmp(
1494 Name
: *const c_char
,
1496 pub fn LLVMBuildFCmp(
1501 Name
: *const c_char
,
1504 // Miscellaneous instructions
1505 pub fn LLVMBuildPhi(B
: &Builder
<'a
>, Ty
: &'a Type
, Name
: *const c_char
) -> &'a Value
;
1506 pub fn LLVMRustGetInstrProfIncrementIntrinsic(M
: &Module
) -> &'a Value
;
1507 pub fn LLVMRustBuildCall(
1510 Args
: *const &'a Value
,
1512 Bundle
: Option
<&OperandBundleDef
<'a
>>,
1514 pub fn LLVMRustBuildMemCpy(
1523 pub fn LLVMRustBuildMemMove(
1532 pub fn LLVMRustBuildMemSet(
1540 pub fn LLVMBuildSelect(
1545 Name
: *const c_char
,
1547 pub fn LLVMBuildVAArg(
1551 Name
: *const c_char
,
1553 pub fn LLVMBuildExtractElement(
1557 Name
: *const c_char
,
1559 pub fn LLVMBuildInsertElement(
1564 Name
: *const c_char
,
1566 pub fn LLVMBuildShuffleVector(
1571 Name
: *const c_char
,
1573 pub fn LLVMBuildExtractValue(
1577 Name
: *const c_char
,
1579 pub fn LLVMBuildInsertValue(
1584 Name
: *const c_char
,
1587 pub fn LLVMRustBuildVectorReduceFAdd(
1592 pub fn LLVMRustBuildVectorReduceFMul(
1597 pub fn LLVMRustBuildVectorReduceAdd(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1598 pub fn LLVMRustBuildVectorReduceMul(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1599 pub fn LLVMRustBuildVectorReduceAnd(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1600 pub fn LLVMRustBuildVectorReduceOr(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1601 pub fn LLVMRustBuildVectorReduceXor(B
: &Builder
<'a
>, Src
: &'a Value
) -> &'a Value
;
1602 pub fn LLVMRustBuildVectorReduceMin(
1607 pub fn LLVMRustBuildVectorReduceMax(
1612 pub fn LLVMRustBuildVectorReduceFMin(B
: &Builder
<'a
>, Src
: &'a Value
, IsNaN
: bool
)
1614 pub fn LLVMRustBuildVectorReduceFMax(B
: &Builder
<'a
>, Src
: &'a Value
, IsNaN
: bool
)
1617 pub fn LLVMRustBuildMinNum(B
: &Builder
<'a
>, LHS
: &'a Value
, LHS
: &'a Value
) -> &'a Value
;
1618 pub fn LLVMRustBuildMaxNum(B
: &Builder
<'a
>, LHS
: &'a Value
, LHS
: &'a Value
) -> &'a Value
;
1620 // Atomic Operations
1621 pub fn LLVMRustBuildAtomicLoad(
1623 PointerVal
: &'a Value
,
1624 Name
: *const c_char
,
1625 Order
: AtomicOrdering
,
1628 pub fn LLVMRustBuildAtomicStore(
1632 Order
: AtomicOrdering
,
1635 pub fn LLVMRustBuildAtomicCmpXchg(
1640 Order
: AtomicOrdering
,
1641 FailureOrder
: AtomicOrdering
,
1645 pub fn LLVMBuildAtomicRMW(
1650 Order
: AtomicOrdering
,
1651 SingleThreaded
: Bool
,
1654 pub fn LLVMRustBuildAtomicFence(
1656 Order
: AtomicOrdering
,
1657 Scope
: SynchronizationScope
,
1660 /// Writes a module to the specified path. Returns 0 on success.
1661 pub fn LLVMWriteBitcodeToFile(M
: &Module
, Path
: *const c_char
) -> c_int
;
1663 /// Creates a pass manager.
1664 pub fn LLVMCreatePassManager() -> &'a
mut PassManager
<'a
>;
1666 /// Creates a function-by-function pass manager
1667 pub fn LLVMCreateFunctionPassManagerForModule(M
: &'a Module
) -> &'a
mut PassManager
<'a
>;
1669 /// Disposes a pass manager.
1670 pub fn LLVMDisposePassManager(PM
: &'a
mut PassManager
<'a
>);
1672 /// Runs a pass manager on a module.
1673 pub fn LLVMRunPassManager(PM
: &PassManager
<'a
>, M
: &'a Module
) -> Bool
;
1675 pub fn LLVMInitializePasses();
1677 pub fn LLVMTimeTraceProfilerInitialize();
1679 pub fn LLVMTimeTraceProfilerFinish(FileName
: *const c_char
);
1681 pub fn LLVMAddAnalysisPasses(T
: &'a TargetMachine
, PM
: &PassManager
<'a
>);
1683 pub fn LLVMPassManagerBuilderCreate() -> &'
static mut PassManagerBuilder
;
1684 pub fn LLVMPassManagerBuilderDispose(PMB
: &'
static mut PassManagerBuilder
);
1685 pub fn LLVMPassManagerBuilderSetSizeLevel(PMB
: &PassManagerBuilder
, Value
: Bool
);
1686 pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(PMB
: &PassManagerBuilder
, Value
: Bool
);
1687 pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
1688 PMB
: &PassManagerBuilder
,
1691 pub fn LLVMPassManagerBuilderPopulateModulePassManager(
1692 PMB
: &PassManagerBuilder
,
1693 PM
: &PassManager
<'_
>,
1696 pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
1697 PMB
: &PassManagerBuilder
,
1698 PM
: &PassManager
<'_
>,
1700 pub fn LLVMPassManagerBuilderPopulateLTOPassManager(
1701 PMB
: &PassManagerBuilder
,
1702 PM
: &PassManager
<'_
>,
1706 pub fn LLVMRustPassManagerBuilderPopulateThinLTOPassManager(
1707 PMB
: &PassManagerBuilder
,
1708 PM
: &PassManager
<'_
>,
1711 // Stuff that's in llvm-wrapper/ because it's not upstream yet.
1713 /// Opens an object file.
1714 pub fn LLVMCreateObjectFile(
1715 MemBuf
: &'
static mut MemoryBuffer
,
1716 ) -> Option
<&'
static mut ObjectFile
>;
1717 /// Closes an object file.
1718 pub fn LLVMDisposeObjectFile(ObjFile
: &'
static mut ObjectFile
);
1720 /// Enumerates the sections in an object file.
1721 pub fn LLVMGetSections(ObjFile
: &'a ObjectFile
) -> &'a
mut SectionIterator
<'a
>;
1722 /// Destroys a section iterator.
1723 pub fn LLVMDisposeSectionIterator(SI
: &'a
mut SectionIterator
<'a
>);
1724 /// Returns `true` if the section iterator is at the end of the section
1726 pub fn LLVMIsSectionIteratorAtEnd(ObjFile
: &'a ObjectFile
, SI
: &SectionIterator
<'a
>) -> Bool
;
1727 /// Moves the section iterator to point to the next section.
1728 pub fn LLVMMoveToNextSection(SI
: &SectionIterator
<'_
>);
1729 /// Returns the current section size.
1730 pub fn LLVMGetSectionSize(SI
: &SectionIterator
<'_
>) -> c_ulonglong
;
1731 /// Returns the current section contents as a string buffer.
1732 pub fn LLVMGetSectionContents(SI
: &SectionIterator
<'_
>) -> *const c_char
;
1734 /// Reads the given file and returns it as a memory buffer. Use
1735 /// LLVMDisposeMemoryBuffer() to get rid of it.
1736 pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(
1737 Path
: *const c_char
,
1738 ) -> Option
<&'
static mut MemoryBuffer
>;
1740 pub fn LLVMStartMultithreaded() -> Bool
;
1742 /// Returns a string describing the last error caused by an LLVMRust* call.
1743 pub fn LLVMRustGetLastError() -> *const c_char
;
1745 /// Print the pass timings since static dtors aren't picking them up.
1746 pub fn LLVMRustPrintPassTimings();
1748 pub fn LLVMStructCreateNamed(C
: &Context
, Name
: *const c_char
) -> &Type
;
1750 pub fn LLVMStructSetBody(
1752 ElementTypes
: *const &'a Type
,
1753 ElementCount
: c_uint
,
1757 /// Prepares inline assembly.
1758 pub fn LLVMRustInlineAsm(
1760 AsmString
: *const c_char
,
1761 AsmStringLen
: size_t
,
1762 Constraints
: *const c_char
,
1763 ConstraintsLen
: size_t
,
1766 Dialect
: AsmDialect
,
1768 pub fn LLVMRustInlineAsmVerify(
1770 Constraints
: *const c_char
,
1771 ConstraintsLen
: size_t
,
1774 #[allow(improper_ctypes)]
1775 pub fn LLVMRustCoverageWriteFilenamesSectionToBuffer(
1776 Filenames
: *const *const c_char
,
1777 FilenamesLen
: size_t
,
1778 BufferOut
: &RustString
,
1781 #[allow(improper_ctypes)]
1782 pub fn LLVMRustCoverageWriteMappingToBuffer(
1783 VirtualFileMappingIDs
: *const c_uint
,
1784 NumVirtualFileMappingIDs
: c_uint
,
1785 Expressions
: *const coverage_map
::CounterExpression
,
1786 NumExpressions
: c_uint
,
1787 MappingRegions
: *mut coverageinfo
::CounterMappingRegion
,
1788 NumMappingRegions
: c_uint
,
1789 BufferOut
: &RustString
,
1792 pub fn LLVMRustCoverageCreatePGOFuncNameVar(F
: &'a Value
, FuncName
: *const c_char
)
1794 pub fn LLVMRustCoverageHashCString(StrVal
: *const c_char
) -> u64;
1795 pub fn LLVMRustCoverageHashByteArray(Bytes
: *const c_char
, NumBytes
: size_t
) -> u64;
1797 #[allow(improper_ctypes)]
1798 pub fn LLVMRustCoverageWriteMapSectionNameToString(M
: &Module
, Str
: &RustString
);
1800 #[allow(improper_ctypes)]
1801 pub fn LLVMRustCoverageWriteFuncSectionNameToString(M
: &Module
, Str
: &RustString
);
1803 #[allow(improper_ctypes)]
1804 pub fn LLVMRustCoverageWriteMappingVarNameToString(Str
: &RustString
);
1806 pub fn LLVMRustCoverageMappingVersion() -> u32;
1807 pub fn LLVMRustDebugMetadataVersion() -> u32;
1808 pub fn LLVMRustVersionMajor() -> u32;
1809 pub fn LLVMRustVersionMinor() -> u32;
1811 pub fn LLVMRustAddModuleFlag(M
: &Module
, name
: *const c_char
, value
: u32);
1813 pub fn LLVMRustMetadataAsValue(C
: &'a Context
, MD
: &'a Metadata
) -> &'a Value
;
1815 pub fn LLVMRustDIBuilderCreate(M
: &'a Module
) -> &'a
mut DIBuilder
<'a
>;
1817 pub fn LLVMRustDIBuilderDispose(Builder
: &'a
mut DIBuilder
<'a
>);
1819 pub fn LLVMRustDIBuilderFinalize(Builder
: &DIBuilder
<'_
>);
1821 pub fn LLVMRustDIBuilderCreateCompileUnit(
1822 Builder
: &DIBuilder
<'a
>,
1825 Producer
: *const c_char
,
1826 ProducerLen
: size_t
,
1828 Flags
: *const c_char
,
1830 SplitName
: *const c_char
,
1831 SplitNameLen
: size_t
,
1832 kind
: DebugEmissionKind
,
1834 SplitDebugInlining
: bool
,
1835 ) -> &'a DIDescriptor
;
1837 pub fn LLVMRustDIBuilderCreateFile(
1838 Builder
: &DIBuilder
<'a
>,
1839 Filename
: *const c_char
,
1840 FilenameLen
: size_t
,
1841 Directory
: *const c_char
,
1842 DirectoryLen
: size_t
,
1843 CSKind
: ChecksumKind
,
1844 Checksum
: *const c_char
,
1845 ChecksumLen
: size_t
,
1848 pub fn LLVMRustDIBuilderCreateSubroutineType(
1849 Builder
: &DIBuilder
<'a
>,
1850 ParameterTypes
: &'a DIArray
,
1851 ) -> &'a DICompositeType
;
1853 pub fn LLVMRustDIBuilderCreateFunction(
1854 Builder
: &DIBuilder
<'a
>,
1855 Scope
: &'a DIDescriptor
,
1856 Name
: *const c_char
,
1858 LinkageName
: *const c_char
,
1859 LinkageNameLen
: size_t
,
1866 MaybeFn
: Option
<&'a Value
>,
1867 TParam
: &'a DIArray
,
1868 Decl
: Option
<&'a DIDescriptor
>,
1869 ) -> &'a DISubprogram
;
1871 pub fn LLVMRustDIBuilderCreateBasicType(
1872 Builder
: &DIBuilder
<'a
>,
1873 Name
: *const c_char
,
1877 ) -> &'a DIBasicType
;
1879 pub fn LLVMRustDIBuilderCreateTypedef(
1880 Builder
: &DIBuilder
<'a
>,
1881 Type
: &'a DIBasicType
,
1882 Name
: *const c_char
,
1886 Scope
: Option
<&'a DIScope
>,
1887 ) -> &'a DIDerivedType
;
1889 pub fn LLVMRustDIBuilderCreatePointerType(
1890 Builder
: &DIBuilder
<'a
>,
1891 PointeeTy
: &'a DIType
,
1894 AddressSpace
: c_uint
,
1895 Name
: *const c_char
,
1897 ) -> &'a DIDerivedType
;
1899 pub fn LLVMRustDIBuilderCreateStructType(
1900 Builder
: &DIBuilder
<'a
>,
1901 Scope
: Option
<&'a DIDescriptor
>,
1902 Name
: *const c_char
,
1909 DerivedFrom
: Option
<&'a DIType
>,
1910 Elements
: &'a DIArray
,
1911 RunTimeLang
: c_uint
,
1912 VTableHolder
: Option
<&'a DIType
>,
1913 UniqueId
: *const c_char
,
1914 UniqueIdLen
: size_t
,
1915 ) -> &'a DICompositeType
;
1917 pub fn LLVMRustDIBuilderCreateMemberType(
1918 Builder
: &DIBuilder
<'a
>,
1919 Scope
: &'a DIDescriptor
,
1920 Name
: *const c_char
,
1929 ) -> &'a DIDerivedType
;
1931 pub fn LLVMRustDIBuilderCreateVariantMemberType(
1932 Builder
: &DIBuilder
<'a
>,
1934 Name
: *const c_char
,
1941 Discriminant
: Option
<&'a Value
>,
1946 pub fn LLVMRustDIBuilderCreateLexicalBlock(
1947 Builder
: &DIBuilder
<'a
>,
1952 ) -> &'a DILexicalBlock
;
1954 pub fn LLVMRustDIBuilderCreateLexicalBlockFile(
1955 Builder
: &DIBuilder
<'a
>,
1958 ) -> &'a DILexicalBlock
;
1960 pub fn LLVMRustDIBuilderCreateStaticVariable(
1961 Builder
: &DIBuilder
<'a
>,
1962 Context
: Option
<&'a DIScope
>,
1963 Name
: *const c_char
,
1965 LinkageName
: *const c_char
,
1966 LinkageNameLen
: size_t
,
1970 isLocalToUnit
: bool
,
1972 Decl
: Option
<&'a DIDescriptor
>,
1974 ) -> &'a DIGlobalVariableExpression
;
1976 pub fn LLVMRustDIBuilderCreateVariable(
1977 Builder
: &DIBuilder
<'a
>,
1979 Scope
: &'a DIDescriptor
,
1980 Name
: *const c_char
,
1985 AlwaysPreserve
: bool
,
1989 ) -> &'a DIVariable
;
1991 pub fn LLVMRustDIBuilderCreateArrayType(
1992 Builder
: &DIBuilder
<'a
>,
1996 Subscripts
: &'a DIArray
,
1999 pub fn LLVMRustDIBuilderGetOrCreateSubrange(
2000 Builder
: &DIBuilder
<'a
>,
2003 ) -> &'a DISubrange
;
2005 pub fn LLVMRustDIBuilderGetOrCreateArray(
2006 Builder
: &DIBuilder
<'a
>,
2007 Ptr
: *const Option
<&'a DIDescriptor
>,
2011 pub fn LLVMRustDIBuilderInsertDeclareAtEnd(
2012 Builder
: &DIBuilder
<'a
>,
2014 VarInfo
: &'a DIVariable
,
2015 AddrOps
: *const i64,
2016 AddrOpsCount
: c_uint
,
2018 InsertAtEnd
: &'a BasicBlock
,
2021 pub fn LLVMRustDIBuilderCreateEnumerator(
2022 Builder
: &DIBuilder
<'a
>,
2023 Name
: *const c_char
,
2027 ) -> &'a DIEnumerator
;
2029 pub fn LLVMRustDIBuilderCreateEnumerationType(
2030 Builder
: &DIBuilder
<'a
>,
2032 Name
: *const c_char
,
2038 Elements
: &'a DIArray
,
2039 ClassType
: &'a DIType
,
2043 pub fn LLVMRustDIBuilderCreateUnionType(
2044 Builder
: &DIBuilder
<'a
>,
2046 Name
: *const c_char
,
2053 Elements
: Option
<&'a DIArray
>,
2054 RunTimeLang
: c_uint
,
2055 UniqueId
: *const c_char
,
2056 UniqueIdLen
: size_t
,
2059 pub fn LLVMRustDIBuilderCreateVariantPart(
2060 Builder
: &DIBuilder
<'a
>,
2062 Name
: *const c_char
,
2069 Discriminator
: Option
<&'a DIDerivedType
>,
2070 Elements
: &'a DIArray
,
2071 UniqueId
: *const c_char
,
2072 UniqueIdLen
: size_t
,
2073 ) -> &'a DIDerivedType
;
2075 pub fn LLVMSetUnnamedAddress(Global
: &Value
, UnnamedAddr
: UnnamedAddr
);
2077 pub fn LLVMRustDIBuilderCreateTemplateTypeParameter(
2078 Builder
: &DIBuilder
<'a
>,
2079 Scope
: Option
<&'a DIScope
>,
2080 Name
: *const c_char
,
2083 ) -> &'a DITemplateTypeParameter
;
2085 pub fn LLVMRustDIBuilderCreateNameSpace(
2086 Builder
: &DIBuilder
<'a
>,
2087 Scope
: Option
<&'a DIScope
>,
2088 Name
: *const c_char
,
2090 ExportSymbols
: bool
,
2091 ) -> &'a DINameSpace
;
2093 pub fn LLVMRustDICompositeTypeReplaceArrays(
2094 Builder
: &DIBuilder
<'a
>,
2095 CompositeType
: &'a DIType
,
2096 Elements
: Option
<&'a DIArray
>,
2097 Params
: Option
<&'a DIArray
>,
2100 pub fn LLVMRustDIBuilderCreateDebugLocation(
2101 Context
: &'a Context
,
2105 InlinedAt
: Option
<&'a DILocation
>,
2106 ) -> &'a DILocation
;
2107 pub fn LLVMRustDIBuilderCreateOpDeref() -> i64;
2108 pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64;
2110 #[allow(improper_ctypes)]
2111 pub fn LLVMRustWriteTypeToString(Type
: &Type
, s
: &RustString
);
2112 #[allow(improper_ctypes)]
2113 pub fn LLVMRustWriteValueToString(value_ref
: &Value
, s
: &RustString
);
2115 pub fn LLVMIsAConstantInt(value_ref
: &Value
) -> Option
<&ConstantInt
>;
2117 pub fn LLVMRustPassKind(Pass
: &Pass
) -> PassKind
;
2118 pub fn LLVMRustFindAndCreatePass(Pass
: *const c_char
) -> Option
<&'
static mut Pass
>;
2119 pub fn LLVMRustCreateAddressSanitizerFunctionPass(Recover
: bool
) -> &'
static mut Pass
;
2120 pub fn LLVMRustCreateModuleAddressSanitizerPass(Recover
: bool
) -> &'
static mut Pass
;
2121 pub fn LLVMRustCreateMemorySanitizerPass(
2122 TrackOrigins
: c_int
,
2124 ) -> &'
static mut Pass
;
2125 pub fn LLVMRustCreateThreadSanitizerPass() -> &'
static mut Pass
;
2126 pub fn LLVMRustAddPass(PM
: &PassManager
<'_
>, Pass
: &'
static mut Pass
);
2127 pub fn LLVMRustAddLastExtensionPasses(
2128 PMB
: &PassManagerBuilder
,
2129 Passes
: *const &'
static mut Pass
,
2133 pub fn LLVMRustHasFeature(T
: &TargetMachine
, s
: *const c_char
) -> bool
;
2135 pub fn LLVMRustPrintTargetCPUs(T
: &TargetMachine
);
2136 pub fn LLVMRustPrintTargetFeatures(T
: &TargetMachine
);
2138 pub fn LLVMRustGetHostCPUName(len
: *mut usize) -> *const c_char
;
2139 pub fn LLVMRustCreateTargetMachine(
2140 Triple
: *const c_char
,
2142 Features
: *const c_char
,
2146 Level
: CodeGenOptLevel
,
2148 FunctionSections
: bool
,
2150 TrapUnreachable
: bool
,
2153 EmitStackSizeSection
: bool
,
2154 RelaxELFRelocations
: bool
,
2156 SplitDwarfFile
: *const c_char
,
2157 ) -> Option
<&'
static mut TargetMachine
>;
2158 pub fn LLVMRustDisposeTargetMachine(T
: &'
static mut TargetMachine
);
2159 pub fn LLVMRustAddBuilderLibraryInfo(
2160 PMB
: &'a PassManagerBuilder
,
2162 DisableSimplifyLibCalls
: bool
,
2164 pub fn LLVMRustConfigurePassManagerBuilder(
2165 PMB
: &PassManagerBuilder
,
2166 OptLevel
: CodeGenOptLevel
,
2167 MergeFunctions
: bool
,
2169 LoopVectorize
: bool
,
2170 PrepareForThinLTO
: bool
,
2171 PGOGenPath
: *const c_char
,
2172 PGOUsePath
: *const c_char
,
2174 pub fn LLVMRustAddLibraryInfo(
2175 PM
: &PassManager
<'a
>,
2177 DisableSimplifyLibCalls
: bool
,
2179 pub fn LLVMRustRunFunctionPassManager(PM
: &PassManager
<'a
>, M
: &'a Module
);
2180 pub fn LLVMRustWriteOutputFile(
2181 T
: &'a TargetMachine
,
2182 PM
: &PassManager
<'a
>,
2184 Output
: *const c_char
,
2185 DwoOutput
: *const c_char
,
2187 ) -> LLVMRustResult
;
2188 pub fn LLVMRustOptimizeWithNewPassManager(
2190 TM
: &'a TargetMachine
,
2191 OptLevel
: PassBuilderOptLevel
,
2193 NoPrepopulatePasses
: bool
,
2195 UseThinLTOBuffers
: bool
,
2196 MergeFunctions
: bool
,
2199 LoopVectorize
: bool
,
2200 DisableSimplifyLibCalls
: bool
,
2201 EmitLifetimeMarkers
: bool
,
2202 SanitizerOptions
: Option
<&SanitizerOptions
>,
2203 PGOGenPath
: *const c_char
,
2204 PGOUsePath
: *const c_char
,
2205 llvm_selfprofiler
: *mut c_void
,
2206 begin_callback
: SelfProfileBeforePassCallback
,
2207 end_callback
: SelfProfileAfterPassCallback
,
2209 pub fn LLVMRustPrintModule(
2211 Output
: *const c_char
,
2212 Demangle
: extern "C" fn(*const c_char
, size_t
, *mut c_char
, size_t
) -> size_t
,
2213 ) -> LLVMRustResult
;
2214 pub fn LLVMRustSetLLVMOptions(Argc
: c_int
, Argv
: *const *const c_char
);
2215 pub fn LLVMRustPrintPasses();
2216 pub fn LLVMRustGetInstructionCount(M
: &Module
) -> u32;
2217 pub fn LLVMRustSetNormalizedTarget(M
: &Module
, triple
: *const c_char
);
2218 pub fn LLVMRustAddAlwaysInlinePass(P
: &PassManagerBuilder
, AddLifetimes
: bool
);
2219 pub fn LLVMRustRunRestrictionPass(M
: &Module
, syms
: *const *const c_char
, len
: size_t
);
2220 pub fn LLVMRustMarkAllFunctionsNounwind(M
: &Module
);
2222 pub fn LLVMRustOpenArchive(path
: *const c_char
) -> Option
<&'
static mut Archive
>;
2223 pub fn LLVMRustArchiveIteratorNew(AR
: &'a Archive
) -> &'a
mut ArchiveIterator
<'a
>;
2224 pub fn LLVMRustArchiveIteratorNext(
2225 AIR
: &ArchiveIterator
<'a
>,
2226 ) -> Option
<&'a
mut ArchiveChild
<'a
>>;
2227 pub fn LLVMRustArchiveChildName(ACR
: &ArchiveChild
<'_
>, size
: &mut size_t
) -> *const c_char
;
2228 pub fn LLVMRustArchiveChildData(ACR
: &ArchiveChild
<'_
>, size
: &mut size_t
) -> *const c_char
;
2229 pub fn LLVMRustArchiveChildFree(ACR
: &'a
mut ArchiveChild
<'a
>);
2230 pub fn LLVMRustArchiveIteratorFree(AIR
: &'a
mut ArchiveIterator
<'a
>);
2231 pub fn LLVMRustDestroyArchive(AR
: &'
static mut Archive
);
2233 #[allow(improper_ctypes)]
2234 pub fn LLVMRustGetSectionName(
2235 SI
: &SectionIterator
<'_
>,
2236 data
: &mut Option
<std
::ptr
::NonNull
<c_char
>>,
2239 #[allow(improper_ctypes)]
2240 pub fn LLVMRustWriteTwineToString(T
: &Twine
, s
: &RustString
);
2242 pub fn LLVMContextSetDiagnosticHandler(
2244 Handler
: DiagnosticHandler
,
2245 DiagnosticContext
: *mut c_void
,
2248 #[allow(improper_ctypes)]
2249 pub fn LLVMRustUnpackOptimizationDiagnostic(
2250 DI
: &'a DiagnosticInfo
,
2251 pass_name_out
: &RustString
,
2252 function_out
: &mut Option
<&'a Value
>,
2253 loc_line_out
: &mut c_uint
,
2254 loc_column_out
: &mut c_uint
,
2255 loc_filename_out
: &RustString
,
2256 message_out
: &RustString
,
2259 pub fn LLVMRustUnpackInlineAsmDiagnostic(
2260 DI
: &'a DiagnosticInfo
,
2261 level_out
: &mut DiagnosticLevel
,
2262 cookie_out
: &mut c_uint
,
2263 message_out
: &mut Option
<&'a Twine
>,
2264 instruction_out
: &mut Option
<&'a Value
>,
2267 #[allow(improper_ctypes)]
2268 pub fn LLVMRustWriteDiagnosticInfoToString(DI
: &DiagnosticInfo
, s
: &RustString
);
2269 pub fn LLVMRustGetDiagInfoKind(DI
: &DiagnosticInfo
) -> DiagnosticKind
;
2271 pub fn LLVMRustSetInlineAsmDiagnosticHandler(
2273 H
: InlineAsmDiagHandler
,
2277 #[allow(improper_ctypes)]
2278 pub fn LLVMRustUnpackSMDiagnostic(
2280 message_out
: &RustString
,
2281 buffer_out
: &RustString
,
2282 level_out
: &mut DiagnosticLevel
,
2283 loc_out
: &mut c_uint
,
2284 ranges_out
: *mut c_uint
,
2285 num_ranges
: &mut usize,
2288 pub fn LLVMRustWriteArchive(
2291 Members
: *const &RustArchiveMember
<'_
>,
2294 ) -> LLVMRustResult
;
2295 pub fn LLVMRustArchiveMemberNew(
2296 Filename
: *const c_char
,
2297 Name
: *const c_char
,
2298 Child
: Option
<&ArchiveChild
<'a
>>,
2299 ) -> &'a
mut RustArchiveMember
<'a
>;
2300 pub fn LLVMRustArchiveMemberFree(Member
: &'a
mut RustArchiveMember
<'a
>);
2302 pub fn LLVMRustSetDataLayoutFromTargetMachine(M
: &'a Module
, TM
: &'a TargetMachine
);
2304 pub fn LLVMRustBuildOperandBundleDef(
2305 Name
: *const c_char
,
2306 Inputs
: *const &'a Value
,
2308 ) -> &'a
mut OperandBundleDef
<'a
>;
2309 pub fn LLVMRustFreeOperandBundleDef(Bundle
: &'a
mut OperandBundleDef
<'a
>);
2311 pub fn LLVMRustPositionBuilderAtStart(B
: &Builder
<'a
>, BB
: &'a BasicBlock
);
2313 pub fn LLVMRustSetComdat(M
: &'a Module
, V
: &'a Value
, Name
: *const c_char
, NameLen
: size_t
);
2314 pub fn LLVMRustUnsetComdat(V
: &Value
);
2315 pub fn LLVMRustSetModulePICLevel(M
: &Module
);
2316 pub fn LLVMRustSetModulePIELevel(M
: &Module
);
2317 pub fn LLVMRustModuleBufferCreate(M
: &Module
) -> &'
static mut ModuleBuffer
;
2318 pub fn LLVMRustModuleBufferPtr(p
: &ModuleBuffer
) -> *const u8;
2319 pub fn LLVMRustModuleBufferLen(p
: &ModuleBuffer
) -> usize;
2320 pub fn LLVMRustModuleBufferFree(p
: &'
static mut ModuleBuffer
);
2321 pub fn LLVMRustModuleCost(M
: &Module
) -> u64;
2323 pub fn LLVMRustThinLTOBufferCreate(M
: &Module
) -> &'
static mut ThinLTOBuffer
;
2324 pub fn LLVMRustThinLTOBufferFree(M
: &'
static mut ThinLTOBuffer
);
2325 pub fn LLVMRustThinLTOBufferPtr(M
: &ThinLTOBuffer
) -> *const c_char
;
2326 pub fn LLVMRustThinLTOBufferLen(M
: &ThinLTOBuffer
) -> size_t
;
2327 pub fn LLVMRustCreateThinLTOData(
2328 Modules
: *const ThinLTOModule
,
2330 PreservedSymbols
: *const *const c_char
,
2331 PreservedSymbolsLen
: c_uint
,
2332 ) -> Option
<&'
static mut ThinLTOData
>;
2333 pub fn LLVMRustPrepareThinLTORename(
2336 Target
: &TargetMachine
,
2338 pub fn LLVMRustPrepareThinLTOResolveWeak(Data
: &ThinLTOData
, Module
: &Module
) -> bool
;
2339 pub fn LLVMRustPrepareThinLTOInternalize(Data
: &ThinLTOData
, Module
: &Module
) -> bool
;
2340 pub fn LLVMRustPrepareThinLTOImport(
2343 Target
: &TargetMachine
,
2345 pub fn LLVMRustGetThinLTOModuleImports(
2346 Data
: *const ThinLTOData
,
2347 ModuleNameCallback
: ThinLTOModuleNameCallback
,
2348 CallbackPayload
: *mut c_void
,
2350 pub fn LLVMRustFreeThinLTOData(Data
: &'
static mut ThinLTOData
);
2351 pub fn LLVMRustParseBitcodeForLTO(
2355 Identifier
: *const c_char
,
2356 ) -> Option
<&Module
>;
2357 pub fn LLVMRustGetBitcodeSliceFromObjectData(
2360 out_len
: &mut usize,
2362 pub fn LLVMRustThinLTOGetDICompileUnit(
2364 CU1
: &mut *mut c_void
,
2365 CU2
: &mut *mut c_void
,
2367 pub fn LLVMRustThinLTOPatchDICompileUnit(M
: &Module
, CU
: *mut c_void
);
2369 pub fn LLVMRustLinkerNew(M
: &'a Module
) -> &'a
mut Linker
<'a
>;
2370 pub fn LLVMRustLinkerAdd(
2371 linker
: &Linker
<'_
>,
2372 bytecode
: *const c_char
,
2373 bytecode_len
: usize,
2375 pub fn LLVMRustLinkerFree(linker
: &'a
mut Linker
<'a
>);
2376 #[allow(improper_ctypes)]
2377 pub fn LLVMRustComputeLTOCacheKey(
2378 key_out
: &RustString
,
2379 mod_id
: *const c_char
,