diff options
author | erichkeane <ekeane@nvidia.com> | 2025-03-07 07:44:38 -0800 |
---|---|---|
committer | erichkeane <ekeane@nvidia.com> | 2025-03-10 07:49:13 -0700 |
commit | 8a8f1359ee1d47d85c5fb4d23587845baecd59c9 (patch) | |
tree | 5e467d2817655273db211278f983a61dedf2d453 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 967ab7e08e62a35cc65f34e21fbeb00abf3eb83f (diff) | |
download | llvm-8a8f1359ee1d47d85c5fb4d23587845baecd59c9.zip llvm-8a8f1359ee1d47d85c5fb4d23587845baecd59c9.tar.gz llvm-8a8f1359ee1d47d85c5fb4d23587845baecd59c9.tar.bz2 |
[OpenACC] Implement 'bind' ast/sema for 'routine' directive
The 'bind' clause allows the renaming of a function during code
generation. There are a few rules about when this can/cannot happen,
and it takes either a string or identifier (previously mis-implemetned
as ID-expression) argument.
Note there are additional rules to this in the implicit-function routine
case, but that isn't implemented in this patch, as implicit-function
routine is not yet implemented either.
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 0aa115e..d7328cc 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -8844,7 +8844,17 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { return; } - case OpenACCClauseKind::Bind: + case OpenACCClauseKind::Bind: { + const auto *BC = cast<OpenACCBindClause>(C); + writeSourceLocation(BC->getLParenLoc()); + writeBool(BC->isStringArgument()); + if (BC->isStringArgument()) + AddStmt(const_cast<StringLiteral *>(BC->getStringArgument())); + else + AddIdentifierRef(BC->getIdentifierArgument()); + + return; + } case OpenACCClauseKind::Invalid: llvm_unreachable("Clause serialization not yet implemented"); } |