================ @@ -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"); ---------------- ahatanak wrote:
I moved the assertion to the beginning of the function to make it clear that at least one side has to be signed. 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