[all-commits] [llvm/llvm-project] cac6b1: [OpenACC] Implement 'var' parsing correctly, suppo...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed Jan 10 10:27:03 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cac6b1a5420d76f4635696372849dbbf07a77376
      https://github.com/llvm/llvm-project/commit/cac6b1a5420d76f4635696372849dbbf07a77376
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M clang/include/clang/Parse/Parser.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Parse/ParseExpr.cpp
    M clang/lib/Parse/ParseOpenACC.cpp
    M clang/test/ParserOpenACC/parse-cache-construct.c
    M clang/test/ParserOpenACC/parse-cache-construct.cpp

  Log Message:
  -----------
  [OpenACC] Implement 'var' parsing correctly, support array sections (#77617)

While investigating implementing 'var-list' generically for the variety
of clauses that support this syntax (an extensive list!) I discovered
that it includes 'compound types' and members of compound types, as well
as array sections.

This patch genericizes that function, and implements it in terms of an
assignment expression, and enables a simplified version of OMP Array
Sections for it. OpenACC only supports a startidx + length, so this
patch implements that parsing.

However, it is currently still being represented as an OpenMP Array
Section, which is semantically very similar. It is my intent to come
back and genericize the OMP Array Sections types (or create a similar
expression node) in the future when dealing with Sema.

At the moment, the only obvious problem with it is that the diagnostic
for using it in the 'wrong' place says OpenMP instead of OpenACC, which
I intend to fix when I deal with the AST node changes.




More information about the All-commits mailing list