diff options
| author | Ben Kimock <kimockb@gmail.com> | 2025-01-31 21:11:23 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2025-01-31 21:11:23 -0500 |
| commit | ce7cb312fa2a51d7f2cf4603d9707811f76ed611 (patch) | |
| tree | 851894be4dc1c03d0d168bd9307334cc5abc3731 /compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs | |
| parent | 854f22563c8daf92709fae18ee6aed52953835cd (diff) | |
| download | rust-ce7cb312fa2a51d7f2cf4603d9707811f76ed611.tar.gz rust-ce7cb312fa2a51d7f2cf4603d9707811f76ed611.zip | |
Add link attribute for Enzyme's FFI
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs index ae813fe5ebf..92b0ce8ffe1 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs @@ -4,6 +4,8 @@ use libc::{c_char, c_uint}; use super::ffi::{BasicBlock, Metadata, Module, Type, Value}; use crate::llvm::Bool; + +#[link(name = "llvm-wrapper", kind = "static")] extern "C" { // Enzyme pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool; @@ -12,10 +14,13 @@ extern "C" { pub fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>; pub fn LLVMRustEraseInstFromParent(V: &Value); pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value; - pub fn LLVMDumpModule(M: &Module); - pub fn LLVMDumpValue(V: &Value); pub fn LLVMRustVerifyFunction(V: &Value, action: LLVMRustVerifierFailureAction) -> Bool; +} +extern "C" { + // Enzyme + pub fn LLVMDumpModule(M: &Module); + pub fn LLVMDumpValue(V: &Value); pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint; pub fn LLVMGetReturnType(T: &Type) -> &Type; pub fn LLVMGetParams(Fnc: &Value, parms: *mut &Value); |
