Skip to content

Commit 10a508b

Browse files
committed
Define ptrauth call operand bundle and introduce const_ptr_aut
`const_ptr_auth` wraps aroudn `LLVMRustConstPtrAuth`, which provides a way to decorate a function pointer in `ConstPtrAuth`.
1 parent e25e3a1 commit 10a508b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,9 +1799,13 @@ extern "C" LLVMValueRef LLVMRustConstPtrAuth(LLVMValueRef Ptr, uint32_t Key,
17991799
: ConstantPointerNull::get(cast<PointerType>(C->getType()));
18001800
assert(AddrDiv && "Failed to get Address Diversity");
18011801
llvm::Type *PtrTy = llvm::PointerType::get(Ctx, PTy->getAddressSpace());
1802+
#if LLVM_VERSION_GE(22, 0)
18021803
auto *DeactivationSym = llvm::Constant::getNullValue(PtrTy);
18031804

18041805
return wrap(ConstantPtrAuth::get(C, KeyC, DiscC, AddrDiv, DeactivationSym));
1806+
#else
1807+
return wrap(ConstantPtrAuth::get(C, KeyC, DiscC, AddrDiv));
1808+
#endif
18051809
}
18061810

18071811
// Statically assert that the fixed metadata kind IDs declared in

0 commit comments

Comments
 (0)