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

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Wed Jan 29 09:55:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8593239a3b5a8864c2a315db33bbcb7b68f3da0
      https://github.com/llvm/llvm-project/commit/c8593239a3b5a8864c2a315db33bbcb7b68f3da0
  Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
  Date:   2025-01-29 (Wed, 29 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 (#122900)

A trait poperty can be one of serveral alternatives (name, expression,
etc.), 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