<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/Modules, branch main</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>Revert "Reland [MS][clang] Add support for vector deleting destructors" (#169116)</title>
<updated>2025-11-22T01:14:34+00:00</updated>
<author>
<name>Zequan Wu</name>
<email>zequanwu@google.com</email>
</author>
<published>2025-11-22T01:14:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54a4da9df6906b63878ad6d0ea6da3ed7d2d8432'/>
<id>54a4da9df6906b63878ad6d0ea6da3ed7d2d8432</id>
<content type='text'>
This reverts 4d10c1165442cbbbc0017b48fcdd7dae1ccf3678 and its two
dependent commits: e6b9805b574bb5c90263ec7fbcb94df76d2807a4 and
c243406a695ca056a07ef4064b0f9feee7685320, see discussion in
https://github.com/llvm/llvm-project/pull/165598#issuecomment-3563825509.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts 4d10c1165442cbbbc0017b48fcdd7dae1ccf3678 and its two
dependent commits: e6b9805b574bb5c90263ec7fbcb94df76d2807a4 and
c243406a695ca056a07ef4064b0f9feee7685320, see discussion in
https://github.com/llvm/llvm-project/pull/165598#issuecomment-3563825509.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][TypePrinter] Replace AppendScope with printNestedNameSpecifier (#168534)</title>
<updated>2025-11-21T10:31:35+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-11-21T10:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb1b82af395fe4a717c9b10948312e260b5ca666'/>
<id>bb1b82af395fe4a717c9b10948312e260b5ca666</id>
<content type='text'>
In debug-info we soon have the need to print names using the full scope
of the entity (see discussion in
https://github.com/llvm/llvm-project/pull/159592). Particularly, when a
structure is scoped inside a function, we'd like to emit the name as
`func()::foo`. `CGDebugInfo` uses the `TypePrinter` to print type names
into debug-info. However, `TypePrinter` stops (and ignores)
`DeclContext`s that are functions. I.e., it would just print `foo`.
Ideally it would behave the same way `printNestedNameSpecifier` does.
The FIXME in
https://github.com/llvm/llvm-project/blob/47c1aa4cef638c97b74f3afb7bed60e92bba1f90/clang/lib/AST/TypePrinter.cpp#L1520-L1521
motivated this patch.

See https://github.com/llvm/llvm-project/pull/168533 for how this will
be used by `CGDebugInfo`. The plan is to introduce a new
`PrintingPolicy` that prints anonymous entities using their full scope
(including function/anonymous scopes) and the mangling number.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In debug-info we soon have the need to print names using the full scope
of the entity (see discussion in
https://github.com/llvm/llvm-project/pull/159592). Particularly, when a
structure is scoped inside a function, we'd like to emit the name as
`func()::foo`. `CGDebugInfo` uses the `TypePrinter` to print type names
into debug-info. However, `TypePrinter` stops (and ignores)
`DeclContext`s that are functions. I.e., it would just print `foo`.
Ideally it would behave the same way `printNestedNameSpecifier` does.
The FIXME in
https://github.com/llvm/llvm-project/blob/47c1aa4cef638c97b74f3afb7bed60e92bba1f90/clang/lib/AST/TypePrinter.cpp#L1520-L1521
motivated this patch.

See https://github.com/llvm/llvm-project/pull/168533 for how this will
be used by `CGDebugInfo`. The plan is to introduce a new
`PrintingPolicy` that prints anonymous entities using their full scope
(including function/anonymous scopes) and the mangling number.</pre>
</div>
</content>
</entry>
<entry>
<title>[C++20] [Modules] Check TULocal entity within exported entities</title>
<updated>2025-11-21T05:57:41+00:00</updated>
<author>
<name>Chuanqi Xu</name>
<email>yedeng.yd@linux.alibaba.com</email>
</author>
<published>2025-11-21T05:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cc5185bd146bed96d0d9e23263a56b6965d8572f'/>
<id>cc5185bd146bed96d0d9e23263a56b6965d8572f</id>
<content type='text'>
See the attached test for example.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See the attached test for example.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reland [MS][clang] Add support for vector deleting destructors (#165598)</title>
<updated>2025-11-13T09:32:03+00:00</updated>
<author>
<name>Mariya Podchishchaeva</name>
<email>mariya.podchishchaeva@intel.com</email>
</author>
<published>2025-11-13T09:32:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d10c1165442cbbbc0017b48fcdd7dae1ccf3678'/>
<id>4d10c1165442cbbbc0017b48fcdd7dae1ccf3678</id>
<content type='text'>
MSVC supports an extension allowing to delete an array of objects via
pointer whose static type doesn't match its dynamic type. This is done
via generation of special destructors - vector deleting destructors.
MSVC's virtual tables always contain a pointer to the vector deleting
destructor for classes with virtual destructors, so not having this
extension implemented causes clang to generate code that is not
compatible with the code generated by MSVC, because clang always puts a
pointer to a scalar deleting destructor to the vtable. As a bonus the
deletion of an array of polymorphic object will work just like it does
with MSVC - no memory leaks and correct destructors are called.

This patch will cause clang to emit code that is compatible with code
produced by MSVC but not compatible with code produced with clang of
older versions, so the new behavior can be disabled via passing
-fclang-abi-compat=21 (or lower).

This is yet another attempt to land vector deleting destructors support
originally implemented by
https://github.com/llvm/llvm-project/pull/133451.

This PR contains fixes for issues reported in the original PR as well as
fixes for issues related to operator delete[] search reported in several
issues like

https://github.com/llvm/llvm-project/pull/133950#issuecomment-2787510484
https://github.com/llvm/llvm-project/issues/134265

Fixes https://github.com/llvm/llvm-project/issues/19772</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MSVC supports an extension allowing to delete an array of objects via
pointer whose static type doesn't match its dynamic type. This is done
via generation of special destructors - vector deleting destructors.
MSVC's virtual tables always contain a pointer to the vector deleting
destructor for classes with virtual destructors, so not having this
extension implemented causes clang to generate code that is not
compatible with the code generated by MSVC, because clang always puts a
pointer to a scalar deleting destructor to the vtable. As a bonus the
deletion of an array of polymorphic object will work just like it does
with MSVC - no memory leaks and correct destructors are called.

This patch will cause clang to emit code that is compatible with code
produced by MSVC but not compatible with code produced with clang of
older versions, so the new behavior can be disabled via passing
-fclang-abi-compat=21 (or lower).

This is yet another attempt to land vector deleting destructors support
originally implemented by
https://github.com/llvm/llvm-project/pull/133451.

This PR contains fixes for issues reported in the original PR as well as
fixes for issues related to operator delete[] search reported in several
issues like

https://github.com/llvm/llvm-project/pull/133950#issuecomment-2787510484
https://github.com/llvm/llvm-project/issues/134265

Fixes https://github.com/llvm/llvm-project/issues/19772</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] [Serialization] No transitive change for MacroID and PreprocessedEntityID (#166346)</title>
<updated>2025-11-13T01:45:52+00:00</updated>
<author>
<name>Chuanqi Xu</name>
<email>yedeng.yd@linux.alibaba.com</email>
</author>
<published>2025-11-13T01:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3cda32d5904118a0c8cd5afebc84365bf60c4262'/>
<id>3cda32d5904118a0c8cd5afebc84365bf60c4262</id>
<content type='text'>
Similar to previous no transitive changes to decls, types, identifiers
and source locations (
https://github.com/llvm/llvm-project/pull/92083
https://github.com/llvm/llvm-project/pull/92085
https://github.com/llvm/llvm-project/pull/92511
https://github.com/llvm/llvm-project/pull/86912
)

This patch does the same thing for MacroID and PreprocessedEntityID.

---

### Some background

Previously we record different IDs linearly. That is, when writing a
module, if we have 17 decls in imported modules, the ID of decls in the
module will start from 18. This makes the contents of the BMI changes if
the we add/remove any decls, types, identifiers and source locations in
the imported modules.

This makes it hard for us to reduce recompilations with modules. We want
to skip recompilations as we think the modules can help us to remove
fake dependencies. This can be done by split the ID into &lt;ModuleIndex,
LocalIndex&gt; pairs.
This is ALREADY done for several different ID above. We call it
non-casacading changes
(https://clang.llvm.org/docs/StandardCPlusPlusModules.html#experimental-non-cascading-changes).
Our internal users have already used this feature and it works well for
years.

Now we want to extend this to MacroID and PreprocessedEntityID. This is
helpful for us in the downstream as we allowed named modules to export
macros. But I believe this is also helpful for header-like modules if
you'd like to explore the area.

And also I think this is a nice cleanup too.

---

Given the use of MacroID and PreprocessedEntityID are not as complicated
as other IDs in the above series, I feel the patch itself should be
good. I hope the vendors can test the patch to make sure it won't affect
existing users.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to previous no transitive changes to decls, types, identifiers
and source locations (
https://github.com/llvm/llvm-project/pull/92083
https://github.com/llvm/llvm-project/pull/92085
https://github.com/llvm/llvm-project/pull/92511
https://github.com/llvm/llvm-project/pull/86912
)

This patch does the same thing for MacroID and PreprocessedEntityID.

---

### Some background

Previously we record different IDs linearly. That is, when writing a
module, if we have 17 decls in imported modules, the ID of decls in the
module will start from 18. This makes the contents of the BMI changes if
the we add/remove any decls, types, identifiers and source locations in
the imported modules.

This makes it hard for us to reduce recompilations with modules. We want
to skip recompilations as we think the modules can help us to remove
fake dependencies. This can be done by split the ID into &lt;ModuleIndex,
LocalIndex&gt; pairs.
This is ALREADY done for several different ID above. We call it
non-casacading changes
(https://clang.llvm.org/docs/StandardCPlusPlusModules.html#experimental-non-cascading-changes).
Our internal users have already used this feature and it works well for
years.

Now we want to extend this to MacroID and PreprocessedEntityID. This is
helpful for us in the downstream as we allowed named modules to export
macros. But I believe this is also helpful for header-like modules if
you'd like to explore the area.

And also I think this is a nice cleanup too.

---

Given the use of MacroID and PreprocessedEntityID are not as complicated
as other IDs in the above series, I feel the patch itself should be
good. I hope the vendors can test the patch to make sure it won't affect
existing users.</pre>
</div>
</content>
</entry>
<entry>
<title>[C++20] [Modules] Don't import initializer/pending implicit instantiations from other named module (#167468)</title>
<updated>2025-11-12T05:37:36+00:00</updated>
<author>
<name>Chuanqi Xu</name>
<email>yedeng.yd@linux.alibaba.com</email>
</author>
<published>2025-11-12T05:37:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ae2b303391c7d626475a1b25db91c1a8ffefbc5d'/>
<id>ae2b303391c7d626475a1b25db91c1a8ffefbc5d</id>
<content type='text'>
Close https://github.com/llvm/llvm-project/issues/166068

The cause of the problem is that we would import initializers and
pending implicit instantiations from other named module. This is very
bad and it may waste a lot of time.

And we didn't observe it as the weak symbols can live together and the
strong symbols would be removed by other mechanism. So we didn't observe
the bad behavior for a long time. But it indeeds waste compilation time.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close https://github.com/llvm/llvm-project/issues/166068

The cause of the problem is that we would import initializers and
pending implicit instantiations from other named module. This is very
bad and it may waste a lot of time.

And we didn't observe it as the weak symbols can live together and the
strong symbols would be removed by other mechanism. So we didn't observe
the bad behavior for a long time. But it indeeds waste compilation time.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] [C++20] [Modules] Test that we can avoid adding more specializations in reduced BMI</title>
<updated>2025-11-12T03:14:01+00:00</updated>
<author>
<name>Chuanqi Xu</name>
<email>yedeng.yd@linux.alibaba.com</email>
</author>
<published>2025-11-12T03:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=905ee4424d62f80a45f26ac03e29adf3bb7a6c85'/>
<id>905ee4424d62f80a45f26ac03e29adf3bb7a6c85</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][DependencyScanning] Implementation of `CompilerInstanceWithContext` to Improve By-Name Queries (#164345)</title>
<updated>2025-11-07T20:58:56+00:00</updated>
<author>
<name>Qiongsi Wu</name>
<email>qiongsiwu@gmail.com</email>
</author>
<published>2025-11-07T20:58:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=be0aa7b6c72bdb162f1f3fe251e469927118963e'/>
<id>be0aa7b6c72bdb162f1f3fe251e469927118963e</id>
<content type='text'>
This PR implements `CompilerInstanceWithContext` to improve by-name
dependency queries.

Cases exist where we query the dependency of different names, with
otherwise identical working directory and compile command line inputs.
In these cases, we can create one `CompilerInstance`, whose lifetime is
the same as the dependency scanning worker, and reuse the same compiler
instance to complete the queries. This way we reduce the amount of
header search we need to perform per query, since the already completed
header search results are cached in the compiler instance.

Using a microbenchmark on a prototype of this implementation, we are
seeing a scanning performance improvement of about 20%. The
microbenchmark scans a Swift file that imports everything importable.
When measuring against a set of internal project builds, the geo mean of
total build time improvement is around 1.02x to 1.04x depending on
whether the module caches are populated or not.

Part of work for rdar://136303612.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR implements `CompilerInstanceWithContext` to improve by-name
dependency queries.

Cases exist where we query the dependency of different names, with
otherwise identical working directory and compile command line inputs.
In these cases, we can create one `CompilerInstance`, whose lifetime is
the same as the dependency scanning worker, and reuse the same compiler
instance to complete the queries. This way we reduce the amount of
header search we need to perform per query, since the already completed
header search results are cached in the compiler instance.

Using a microbenchmark on a prototype of this implementation, we are
seeing a scanning performance improvement of about 20%. The
microbenchmark scans a Swift file that imports everything importable.
When measuring against a set of internal project builds, the geo mean of
total build time improvement is around 1.02x to 1.04x depending on
whether the module caches are populated or not.

Part of work for rdar://136303612.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][modules] Fix crash in enum visibility lookup for C++20 header units (#166272)</title>
<updated>2025-11-04T01:54:56+00:00</updated>
<author>
<name>Naveen Seth Hanig</name>
<email>naveen.hanig@outlook.com</email>
</author>
<published>2025-11-04T01:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bc08e69959ecefecc7ea41b648a659aa19c458c8'/>
<id>bc08e69959ecefecc7ea41b648a659aa19c458c8</id>
<content type='text'>
Fixes #165445.

Fixes a crash when `ASTWriter::GenerateNameLookupTable` processes enum
constants from C++20 header units.

The special handling for enum constants, introduced in fccc6ee, doesn't
account for declarations whose owning module is a C++20 header unit. It
calls `isNamedModule()` on the result of
`getTopLevelOwningNamedModule()`, which returns null for header units,
causing a null pointer dereference.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #165445.

Fixes a crash when `ASTWriter::GenerateNameLookupTable` processes enum
constants from C++20 header units.

The special handling for enum constants, introduced in fccc6ee, doesn't
account for declarations whose owning module is a C++20 header unit. It
calls `isNamedModule()` on the result of
`getTopLevelOwningNamedModule()`, which returns null for header units,
causing a null pointer dereference.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][builtins] Add stdckdint.h to the modulemap. (#166230)</title>
<updated>2025-11-03T21:12:55+00:00</updated>
<author>
<name>Michael Spencer</name>
<email>bigcheesegs@gmail.com</email>
</author>
<published>2025-11-03T21:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ff31be2f2c181d81bbafa927e6aca117fd68330'/>
<id>9ff31be2f2c181d81bbafa927e6aca117fd68330</id>
<content type='text'>
All builtin Clang headers need to be covered by the modulemap.

This fixes https://github.com/llvm/llvm-project/issues/166173</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All builtin Clang headers need to be covered by the modulemap.

This fixes https://github.com/llvm/llvm-project/issues/166173</pre>
</div>
</content>
</entry>
</feed>
