Skip to content

Commit 67a6b87

Browse files
committed
remove duplicated LLVM wrapper function
1 parent 119beb4 commit 67a6b87

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub(crate) fn generate_enzyme_call<'ll>(
123123
// arguments. We do however need to declare them with their correct return type.
124124
// We already figured the correct return type out in our frontend, when generating the outer_fn,
125125
// so we can now just go ahead and use that. FIXME(ZuseZ4): This doesn't handle sret yet.
126-
let fn_ty = llvm::LLVMRustGetFunctionType(outer_fn);
126+
let fn_ty = llvm::LLVMGlobalGetValueType(outer_fn);
127127
let ret_ty = llvm::LLVMGetReturnType(fn_ty);
128128

129129
// LLVM can figure out the input types on it's own, so we take a shortcut here.

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern "C" {
1111
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> &Metadata;
1212
pub fn LLVMRustEraseInstFromParent(V: &Value);
1313
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
14-
pub fn LLVMRustGetFunctionType(fnc: &Value) -> &Type;
1514

1615
pub fn LLVMGetReturnType(T: &Type) -> &Type;
1716
pub fn LLVMDumpModule(M: &Module);

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,6 @@ extern "C" void LLVMRustEraseInstFromParent(LLVMValueRef Instr) {
399399
}
400400
}
401401

402-
extern "C" LLVMTypeRef LLVMRustGetFunctionType(LLVMValueRef Fn) {
403-
auto Ftype = unwrap<Function>(Fn)->getFunctionType();
404-
return wrap(Ftype);
405-
}
406-
407402
extern "C" LLVMAttributeRef
408403
LLVMRustCreateAttrNoValue(LLVMContextRef C, LLVMRustAttributeKind RustAttr) {
409404
return wrap(Attribute::get(*unwrap(C), fromRust(RustAttr)));

0 commit comments

Comments
 (0)