diff options
author | erichkeane <ekeane@nvidia.com> | 2024-05-02 14:11:17 -0700 |
---|---|---|
committer | erichkeane <ekeane@nvidia.com> | 2024-05-03 07:51:25 -0700 |
commit | 01e91a2dde497b71b0b85d5ec0f101a21e9c892c (patch) | |
tree | 8e79e1a9744a5e482a4042d95e40a78e878a5d46 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 40cc96e7ece74479957ae5680b9e04b7743a000c (diff) | |
download | llvm-01e91a2dde497b71b0b85d5ec0f101a21e9c892c.zip llvm-01e91a2dde497b71b0b85d5ec0f101a21e9c892c.tar.gz llvm-01e91a2dde497b71b0b85d5ec0f101a21e9c892c.tar.bz2 |
[OpenACC] Implement copyin, copyout, create clauses for compute construct
Like 'copy', these also have alternate names, so this implements that as
well. Additionally, these have an optional tag of either 'readonly' or
'zero' depending on the clause.
Otherwise, this is a pretty rote implementation of the clause, as there
aren't any special rules for it.
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 118e439..9712ed6 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -7813,6 +7813,33 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeOpenACCVarList(CC); return; } + case OpenACCClauseKind::CopyIn: + case OpenACCClauseKind::PCopyIn: + case OpenACCClauseKind::PresentOrCopyIn: { + const auto *CIC = cast<OpenACCCopyInClause>(C); + writeSourceLocation(CIC->getLParenLoc()); + writeBool(CIC->isReadOnly()); + writeOpenACCVarList(CIC); + return; + } + case OpenACCClauseKind::CopyOut: + case OpenACCClauseKind::PCopyOut: + case OpenACCClauseKind::PresentOrCopyOut: { + const auto *COC = cast<OpenACCCopyOutClause>(C); + writeSourceLocation(COC->getLParenLoc()); + writeBool(COC->isZero()); + writeOpenACCVarList(COC); + return; + } + case OpenACCClauseKind::Create: + case OpenACCClauseKind::PCreate: + case OpenACCClauseKind::PresentOrCreate: { + const auto *CC = cast<OpenACCCreateClause>(C); + writeSourceLocation(CC->getLParenLoc()); + writeBool(CC->isZero()); + writeOpenACCVarList(CC); + return; + } case OpenACCClauseKind::Finalize: case OpenACCClauseKind::IfPresent: @@ -7831,9 +7858,6 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { case OpenACCClauseKind::DeviceResident: case OpenACCClauseKind::Host: case OpenACCClauseKind::Link: - case OpenACCClauseKind::CopyOut: - case OpenACCClauseKind::CopyIn: - case OpenACCClauseKind::Create: case OpenACCClauseKind::Reduction: case OpenACCClauseKind::Collapse: case OpenACCClauseKind::Bind: |