[PATCH] D112577: [clang][OpenMP] Initial parsing/sema for 'align' clause

David Pagan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 3 12:49:44 PDT 2021


ddpagan added a comment.

Thanks for reviewing the code, Aaron.



================
Comment at: clang/lib/Serialization/ASTWriter.cpp:5018
         Record.AddStmt(A->getAllocator());
+        Record.AddStmt(A->getAlignment());
         Record.AddSourceRange(A->getRange());
----------------
aaron.ballman wrote:
> This can potentially add a null statement to emit to the serialized form.
The same thing can occur with A->getAllocator(). However, it's expected behavior. When these values are read in later, the allocator and alignment values are use to set the appropriate fields in the allocate directive. Null values are okay as they indicate whether or not a field has been specified (via an align or allocator clause).


================
Comment at: clang/lib/Serialization/ASTWriter.cpp:6224
+void OMPClauseWriter::VisitOMPAlignClause(OMPAlignClause *C) {
+  Record.AddStmt(C->getAlignment());
+  Record.AddSourceLocation(C->getLParenLoc());
----------------
aaron.ballman wrote:
> Same for this one, maybe?
This is called only when an align clause has been specified, so it's guaranteed to not be null.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112577/new/

https://reviews.llvm.org/D112577



More information about the cfe-commits mailing list