[clang] [llvm] [OpenMP][Clang] Parsing/Sema support for `use_device_ptr(fb_preserve/fb_nullify)`. (2/4) (PR #170578)

Abhinav Gaba via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 13:55:08 PST 2026


================
@@ -18757,7 +18757,11 @@ OMPClause *SemaOpenMP::ActOnOpenMPVarListClause(OpenMPClauseKind Kind,
         VarList, Locs);
     break;
   case OMPC_use_device_ptr:
-    Res = ActOnOpenMPUseDevicePtrClause(VarList, Locs);
+    Res = ActOnOpenMPUseDevicePtrClause(
+        VarList, Locs,
+        static_cast<OpenMPUseDevicePtrFallbackModifier>(
----------------
abhinavgaba wrote:

`Data.UseDeviceptrFallbackModifier` is an `int` whereas the argument expects an enum. This is similar to `Data.ExtraModifier`, which is also an int.  
  
https://github.com/llvm/llvm-project/blob/2a9b30d22879889abd90a1ae589e4d734779c2a9/clang/include/clang/Sema/SemaOpenMP.h#L1179-L1180  
  
I added the new field for readability, but we could reuse `ExtraModifier` if that's preferable.

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


More information about the cfe-commits mailing list