diff options
author | Krzysztof Parzyszek <Krzysztof.Parzyszek@amd.com> | 2025-06-05 09:05:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-05 09:05:16 -0500 |
commit | 463a2bd1596a6013344e112079be4ff717a5801a (patch) | |
tree | a17188a8012239524c85b10b7fbc062078425b9c /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | a91b0d27806226d52db90a4fe83bb73a95f412f4 (diff) | |
download | llvm-463a2bd1596a6013344e112079be4ff717a5801a.zip llvm-463a2bd1596a6013344e112079be4ff717a5801a.tar.gz llvm-463a2bd1596a6013344e112079be4ff717a5801a.tar.bz2 |
[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>{}
```
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions