Skip to content

Commit 8989977

Browse files
committed
Add bindings for LLVM methods:
1. LLVMGetFirstFunction 2. LLVMGetNextFunction 3. LLVMGetModuleContext 4. LLVMAddAttributeAtIndex
1 parent 562efc9 commit 8989977

File tree

1 file changed

+8
-0
lines changed
  • compiler/rustc_codegen_llvm/src/llvm

1 file changed

+8
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+8
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ pub(crate) enum ArchiveKind {
609609
K_AIXBIG,
610610
}
611611

612+
pub(crate) const LLVMAttributeFunctionIndex: c_uint = 0;
613+
612614
unsafe extern "C" {
613615
// LLVMRustThinLTOData
614616
pub(crate) type ThinLTOData;
@@ -1157,6 +1159,12 @@ unsafe extern "C" {
11571159
pub(crate) fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
11581160
pub(crate) fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
11591161
pub(crate) fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
1162+
1163+
pub(crate) fn LLVMGetFirstFunction(M: &Module) -> Option<&Value>;
1164+
pub(crate) fn LLVMGetNextFunction(Fn: &Value) -> Option<&Value>;
1165+
pub(crate) fn LLVMGetModuleContext(M: &Module) -> &Context;
1166+
pub(crate) fn LLVMAddAttributeAtIndex(F: &Value, Idx: u32, A: &Attribute);
1167+
11601168
pub(crate) fn LLVMDeleteGlobal(GlobalVar: &Value);
11611169
pub(crate) fn LLVMGetInitializer(GlobalVar: &Value) -> Option<&Value>;
11621170
pub(crate) fn LLVMSetInitializer<'a>(GlobalVar: &'a Value, ConstantVal: &'a Value);

0 commit comments

Comments
 (0)