[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 01:57:16 PST 2024


================
@@ -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();
----------------
Ritanya-B-Bharadwaj wrote:

I was unsure whether `EvaluateAsInt` could fetch the value from the expression containing implicit casts as the control kept ending up in the else case.

https://github.com/llvm/llvm-project/pull/118471


More information about the llvm-commits mailing list