================ @@ -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()) + .CaseLower("default", mlir::acc::DeviceType::Default) + .CaseLower("host", mlir::acc::DeviceType::Host) + .CaseLower("multicore", mlir::acc::DeviceType::Multicore) + .CasesLower("nvidia", "acc_device_nvidia", + mlir::acc::DeviceType::Nvidia) + .CaseLower("radeon", mlir::acc::DeviceType::Radeon); + } + + void VisitDeviceTypeClause(const OpenACCDeviceTypeClause &clause) { + + switch (dirKind) { + case OpenACCDirectiveKind::Init: + case OpenACCDirectiveKind::Shutdown: { + // Device type has a list that is either a 'star' (emitted as 'star'), + // or an identifer list, all of which get added for attributes. + + for (const DeviceTypeArgument &Arg : clause.getArchitectures()) ---------------- andykaylor wrote:
```suggestion for (const DeviceTypeArgument &arg : clause.getArchitectures()) ``` https://github.com/llvm/llvm-project/pull/135102 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits