[clang] [OpenACC][CIR] Implement 'self' lowering on compute constructs (PR #135851)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 15:03:07 PDT 2025
================
@@ -32,46 +32,52 @@ constexpr bool isOneOfTypes =
template <typename ToTest, typename T>
constexpr bool isOneOfTypes<ToTest, T> = std::is_same_v<ToTest, T>;
+template <typename OpTy>
class OpenACCClauseCIREmitter final
- : public OpenACCClauseVisitor<OpenACCClauseCIREmitter> {
- CIRGenModule &cgm;
+ : public OpenACCClauseVisitor<OpenACCClauseCIREmitter<OpTy>> {
+ OpTy &operation;
+ CIRGenFunction &cgf;
+ CIRGenBuilderTy &builder;
+
// This is necessary since a few of the clauses emit differently based on the
// directive kind they are attached to.
OpenACCDirectiveKind dirKind;
+ // This source location should be able to go away once the NYI diagnostics are
+ // gone.
SourceLocation dirLoc;
- struct AttributeData {
- // Value of the 'default' attribute, added on 'data' and 'compute'/etc
- // constructs as a 'default-attr'.
- std::optional<ClauseDefaultValue> defaultVal = std::nullopt;
- // For directives that have their device type architectures listed in
- // attributes (init/shutdown/etc), the list of architectures to be emitted.
- llvm::SmallVector<mlir::acc::DeviceType> deviceTypeArchs{};
- } attrData;
-
void clauseNotImplemented(const OpenACCClause &c) {
- cgm.errorNYI(c.getSourceRange(), "OpenACC Clause", c.getClauseKind());
+ cgf.getCIRGenModule().errorNYI(c.getSourceRange(), "OpenACC Clause",
----------------
andykaylor wrote:
I believe you can use `cgf.cgm` here for a little more brevity.
https://github.com/llvm/llvm-project/pull/135851
More information about the cfe-commits
mailing list