[all-commits] [llvm/llvm-project] 3bfe74: [flang][OpenMP] Make parsing of trait properties m...

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Tue Jan 14 05:27:48 PST 2025


  Branch: refs/heads/users/kparzysz/spr/m02-context-parse
  Home:   https://github.com/llvm/llvm-project
  Commit: 3bfe74e70673bb74cfed0a86ce66c8c37095352b
      https://github.com/llvm/llvm-project/commit/3bfe74e70673bb74cfed0a86ce66c8c37095352b
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

  Changed paths:
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/lib/Parser/openmp-parsers.cpp
    M flang/lib/Parser/unparse.cpp

  Log Message:
  -----------
  [flang][OpenMP] Make parsing of trait properties more context-sensitive

A trait poperty can be one of serveral alternatives, and each property
in a list was parsed as if it could be any of these alternatives
independently from other properties. This made the parsing vulnerable
to certain ambiguities in the trait grammar (provided in the OpenMP
spec).
At the same time the OpenMP spec gives the expected types of properties
for almost every trait: all properties listed for a given trait are
usually of the same type, e.g. names, clauses, etc.

Incorporate these restrictions into the parser, and additionally use
property extensions as the fallback if the parsing of the expected
property type failed. This is intended to allow the parser to succeed,
and instead let the semantic-checking code emit a more user-friendly
message.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list