Skip to content

Commit 5747648

Browse files
authored
fix higher-order { float } ret case (#115)
1 parent db2a069 commit 5747648

File tree

1 file changed

+1
-2
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+1
-2
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ unsafe fn create_call<'a>(tgt: &'a Value, src: &'a Value, rev_mode: bool,
840840
c_inner_fnc_name.as_ptr(),
841841
);
842842

843-
844843
// Add dummy dbg info to our newly generated call, if we have any.
845844
let inst = LLVMRustgetFirstNonPHIOrDbgOrLifetime(bb).unwrap();
846845
let md_ty = llvm::LLVMGetMDKindIDInContext(
@@ -863,7 +862,7 @@ unsafe fn create_call<'a>(tgt: &'a Value, src: &'a Value, rev_mode: bool,
863862
let f_return_type = LLVMGetReturnType(LLVMGlobalGetValueType(src));
864863
let void_type = LLVMVoidTypeInContext(llcx);
865864
// Now unwrap the struct_ret if it's actually a struct
866-
if rev_mode && f_return_type != void_type {
865+
if f_return_type != void_type {
867866
let num_elem_in_ret_struct = LLVMCountStructElementTypes(f_return_type);
868867
if num_elem_in_ret_struct == 1 {
869868
let inner_grad_name = "foo".to_string();

0 commit comments

Comments
 (0)