[all-commits] [llvm/llvm-project] 463a2b: [utils][TableGen] Treat clause aliases equally wit...
Krzysztof Parzyszek via All-commits
all-commits at lists.llvm.org
Thu Jun 5 07:05:38 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 463a2bd1596a6013344e112079be4ff717a5801a
https://github.com/llvm/llvm-project/commit/463a2bd1596a6013344e112079be4ff717a5801a
Author: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: 2025-06-05 (Thu, 05 Jun 2025)
Changed paths:
M llvm/test/TableGen/directive1.td
M llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
Log Message:
-----------
[utils][TableGen] Treat clause aliases equally with names (#141763)
The code in DirectiveEmitter that generates clause parsers sorted clause
names to ensure that longer names were tried before shorter ones, in
cases where a shorter name may be a prefix of a longer one. This matters
in the strict Fortran source format, since whitespace is ignored there.
This sorting did not take into account clause aliases, which are just
alternative names. These extra names were not protected in the same way,
and were just appended immediately after the primary name.
This patch generates a list of pairs Record+Name, where a given record
can appear multiple times with different names. Sort that list and use
it to generate parsers for each record. What used to be
```
("fred" || "f") >> construct<SomeClause>{} ||
"foo" << construct<OtherClause>{}
```
is now
```
"fred" >> construct<SomeClause>{} ||
"foo" >> construct<OtherClause>{} ||
"f" >> construct<SomeClause>{}
```
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