Skip to content

Commit 437202b

Browse files
committed
adressing more feedback
1 parent 62b442c commit 437202b

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

compiler/rustc_codegen_llvm/src/builder/autodiff.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn generate_enzyme_call<'ll, 'tcx>(
246246
// FIXME(ZuseZ4): Work with Enzyme core devs to clarify what debug metadata issues we have,
247247
// and how to best improve it for enzyme core and rust-enzyme.
248248
let md_ty = cx.get_md_kind_id("dbg");
249-
if llvm::LLVMRustHasMetadata(last_inst, md_ty) == True {
249+
if llvm::LLVMRustHasMetadata(last_inst, md_ty) {
250250
let md = llvm::LLVMRustDIGetInstMetadata(last_inst)
251251
.expect("failed to get instruction metadata");
252252
let md_todiff = cx.get_metadata_value(md);

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,22 @@
33
use libc::{c_char, c_uint};
44

55
use super::Bool;
6-
use super::ffi::{Attribute, BasicBlock, Builder, Metadata, Module, Type, Value};
6+
use super::ffi::{Attribute, BasicBlock, Metadata, Module, Type, Value};
77
extern "C" {
88
// Enzyme
9-
pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> Bool;
9+
pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool;
1010
pub fn LLVMRustEraseInstBefore(BB: &BasicBlock, I: &Value);
1111
pub fn LLVMRustGetLastInstruction<'a>(BB: &BasicBlock) -> Option<&'a Value>;
1212
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>;
1313
pub fn LLVMRustEraseInstFromParent(V: &Value);
1414
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
15-
pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
1615

16+
pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
1717
pub fn LLVMGetReturnType(T: &Type) -> &Type;
1818
pub fn LLVMDumpModule(M: &Module);
1919
pub fn LLVMCountStructElementTypes(T: &Type) -> c_uint;
2020
pub fn LLVMVerifyFunction(V: &Value, action: LLVMVerifierFailureAction) -> Bool;
2121
pub fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);
22-
pub fn LLVMBuildCall2<'a>(
23-
arg1: &Builder<'a>,
24-
ty: &Type,
25-
func: &Value,
26-
args: *const &Value,
27-
num_args: usize,
28-
name: *const c_char,
29-
) -> &'a Value;
3022
pub fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> Option<&Value>;
3123
pub fn LLVMIsEnumAttribute(A: &Attribute) -> Bool;
3224
pub fn LLVMIsStringAttribute(A: &Attribute) -> Bool;

0 commit comments

Comments
 (0)