<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/Lex/ModuleMap.cpp, 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>[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>
<entry>
<title>[C2y] Add stdcountof.h (#140890)</title>
<updated>2025-05-28T10:41:01+00:00</updated>
<author>
<name>Aaron Ballman</name>
<email>aaron@aaronballman.com</email>
</author>
<published>2025-05-28T10:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ab944a8c6a213beb96f3747a441b02e497732e4'/>
<id>5ab944a8c6a213beb96f3747a441b02e497732e4</id>
<content type='text'>
WG14 N3469 changed _Lengthof to _Countof but it also introduced the
&lt;stdcountof.h&gt; header to expose a macro with a non-ugly identifier. GCC
vends this header as part of the compiler implementation, so Clang
should do the same.

Suggested-by: Alejandro Colomar &lt;alx@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
WG14 N3469 changed _Lengthof to _Countof but it also introduced the
&lt;stdcountof.h&gt; header to expose a macro with a non-ugly identifier. GCC
vends this header as part of the compiler implementation, so Clang
should do the same.

Suggested-by: Alejandro Colomar &lt;alx@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Lex] Remove unused includes (NFC) (#141523)</title>
<updated>2025-05-26T21:57:05+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-26T21:57:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=36d57677bbbcc4f32e7aa16b73ca22fcae13a3aa'/>
<id>36d57677bbbcc4f32e7aa16b73ca22fcae13a3aa</id>
<content type='text'>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Modules] Don't fail when an unused textual header is missing. (#138227)"</title>
<updated>2025-05-23T01:34:30+00:00</updated>
<author>
<name>Volodymyr Sapsai</name>
<email>vsapsai@apple.com</email>
</author>
<published>2025-05-23T01:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=720014f70841f0284d21ef8100c406d6c864ac9c'/>
<id>720014f70841f0284d21ef8100c406d6c864ac9c</id>
<content type='text'>
This reverts commit 64bb60a471a5ddc9c9bec413c65fdab730a1e4b0.

Revert to give more time affected parties to adjust to the change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 64bb60a471a5ddc9c9bec413c65fdab730a1e4b0.

Revert to give more time affected parties to adjust to the change.
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Use llvm::stable_sort (NFC) (#140413)</title>
<updated>2025-05-18T00:02:45+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-18T00:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6290cc33e9a6541ccb4711991247a77e0a5b9412'/>
<id>6290cc33e9a6541ccb4711991247a77e0a5b9412</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Modules] Don't fail when an unused textual header is missing. (#138227)</title>
<updated>2025-05-08T16:07:33+00:00</updated>
<author>
<name>Volodymyr Sapsai</name>
<email>vsapsai@apple.com</email>
</author>
<published>2025-05-08T16:07:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=64bb60a471a5ddc9c9bec413c65fdab730a1e4b0'/>
<id>64bb60a471a5ddc9c9bec413c65fdab730a1e4b0</id>
<content type='text'>
According to the documentation
&gt; A header declaration that does not contain `exclude` nor `textual`
specifies a header that contributes to the enclosing module.

Which means that `exclude` and `textual` header don't contribute to the
enclosing module and their presence isn't required to build such a
module. The keywords tell clang how a header should be treated in a
context of the module but they don't add headers to the module.

When a textual header *is* used, clang still emits "file not found"
error pointing to the location where the missing file is included.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the documentation
&gt; A header declaration that does not contain `exclude` nor `textual`
specifies a header that contributes to the enclosing module.

Which means that `exclude` and `textual` header don't contribute to the
enclosing module and their presence isn't required to build such a
module. The keywords tell clang how a header should be treated in a
context of the module but they don't add headers to the module.

When a textual header *is* used, clang still emits "file not found"
error pointing to the location where the missing file is included.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][modules] Lazily load by name lookups in module maps (#132853)</title>
<updated>2025-05-06T23:40:01+00:00</updated>
<author>
<name>Michael Spencer</name>
<email>bigcheesegs@gmail.com</email>
</author>
<published>2025-05-06T23:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=32fb8c5f5fdeb20de28846e2fe9e2c7525f62086'/>
<id>32fb8c5f5fdeb20de28846e2fe9e2c7525f62086</id>
<content type='text'>
Instead of eagerly populating the `clang::ModuleMap` when looking up a
module by name, this patch changes `HeaderSearch` to only load the
modules that are actually used.

This introduces `ModuleMap::findOrLoadModule` which will load modules
from parsed but not loaded module maps. This cannot be used anywhere
that the module loading code calls into as it can create infinite
recursion.

This currently just reparses module maps when looking up a module by
header. This is fine as redeclarations are allowed from the same file,
but future patches will also make looking up a module by header lazy.

This patch changes the shadow.m test to use explicitly built modules and
`#import`. This test and the shadow feature are very brittle and do not
work in general. The test relied on pcm files being left behind by prior
failing clang invocations that were then reused by the last invocation.
If you clean the cache then the last invocation will always fail. This
is because the input module map and the `-fmodule-map-file=` module map
are parsed in the same module scope, and `-fmodule-map-file=` is
forwarded to implicit module builds. That means you are guaranteed to
hit a module redeclaration error if the TU actually imports the module
it is trying to shadow.

This patch changes when we load A2's module map to after the `A` module
has been loaded, which sets the `IsFromModuleFile` bit on `A`. This
means that A2's `A` is skipped entirely instead of creating a shadow
module, and we get textual inclusion. It is possible to construct a case
where this would happen before this patch too.

An upcoming patch in this series will rework shadowing to work in the
general case, but that's only possible once header -&gt; module lookup is
lazy too.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of eagerly populating the `clang::ModuleMap` when looking up a
module by name, this patch changes `HeaderSearch` to only load the
modules that are actually used.

This introduces `ModuleMap::findOrLoadModule` which will load modules
from parsed but not loaded module maps. This cannot be used anywhere
that the module loading code calls into as it can create infinite
recursion.

This currently just reparses module maps when looking up a module by
header. This is fine as redeclarations are allowed from the same file,
but future patches will also make looking up a module by header lazy.

This patch changes the shadow.m test to use explicitly built modules and
`#import`. This test and the shadow feature are very brittle and do not
work in general. The test relied on pcm files being left behind by prior
failing clang invocations that were then reused by the last invocation.
If you clean the cache then the last invocation will always fail. This
is because the input module map and the `-fmodule-map-file=` module map
are parsed in the same module scope, and `-fmodule-map-file=` is
forwarded to implicit module builds. That means you are guaranteed to
hit a module redeclaration error if the TU actually imports the module
it is trying to shadow.

This patch changes when we load A2's module map to after the `A` module
has been loaded, which sets the `IsFromModuleFile` bit on `A`. This
means that A2's `A` is skipped entirely instead of creating a shadow
module, and we get textual inclusion. It is possible to construct a case
where this would happen before this patch too.

An upcoming patch in this series will rework shadowing to work in the
general case, but that's only possible once header -&gt; module lookup is
lazy too.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang][NFC] Use std::move to avoid copy (#138073)</title>
<updated>2025-05-01T19:06:49+00:00</updated>
<author>
<name>Shafik Yaghmour</name>
<email>shafik.yaghmour@intel.com</email>
</author>
<published>2025-05-01T19:06:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d7f98a4ef9992936a92c2a71fec743ea6f3493d0'/>
<id>d7f98a4ef9992936a92c2a71fec743ea6f3493d0</id>
<content type='text'>
Static analysis flagged this code for using copy when we could use
std::move.

Worth noting that CD.Message is a StringRef but Conflict.Message is
std::string. Otherwise I would have used a temporary in place and avoid
a local variable.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Static analysis flagged this code for using copy when we could use
std::move.

Worth noting that CD.Message is a StringRef but Conflict.Message is
std::string. Otherwise I would have used a temporary in place and avoid
a local variable.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang][NFC] Use const auto &amp; to avoid copy (#138069)</title>
<updated>2025-05-01T16:52:09+00:00</updated>
<author>
<name>Shafik Yaghmour</name>
<email>shafik.yaghmour@intel.com</email>
</author>
<published>2025-05-01T16:52:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=acc40ed0a747ad8f5dbb93788da7ce104c36c0a3'/>
<id>acc40ed0a747ad8f5dbb93788da7ce104c36c0a3</id>
<content type='text'>
Static analysis flagged this code as causing a copy when we never modify
ModName and therefore we can use const auto &amp; and avoid copying.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Static analysis flagged this code as causing a copy when we never modify
ModName and therefore we can use const auto &amp; and avoid copying.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Consistently use "load" to refer to populating clang::ModuleMap (#132970)</title>
<updated>2025-03-25T19:32:58+00:00</updated>
<author>
<name>Michael Spencer</name>
<email>bigcheesegs@gmail.com</email>
</author>
<published>2025-03-25T19:32:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=57f2e76e3010e7b089ebc5dd96aef5966f13b6c5'/>
<id>57f2e76e3010e7b089ebc5dd96aef5966f13b6c5</id>
<content type='text'>
Now that we have ModuleMapFile.cpp which parses module maps, it's
confusing what ModuleMap::parseModuleMapFile actually does. HeaderSearch
already called this loading a module map, so consistently use that term
in ModuleMap too.

An upcoming patch will allow just parsing a module map without loading
the modules from it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have ModuleMapFile.cpp which parses module maps, it's
confusing what ModuleMap::parseModuleMapFile actually does. HeaderSearch
already called this loading a module map, so consistently use that term
in ModuleMap too.

An upcoming patch will allow just parsing a module map without loading
the modules from it.</pre>
</div>
</content>
</entry>
</feed>
