Skip to content

Commit

Permalink
remove duplicated LLVM wrapper function
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuseZ4 committed Dec 12, 2024
1 parent 119beb4 commit 67a6b87
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub(crate) fn generate_enzyme_call<'ll>(
// arguments. We do however need to declare them with their correct return type.
// We already figured the correct return type out in our frontend, when generating the outer_fn,
// so we can now just go ahead and use that. FIXME(ZuseZ4): This doesn't handle sret yet.
let fn_ty = llvm::LLVMRustGetFunctionType(outer_fn);
let fn_ty = llvm::LLVMGlobalGetValueType(outer_fn);
let ret_ty = llvm::LLVMGetReturnType(fn_ty);

// LLVM can figure out the input types on it's own, so we take a shortcut here.
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ extern "C" {
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> &Metadata;
pub fn LLVMRustEraseInstFromParent(V: &Value);
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
pub fn LLVMRustGetFunctionType(fnc: &Value) -> &Type;

pub fn LLVMGetReturnType(T: &Type) -> &Type;
pub fn LLVMDumpModule(M: &Module);
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,6 @@ extern "C" void LLVMRustEraseInstFromParent(LLVMValueRef Instr) {
}
}

extern "C" LLVMTypeRef LLVMRustGetFunctionType(LLVMValueRef Fn) {
auto Ftype = unwrap<Function>(Fn)->getFunctionType();
return wrap(Ftype);
}

extern "C" LLVMAttributeRef
LLVMRustCreateAttrNoValue(LLVMContextRef C, LLVMRustAttributeKind RustAttr) {
return wrap(Attribute::get(*unwrap(C), fromRust(RustAttr)));
Expand Down

0 comments on commit 67a6b87

Please sign in to comment.