mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
Rollup merge of #156461 - TimNN:retty, r=nikic
LLVM 23: Specify `returnaddress` intrinsic return type https://github.com/llvm/llvm-project/pull/188464 made the return type of the intrinsic generic to support different pointer address spaces. @rustbot label llvm-main
This commit is contained in:
@@ -860,7 +860,14 @@ fn codegen_intrinsic_call(
|
||||
_ => {
|
||||
let ty = self.type_ix(32);
|
||||
let val = self.const_int(ty, 0);
|
||||
self.call_intrinsic("llvm.returnaddress", &[], &[val])
|
||||
|
||||
let type_params: &[&'ll Type] = if llvm_version < (23, 0, 0) {
|
||||
&[]
|
||||
} else {
|
||||
&[self.type_ptr()]
|
||||
};
|
||||
|
||||
self.call_intrinsic("llvm.returnaddress", type_params, &[val])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
#[no_mangle]
|
||||
#[inline(never)]
|
||||
pub fn call_return_address_intrinsic() -> *const () {
|
||||
// CHECK: call ptr @llvm.returnaddress(i32 0)
|
||||
// CHECK: call ptr @llvm.returnaddress{{(.p0)?}}(i32 0)
|
||||
core::intrinsics::return_address()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user