Skip to content

Commit ce7cb31

Browse files
committed
Add link attribute for Enzyme's FFI
1 parent 854f225 commit ce7cb31

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use libc::{c_char, c_uint};
44

55
use super::ffi::{BasicBlock, Metadata, Module, Type, Value};
66
use crate::llvm::Bool;
7+
8+
#[link(name = "llvm-wrapper", kind = "static")]
79
extern "C" {
810
// Enzyme
911
pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool;
@@ -12,10 +14,13 @@ extern "C" {
1214
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>;
1315
pub fn LLVMRustEraseInstFromParent(V: &Value);
1416
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
15-
pub fn LLVMDumpModule(M: &Module);
16-
pub fn LLVMDumpValue(V: &Value);
1717
pub fn LLVMRustVerifyFunction(V: &Value, action: LLVMRustVerifierFailureAction) -> Bool;
18+
}
1819

20+
extern "C" {
21+
// Enzyme
22+
pub fn LLVMDumpModule(M: &Module);
23+
pub fn LLVMDumpValue(V: &Value);
1924
pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
2025
pub fn LLVMGetReturnType(T: &Type) -> &Type;
2126
pub fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);

0 commit comments

Comments
 (0)