<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/unittests/AST/ASTImporterTest.cpp, branch users/mingmingl-llvm/samplefdo-profile-format</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>[clang] NFC: change more places to use Type::getAsTagDecl and friends (#155313)</title>
<updated>2025-08-25T23:18:56+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-08-25T23:18:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dc8596d5485a52abee2967cec72f81ef4872270c'/>
<id>dc8596d5485a52abee2967cec72f81ef4872270c</id>
<content type='text'>
This changes a bunch of places which use getAs&lt;TagType&gt;, including
derived types, just to obtain the tag definition.

This is preparation for #155028, offloading all the changes that PR used
to introduce which don't depend on any new helpers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes a bunch of places which use getAs&lt;TagType&gt;, including
derived types, just to obtain the tag definition.

This is preparation for #155028, offloading all the changes that PR used
to introduce which don't depend on any new helpers.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Improve nested name specifier AST representation (#147835)</title>
<updated>2025-08-09T08:06:53+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-08-09T08:06:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=91cdd35008e9ab32dffb7e401cdd7313b3461892'/>
<id>91cdd35008e9ab32dffb7e401cdd7313b3461892</id>
<content type='text'>
This is a major change on how we represent nested name qualifications in
the AST.

* The nested name specifier itself and how it's stored is changed. The
prefixes for types are handled within the type hierarchy, which makes
canonicalization for them super cheap, no memory allocation required.
Also translating a type into nested name specifier form becomes a no-op.
An identifier is stored as a DependentNameType. The nested name
specifier gains a lightweight handle class, to be used instead of
passing around pointers, which is similar to what is implemented for
TemplateName. There is still one free bit available, and this handle can
be used within a PointerUnion and PointerIntPair, which should keep
bit-packing aficionados happy.
* The ElaboratedType node is removed, all type nodes in which it could
previously apply to can now store the elaborated keyword and name
qualifier, tail allocating when present.
* TagTypes can now point to the exact declaration found when producing
these, as opposed to the previous situation of there only existing one
TagType per entity. This increases the amount of type sugar retained,
and can have several applications, for example in tracking module
ownership, and other tools which care about source file origins, such as
IWYU. These TagTypes are lazily allocated, in order to limit the
increase in AST size.

This patch offers a great performance benefit.

It greatly improves compilation time for
[stdexec](https://github.com/NVIDIA/stdexec). For one datapoint, for
`test_on2.cpp` in that project, which is the slowest compiling test,
this patch improves `-c` compilation time by about 7.2%, with the
`-fsyntax-only` improvement being at ~12%.

This has great results on compile-time-tracker as well:

![image](https://github.com/user-attachments/assets/700dce98-2cab-4aa8-97d1-b038c0bee831)

This patch also further enables other optimziations in the future, and
will reduce the performance impact of template specialization resugaring
when that lands.

It has some other miscelaneous drive-by fixes.

About the review: Yes the patch is huge, sorry about that. Part of the
reason is that I started by the nested name specifier part, before the
ElaboratedType part, but that had a huge performance downside, as
ElaboratedType is a big performance hog. I didn't have the steam to go
back and change the patch after the fact.

There is also a lot of internal API changes, and it made sense to remove
ElaboratedType in one go, versus removing it from one type at a time, as
that would present much more churn to the users. Also, the nested name
specifier having a different API avoids missing changes related to how
prefixes work now, which could make existing code compile but not work.

How to review: The important changes are all in
`clang/include/clang/AST` and `clang/lib/AST`, with also important
changes in `clang/lib/Sema/TreeTransform.h`.

The rest and bulk of the changes are mostly consequences of the changes
in API.

PS: TagType::getDecl is renamed to `getOriginalDecl` in this patch, just
for easier to rebasing. I plan to rename it back after this lands.

Fixes #136624
Fixes https://github.com/llvm/llvm-project/issues/43179
Fixes https://github.com/llvm/llvm-project/issues/68670
Fixes https://github.com/llvm/llvm-project/issues/92757</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a major change on how we represent nested name qualifications in
the AST.

* The nested name specifier itself and how it's stored is changed. The
prefixes for types are handled within the type hierarchy, which makes
canonicalization for them super cheap, no memory allocation required.
Also translating a type into nested name specifier form becomes a no-op.
An identifier is stored as a DependentNameType. The nested name
specifier gains a lightweight handle class, to be used instead of
passing around pointers, which is similar to what is implemented for
TemplateName. There is still one free bit available, and this handle can
be used within a PointerUnion and PointerIntPair, which should keep
bit-packing aficionados happy.
* The ElaboratedType node is removed, all type nodes in which it could
previously apply to can now store the elaborated keyword and name
qualifier, tail allocating when present.
* TagTypes can now point to the exact declaration found when producing
these, as opposed to the previous situation of there only existing one
TagType per entity. This increases the amount of type sugar retained,
and can have several applications, for example in tracking module
ownership, and other tools which care about source file origins, such as
IWYU. These TagTypes are lazily allocated, in order to limit the
increase in AST size.

This patch offers a great performance benefit.

It greatly improves compilation time for
[stdexec](https://github.com/NVIDIA/stdexec). For one datapoint, for
`test_on2.cpp` in that project, which is the slowest compiling test,
this patch improves `-c` compilation time by about 7.2%, with the
`-fsyntax-only` improvement being at ~12%.

This has great results on compile-time-tracker as well:

![image](https://github.com/user-attachments/assets/700dce98-2cab-4aa8-97d1-b038c0bee831)

This patch also further enables other optimziations in the future, and
will reduce the performance impact of template specialization resugaring
when that lands.

It has some other miscelaneous drive-by fixes.

About the review: Yes the patch is huge, sorry about that. Part of the
reason is that I started by the nested name specifier part, before the
ElaboratedType part, but that had a huge performance downside, as
ElaboratedType is a big performance hog. I didn't have the steam to go
back and change the patch after the fact.

There is also a lot of internal API changes, and it made sense to remove
ElaboratedType in one go, versus removing it from one type at a time, as
that would present much more churn to the users. Also, the nested name
specifier having a different API avoids missing changes related to how
prefixes work now, which could make existing code compile but not work.

How to review: The important changes are all in
`clang/include/clang/AST` and `clang/lib/AST`, with also important
changes in `clang/lib/Sema/TreeTransform.h`.

The rest and bulk of the changes are mostly consequences of the changes
in API.

PS: TagType::getDecl is renamed to `getOriginalDecl` in this patch, just
for easier to rebasing. I plan to rename it back after this lands.

Fixes #136624
Fixes https://github.com/llvm/llvm-project/issues/43179
Fixes https://github.com/llvm/llvm-project/issues/68670
Fixes https://github.com/llvm/llvm-project/issues/92757</pre>
</div>
</content>
</entry>
<entry>
<title>NFC: Clean up of IntrusiveRefCntPtr construction from raw pointers. (#151782)</title>
<updated>2025-08-02T02:23:30+00:00</updated>
<author>
<name>James Y Knight</name>
<email>jyknight@google.com</email>
</author>
<published>2025-08-02T02:23:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4205da0f130cf86ae6b89bfc36723e7ddba9b0b7'/>
<id>4205da0f130cf86ae6b89bfc36723e7ddba9b0b7</id>
<content type='text'>
This commit handles the following types:
- clang::ExternalASTSource
- clang::TargetInfo
- clang::ASTContext
- clang::SourceManager
- clang::FileManager

Part of cleanup #151026</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit handles the following types:
- clang::ExternalASTSource
- clang::TargetInfo
- clang::ASTContext
- clang::SourceManager
- clang::FileManager

Part of cleanup #151026</pre>
</div>
</content>
</entry>
<entry>
<title>Ast importer visitors (#138838)</title>
<updated>2025-07-09T18:12:31+00:00</updated>
<author>
<name>ganenkokb-yandex</name>
<email>160136233+ganenkokb-yandex@users.noreply.github.com</email>
</author>
<published>2025-07-09T18:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a57aaedc35a39bd1f573929d5c2cb56fd1cccab4'/>
<id>a57aaedc35a39bd1f573929d5c2cb56fd1cccab4</id>
<content type='text'>
I've rebased commit from
[Evianaive](https://github.com/Evianaive/llvm-project/commits?author=Evianaive)
and compiled it.
I hope it will speed up fix for #129393.

---------

Co-authored-by: Evianaive &lt;153540933@qq.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I've rebased commit from
[Evianaive](https://github.com/Evianaive/llvm-project/commits?author=Evianaive)
and compiled it.
I hope it will speed up fix for #129393.

---------

Co-authored-by: Evianaive &lt;153540933@qq.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Thread Safety Analysis: Support reentrant capabilities (#137133)</title>
<updated>2025-05-26T15:03:55+00:00</updated>
<author>
<name>Marco Elver</name>
<email>elver@google.com</email>
</author>
<published>2025-05-26T15:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c7ccfc6dfc1c2d0ca9cf5615f9f95bb7ad78b1c9'/>
<id>c7ccfc6dfc1c2d0ca9cf5615f9f95bb7ad78b1c9</id>
<content type='text'>
Introduce the `reentrant_capability` attribute, which may be specified
alongside the `capability(..)` attribute to denote that the defined
capability type is reentrant. Marking a capability as reentrant means
that acquiring the same capability multiple times is safe, and does not
produce warnings on attempted re-acquisition.

The most significant changes required are plumbing to propagate if the
attribute is present to a CapabilityExpr, and introducing
ReentrancyDepth to the LockableFactEntry class.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce the `reentrant_capability` attribute, which may be specified
alongside the `capability(..)` attribute to denote that the defined
capability type is reentrant. Marking a capability as reentrant means
that acquiring the same capability multiple times is safe, and does not
produce warnings on attempted re-acquisition.

The most significant changes required are plumbing to propagate if the
attribute is present to a CapabilityExpr, and introducing
ReentrancyDepth to the LockableFactEntry class.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Save ShuffleVectorExpr args as ConstantExpr (#139709)</title>
<updated>2025-05-14T14:13:01+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-05-14T14:13:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ca8248a9173e7756fbeb7ec3562332639d36423'/>
<id>9ca8248a9173e7756fbeb7ec3562332639d36423</id>
<content type='text'>
The passed indices have to be constant integers anyway, which we verify
before creating the ShuffleVectorExpr. Use the value we create there and
save the indices using a ConstantExpr instead. This way, we don't have
to evaluate the args every time we call getShuffleMaskIdx().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The passed indices have to be constant integers anyway, which we verify
before creating the ShuffleVectorExpr. Use the value we create there and
save the indices using a ConstantExpr instead. This way, we don't have
to evaluate the args every time we call getShuffleMaskIdx().</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][ASTImporter] Fix AST import if anonymous namespaces are merged (#128735)</title>
<updated>2025-05-06T08:17:26+00:00</updated>
<author>
<name>Balázs Kéri</name>
<email>balazs.keri@ericsson.com</email>
</author>
<published>2025-05-06T08:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b30b3f901b00da1bd1f70e9ca9086e349c7cca0'/>
<id>4b30b3f901b00da1bd1f70e9ca9086e349c7cca0</id>
<content type='text'>
Fix of a faulty case that is shown in the second of the added
tests (an anonymous namespace is imported that resides in a `extern "C"`
block).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix of a faulty case that is shown in the second of the added
tests (an anonymous namespace is imported that resides in a `extern "C"`
block).</pre>
</div>
</content>
</entry>
<entry>
<title>Merge similar Clang Thread Safety attributes (#135561)</title>
<updated>2025-04-15T21:21:34+00:00</updated>
<author>
<name>Aaron Puchert</name>
<email>aaronpuchert@alice-dsl.net</email>
</author>
<published>2025-04-15T21:21:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9c73eba8aa17cb7ca4248ab1c7f67ea7ec9b50b1'/>
<id>9c73eba8aa17cb7ca4248ab1c7f67ea7ec9b50b1</id>
<content type='text'>
Some of the old lock-based and new capability-based spellings behave
basically in the same way, so merging them simplifies the code
significantly.

There are two minor functional changes: we only warn (instead of an
error) when the try_acquire_capability attribute is used on something
else than a function. The alternative would have been to produce an
error for the old spelling, but we seem to only warn for all function
attributes, so this is arguably more consistent.

The second change is that we also check the first argument (which is the
value returned for a successful try-acquire) for `this`. But from what I
can tell, this code is defunct anyway at the moment (see #31414).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of the old lock-based and new capability-based spellings behave
basically in the same way, so merging them simplifies the code
significantly.

There are two minor functional changes: we only warn (instead of an
error) when the try_acquire_capability attribute is used on something
else than a function. The alternative would have been to produce an
error for the old spelling, but we seem to only warn for all function
attributes, so this is arguably more consistent.

The second change is that we also check the first argument (which is the
value returned for a successful try-acquire) for `this`. But from what I
can tell, this code is defunct anyway at the moment (see #31414).</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] NFC: introduce UnsignedOrNone as a replacement for std::optional&lt;unsigned&gt; (#134142)</title>
<updated>2025-04-03T17:27:18+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-04-03T17:27:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cfee056b4e75cd941591d298e0f8dc303460c57e'/>
<id>cfee056b4e75cd941591d298e0f8dc303460c57e</id>
<content type='text'>
This introduces a new class 'UnsignedOrNone', which models a lite
version of `std::optional&lt;unsigned&gt;`, but has the same size as
'unsigned'.

This replaces most uses of `std::optional&lt;unsigned&gt;`, and similar
schemes utilizing 'int' and '-1' as sentinel.

Besides the smaller size advantage, this is simpler to serialize, as its
internal representation is a single unsigned int as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This introduces a new class 'UnsignedOrNone', which models a lite
version of `std::optional&lt;unsigned&gt;`, but has the same size as
'unsigned'.

This replaces most uses of `std::optional&lt;unsigned&gt;`, and similar
schemes utilizing 'int' and '-1' as sentinel.

Besides the smaller size advantage, this is simpler to serialize, as its
internal representation is a single unsigned int as well.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Add tracking source deduction guide for the explicitly-written</title>
<updated>2025-02-02T22:06:25+00:00</updated>
<author>
<name>Haojian Wu</name>
<email>hokein.wu@gmail.com</email>
</author>
<published>2025-02-02T22:06:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da2b415b19d178d6b250bb6468ed4a207860adf7'/>
<id>da2b415b19d178d6b250bb6468ed4a207860adf7</id>
<content type='text'>
deduction guide.

We miss this case in the original f94c481543bdd3b11a668ad78d46593cf974788f commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
deduction guide.

We miss this case in the original f94c481543bdd3b11a668ad78d46593cf974788f commit.
</pre>
</div>
</content>
</entry>
</feed>
