[clang] [OpenACC][CIR] Implement 'device_type' clause lowering for 'init'/'sh… (PR #135102)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 10 10:29:17 PDT 2025


================
@@ -57,31 +75,90 @@ class OpenACCClauseCIREmitter final
     }
   }
 
+  mlir::acc::DeviceType decodeDeviceType(const IdentifierInfo *II) {
+
+    // '*' case leaves no identifier-info, just a nullptr.
+    if (!II)
+      return mlir::acc::DeviceType::Star;
+    return llvm::StringSwitch<mlir::acc::DeviceType>(II->getName())
----------------
erichkeane wrote:

It doesn't.  It asserts, which is the behavior we want.

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


More information about the cfe-commits mailing list