================ @@ -15629,6 +15629,34 @@ ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause( return ICE; } +void SemaOpenMP::ActOnOpenMPDeviceNum(Expr *DeviceNumExpr) { + llvm::APSInt Result; + Expr::EvalResult EvalResult; + // Strip implicit casts from the expression + DeviceNumExpr = DeviceNumExpr->IgnoreImpCasts(); + // Evaluate the expression to an integer value + if (DeviceNumExpr->EvaluateAsInt(EvalResult, SemaRef.Context)) { + // The device expression must evaluate to a non-negative integer value. + Result = EvalResult.Val.getInt(); + if (Result.isNonNegative()) { + OMPContext::DeviceNum = Result.getSExtValue(); ---------------- alexey-bataev wrote:
`Result.getZExtValue()], since it is non-negative? https://github.com/llvm/llvm-project/pull/118471 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits