<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[TableGen] Use `contains` instead of `count`. NFC. (#143156)</title>
<updated>2025-06-07T08:31:42+00:00</updated>
<author>
<name>Jay Foad</name>
<email>jay.foad@amd.com</email>
</author>
<published>2025-06-07T08:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb9dcb27df133dd3788e7dfcd2bf31382673a2bc'/>
<id>bb9dcb27df133dd3788e7dfcd2bf31382673a2bc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Handle versions on clause/directive spellings (#143021)</title>
<updated>2025-06-06T22:07:25+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-06-06T22:07:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7b2aa02a33df2ffd59fa1c043c10ec05dc411171'/>
<id>7b2aa02a33df2ffd59fa1c043c10ec05dc411171</id>
<content type='text'>
In "get&lt;lang&gt;DirectiveName(Kind, Version)", return the spelling that
corresponds to Version, and in "get&lt;lang&gt;DirectiveKindAndVersions(Name)"
return the pair {Kind, VersionRange}, where VersionRange contains the
minimum and the maximum versions that allow "Name" as a spelling. This
applies to clauses as well. In general it applies to classes that have
spellings (defined via TableGen class "Spelling").

Given a Kind and a Version, getting the corresponding spelling requires
a runtime search (which can fail in a general case). To avoid generating
the search function inline, a small additional component of
llvm/Frontent was added: LLVMFrontendDirective. The corresponding header
file also defines C++ classes "Spelling" and "VersionRange", which are
used in TableGen/DirectiveEmitter as well.

For background information see

https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In "get&lt;lang&gt;DirectiveName(Kind, Version)", return the spelling that
corresponds to Version, and in "get&lt;lang&gt;DirectiveKindAndVersions(Name)"
return the pair {Kind, VersionRange}, where VersionRange contains the
minimum and the maximum versions that allow "Name" as a spelling. This
applies to clauses as well. In general it applies to classes that have
spellings (defined via TableGen class "Spelling").

Given a Kind and a Version, getting the corresponding spelling requires
a runtime search (which can fail in a general case). To avoid generating
the search function inline, a small additional component of
llvm/Frontent was added: LLVMFrontendDirective. The corresponding header
file also defines C++ classes "Spelling" and "VersionRange", which are
used in TableGen/DirectiveEmitter as well.

For background information see

https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Implement clause aliases as alternative spellings (#141765)</title>
<updated>2025-06-05T17:35:30+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-06-05T17:35:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4dcc159485e6b1ece15982dfe17656c8f9f11779'/>
<id>4dcc159485e6b1ece15982dfe17656c8f9f11779</id>
<content type='text'>
Use the spellings in the generated clause parser. The functions
`get&lt;lang&gt;ClauseKind` and `get&lt;lang&gt;ClauseName` are not yet updated.

The definitions of both clauses and directives now take a list of
"Spelling"s instead of a single string. For example
```
def ACCC_Copyin : Clause&lt;[Spelling&lt;"copyin"&gt;,
                          Spelling&lt;"present_or_copyin"&gt;,
                          Spelling&lt;"pcopyin"&gt;]&gt; { ... }
```

A "Spelling" is a versioned string, defaulting to "all versions".

For background information see

https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the spellings in the generated clause parser. The functions
`get&lt;lang&gt;ClauseKind` and `get&lt;lang&gt;ClauseName` are not yet updated.

The definitions of both clauses and directives now take a list of
"Spelling"s instead of a single string. For example
```
def ACCC_Copyin : Clause&lt;[Spelling&lt;"copyin"&gt;,
                          Spelling&lt;"present_or_copyin"&gt;,
                          Spelling&lt;"pcopyin"&gt;]&gt; { ... }
```

A "Spelling" is a versioned string, defaulting to "all versions".

For background information see

https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Treat clause aliases equally with names (#141763)</title>
<updated>2025-06-05T14:05:16+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-06-05T14:05:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=463a2bd1596a6013344e112079be4ff717a5801a'/>
<id>463a2bd1596a6013344e112079be4ff717a5801a</id>
<content type='text'>
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") &gt;&gt; construct&lt;SomeClause&gt;{} ||
  "foo" &lt;&lt; construct&lt;OtherClause&gt;{}
```
is now
```
  "fred" &gt;&gt; construct&lt;SomeClause&gt;{} ||
  "foo" &gt;&gt; construct&lt;OtherClause&gt;{} ||
  "f" &gt;&gt; construct&lt;SomeClause&gt;{}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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") &gt;&gt; construct&lt;SomeClause&gt;{} ||
  "foo" &lt;&lt; construct&lt;OtherClause&gt;{}
```
is now
```
  "fred" &gt;&gt; construct&lt;SomeClause&gt;{} ||
  "foo" &gt;&gt; construct&lt;OtherClause&gt;{} ||
  "f" &gt;&gt; construct&lt;SomeClause&gt;{}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Unify converting names to upper-camel case (#141762)</title>
<updated>2025-06-05T12:34:28+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-06-05T12:34:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2b3e07f4852dc4e9c3dbea89c138cfe902e30953'/>
<id>2b3e07f4852dc4e9c3dbea89c138cfe902e30953</id>
<content type='text'>
There were 3 different functions in DirectiveEmitter.cpp doing
essentially the same thing: taking a name separated with _ or whitepace,
and converting it to the upper-camel case. Extract that into a single
function that can handle different sets of separators.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were 3 different functions in DirectiveEmitter.cpp doing
essentially the same thing: taking a name separated with _ or whitepace,
and converting it to the upper-camel case. Extract that into a single
function that can handle different sets of separators.</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Clarify usage of ClauseVal, rename to EnumVal (#141761)</title>
<updated>2025-06-04T13:16:21+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-06-04T13:16:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=57500cd6a013a1e438878b04cd4530673ab5533e'/>
<id>57500cd6a013a1e438878b04cd4530673ab5533e</id>
<content type='text'>
The class "ClauseVal" actually represents a definition of an enumeration
value, and in itself it is not bound to any clause. Rename it to EnumVal
and add a comment clarifying how it's translated into an actual enum
definition in the generated source code.

There is no change in functionality.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The class "ClauseVal" actually represents a definition of an enumeration
value, and in itself it is not bound to any clause. Rename it to EnumVal
and add a comment clarifying how it's translated into an actual enum
definition in the generated source code.

There is no change in functionality.</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Clean up code in DirectiveEmitter (#140772)</title>
<updated>2025-05-21T12:35:05+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-05-21T12:35:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=70f9a8163fb984b0f62741a2bcab9686220ee07d'/>
<id>70f9a8163fb984b0f62741a2bcab9686220ee07d</id>
<content type='text'>
Remove most redundant function calls. Unify enum identifier name
generation (via getIdentifierName), and namespace qualification (via
getQualifier).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove most redundant function calls. Unify enum identifier name
generation (via getIdentifierName), and namespace qualification (via
getQualifier).</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Unify name qualifications in DirectiveEmitter (#140606)</title>
<updated>2025-05-20T12:56:59+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-05-20T12:56:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46ab684bddc812771226e53010642f3c846efe92'/>
<id>46ab684bddc812771226e53010642f3c846efe92</id>
<content type='text'>
Remove extraneous qualifications from names when
- the name is explicitly enclosed by corresponding namespaces, and
- the name is in a body of a function defined in corresponding
namespaces. Otherwise add missing qualifications.

This applies to individual sections of TableGen output, and makes name
lookup independent of the context in which these sections are included.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove extraneous qualifications from names when
- the name is explicitly enclosed by corresponding namespaces, and
- the name is in a body of a function defined in corresponding
namespaces. Otherwise add missing qualifications.

This applies to individual sections of TableGen output, and makes name
lookup independent of the context in which these sections are included.</pre>
</div>
</content>
</entry>
<entry>
<title>[utils][TableGen] Remove unused parameter in DirectiveEmitter, NFC (#140605)</title>
<updated>2025-05-20T12:56:39+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-05-20T12:56:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=90539473ec66d023daf333d153e2b9d80cfaf6b9'/>
<id>90539473ec66d023daf333d153e2b9d80cfaf6b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][OpenMP] Add "SourceLanguages" property to Directive (#139960)</title>
<updated>2025-05-15T12:36:53+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>Krzysztof.Parzyszek@amd.com</email>
</author>
<published>2025-05-15T12:36:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8e2ac7d6194451cbe2b7203212f2bb4f278e6438'/>
<id>8e2ac7d6194451cbe2b7203212f2bb4f278e6438</id>
<content type='text'>
The official languages that OpenMP recognizes are C/C++ and Fortran.
Some OpenMP directives are language-specific, some are C/C++-only, some
are Fortran-only.

Add a property to the TableGen definition of Directive that will be the
list of languages that allow the directive.

The TableGen backend will then generate a bitmask-like enumeration
SourceLanguages, and a function
  SourceLanguages getDirectiveLanguages(Directive D);</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The official languages that OpenMP recognizes are C/C++ and Fortran.
Some OpenMP directives are language-specific, some are C/C++-only, some
are Fortran-only.

Add a property to the TableGen definition of Directive that will be the
list of languages that allow the directive.

The TableGen backend will then generate a bitmask-like enumeration
SourceLanguages, and a function
  SourceLanguages getDirectiveLanguages(Directive D);</pre>
</div>
</content>
</entry>
</feed>
