@@ -286,6 +286,7 @@ typedef enum {
286286 LLVMInstructionValueKind ,
287287 LLVMPoisonValueValueKind ,
288288 LLVMConstantTargetNoneValueKind ,
289+ LLVMConstantPtrAuthValueKind ,
289290} LLVMValueKind ;
290291
291292typedef enum {
@@ -1666,6 +1667,35 @@ LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
16661667 */
16671668unsigned LLVMGetVectorSize (LLVMTypeRef VectorTy );
16681669
1670+ /**
1671+ * Get the pointer value for the associated ConstantPtrAuth constant.
1672+ *
1673+ * @see llvm::ConstantPtrAuth::getPointer
1674+ */
1675+ LLVMValueRef LLVMGetConstantPtrAuthPointer (LLVMValueRef PtrAuth );
1676+
1677+ /**
1678+ * Get the key value for the associated ConstantPtrAuth constant.
1679+ *
1680+ * @see llvm::ConstantPtrAuth::getKey
1681+ */
1682+ LLVMValueRef LLVMGetConstantPtrAuthKey (LLVMValueRef PtrAuth );
1683+
1684+ /**
1685+ * Get the discriminator value for the associated ConstantPtrAuth constant.
1686+ *
1687+ * @see llvm::ConstantPtrAuth::getDiscriminator
1688+ */
1689+ LLVMValueRef LLVMGetConstantPtrAuthDiscriminator (LLVMValueRef PtrAuth );
1690+
1691+ /**
1692+ * Get the address discriminator value for the associated ConstantPtrAuth
1693+ * constant.
1694+ *
1695+ * @see llvm::ConstantPtrAuth::getAddrDiscriminator
1696+ */
1697+ LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator (LLVMValueRef PtrAuth );
1698+
16691699/**
16701700 * @}
16711701 */
@@ -1789,6 +1819,10 @@ unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx);
17891819 * @{
17901820 */
17911821
1822+ // Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
1823+ // macro in a progressively-indented fashion, which is not desired
1824+ // clang-format off
1825+
17921826#define LLVM_FOR_EACH_VALUE_SUBCLASS (macro ) \
17931827 macro(Argument) \
17941828 macro(BasicBlock) \
@@ -1808,6 +1842,7 @@ unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx);
18081842 macro(ConstantStruct) \
18091843 macro(ConstantTokenNone) \
18101844 macro(ConstantVector) \
1845+ macro(ConstantPtrAuth) \
18111846 macro(GlobalValue) \
18121847 macro(GlobalAlias) \
18131848 macro(GlobalObject) \
@@ -1879,6 +1914,8 @@ unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx);
18791914 macro(AtomicRMWInst) \
18801915 macro(FenceInst)
18811916
1917+ // clang-format on
1918+
18821919/**
18831920 * @defgroup LLVMCCoreValueGeneral General APIs
18841921 *
@@ -2372,6 +2409,14 @@ LLVM_ATTRIBUTE_C_DEPRECATED(
23722409 */
23732410LLVMValueRef LLVMConstVector (LLVMValueRef * ScalarConstantVals , unsigned Size );
23742411
2412+ /**
2413+ * Create a ConstantPtrAuth constant with the given values.
2414+ *
2415+ * @see llvm::ConstantPtrAuth::get()
2416+ */
2417+ LLVMValueRef LLVMConstantPtrAuth (LLVMValueRef Ptr , LLVMValueRef Key ,
2418+ LLVMValueRef Disc , LLVMValueRef AddrDisc );
2419+
23752420/**
23762421 * @}
23772422 */
0 commit comments