aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorerichkeane <ekeane@nvidia.com>2025-01-22 06:47:14 -0800
committererichkeane <ekeane@nvidia.com>2025-03-06 06:42:17 -0800
commitdf1e102e2a6b0e0f1ecf28c58a4a51dbcbe74360 (patch)
treedd051896f103fc9c9567dbd680ffff507b8fac54 /clang/lib/Serialization/ASTWriterDecl.cpp
parent4703f8b6610a13b549c1b8aefe90d0f8975fea1e (diff)
downloadllvm-df1e102e2a6b0e0f1ecf28c58a4a51dbcbe74360.zip
llvm-df1e102e2a6b0e0f1ecf28c58a4a51dbcbe74360.tar.gz
llvm-df1e102e2a6b0e0f1ecf28c58a4a51dbcbe74360.tar.bz2
[OpenACC] implement AST/Sema for 'routine' construct with argument
The 'routine' construct has two forms, one which takes the name of a function that it applies to, and another where it implicitly figures it out based on the next declaration. This patch implements the former with the required restrictions on the name and the function-static-variables as specified. What has not been implemented is any clauses for this, any of the A.3.4 warnings, or the other form.
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 88dd212..d455134 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -177,6 +177,7 @@ namespace clang {
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D);
void VisitOpenACCDeclareDecl(OpenACCDeclareDecl *D);
+ void VisitOpenACCRoutineDecl(OpenACCRoutineDecl *D);
/// Add an Objective-C type parameter list to the given record.
void AddObjCTypeParamList(ObjCTypeParamList *typeParams) {
@@ -2281,6 +2282,17 @@ void ASTDeclWriter::VisitOpenACCDeclareDecl(OpenACCDeclareDecl *D) {
Record.writeOpenACCClauseList(D->clauses());
Code = serialization::DECL_OPENACC_DECLARE;
}
+void ASTDeclWriter::VisitOpenACCRoutineDecl(OpenACCRoutineDecl *D) {
+ Record.writeUInt32(D->clauses().size());
+ VisitDecl(D);
+ Record.writeEnum(D->DirKind);
+ Record.AddSourceLocation(D->DirectiveLoc);
+ Record.AddSourceLocation(D->EndLoc);
+ Record.AddSourceRange(D->ParensLoc);
+ Record.AddStmt(D->FuncRef);
+ Record.writeOpenACCClauseList(D->clauses());
+ Code = serialization::DECL_OPENACC_ROUTINE;
+}
//===----------------------------------------------------------------------===//
// ASTWriter Implementation