================ @@ -165,6 +166,88 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) { return ::getPointerAuthInfoForType(*this, T); } +static bool isZeroConstant(llvm::Value *value) { + if (auto ci = dyn_cast<llvm::ConstantInt>(value)) + return ci->isZero(); + return false; +} + +static bool equalAuthPolicies(const CGPointerAuthInfo &left, + const CGPointerAuthInfo &right) { + if (left.isSigned() != right.isSigned()) + return false; + assert(left.isSigned() && right.isSigned() && + "should only be called with non-null auth policies"); ---------------- atrosinenko wrote:
Maybe something like "Both pointers should have non-null auth policies" would be better: implying current point in code instead of function call (as from the above check, null auth policies are OK provided they are **both** null). Or maybe this description is correct and the above check is not actually needed (this seems consistent with how this function is called in this PR). https://github.com/llvm/llvm-project/pull/98847 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits