llvm_sys/
comdat.rs

1//! COMDAT
2use super::*;
3
4#[repr(C)]
5#[derive(Clone, Copy, Debug, PartialEq)]
6pub enum LLVMComdatSelectionKind {
7    /// The linker may choose any COMDAT.
8    LLVMAnyComdatSelectionKind,
9    /// The data referenced by the COMDAT must be the same.
10    LLVMExactMatchComdatSelectionKind,
11    /// The linker will choose the largest COMDAT.
12    LLVMLargestComdatSelectionKind,
13    /// No deduplication is performed.
14    LLVMNoDuplicatesComdatSelectionKind,
15    /// The data referenced by the COMDAT must be the same size.
16    LLVMSameSizeComdatSelectionKind,
17}
18
19extern "C" {
20    /// Return the Comdat in the module with the specified name. It is created if it didn't already exist.
21    pub fn LLVMGetOrInsertComdat(M: LLVMModuleRef, Name: *const ::libc::c_char) -> LLVMComdatRef;
22
23    /// Get the Comdat assigned to the given global object.
24    pub fn LLVMGetComdat(V: LLVMValueRef) -> LLVMComdatRef;
25
26    /// Assign the Comdat to the given global object.
27    pub fn LLVMSetComdat(V: LLVMValueRef, C: LLVMComdatRef);
28
29    /// Get the conflict resolution selection kind for the Comdat.
30    pub fn LLVMGetComdatSelectionKind(C: LLVMComdatRef) -> LLVMComdatSelectionKind;
31
32    /// Set the conflict resolution selection kind for the Comdat.
33    pub fn LLVMSetComdatSelectionKind(C: LLVMComdatRef, Kind: LLVMComdatSelectionKind);
34}