<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/Frontend/TestModuleFileExtension.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][NFC] Inline Frontend/FrontendDiagnostic.h -&gt; Basic/DiagnosticFrontend.h (#162883)</title>
<updated>2025-11-21T03:39:49+00:00</updated>
<author>
<name>Jordan Rupprecht</name>
<email>rupprecht@google.com</email>
</author>
<published>2025-11-21T03:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3d3307ecd8bdd6d9af0d82245c5fc50e4d624a7a'/>
<id>3d3307ecd8bdd6d9af0d82245c5fc50e4d624a7a</id>
<content type='text'>
d076608d58d1ec55016eb747a995511e3a3f72aa moved some deps around to avoid
cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that
simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so
that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See #162865.

Frontend already depends on Basic, so no new deps need to be added
anywhere except for places that do strict dep checking.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
d076608d58d1ec55016eb747a995511e3a3f72aa moved some deps around to avoid
cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that
simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so
that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See #162865.

Frontend already depends on Basic, so no new deps need to be added
anywhere except for places that do strict dep checking.</pre>
</div>
</content>
</entry>
<entry>
<title>[Frontend] Remove unused includes (NFC) (#142256)</title>
<updated>2025-05-31T22:03:52+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-31T22:03:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52e3b100d4ed695af47cb08e756b30950af52d6a'/>
<id>52e3b100d4ed695af47cb08e756b30950af52d6a</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>[NFC][clang] Return underlying strings directly instead of OS.str()</title>
<updated>2021-12-10T00:05:46+00:00</updated>
<author>
<name>Logan Smith</name>
<email>logan.r.smith0@gmail.com</email>
</author>
<published>2021-12-09T23:02:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0cf6f7b128dd457711ba5c0ebfcb8143dc1632f8'/>
<id>0cf6f7b128dd457711ba5c0ebfcb8143dc1632f8</id>
<content type='text'>
This avoids an unnecessary copy required by 'return OS.str()', allowing
instead for NRVO or implicit move. The .str() call (which flushes the
stream) is no longer required since 65b13610a5226b84889b923bae884ba395ad084d,
which made raw_string_ostream unbuffered by default.

Differential Revision: https://reviews.llvm.org/D115374
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids an unnecessary copy required by 'return OS.str()', allowing
instead for NRVO or implicit move. The .str() call (which flushes the
stream) is no longer required since 65b13610a5226b84889b923bae884ba395ad084d,
which made raw_string_ostream unbuffered by default.

Differential Revision: https://reviews.llvm.org/D115374
</pre>
</div>
</content>
</entry>
<entry>
<title>[modules] Use `HashBuilder` and `MD5` for the module hash.</title>
<updated>2021-09-03T18:13:36+00:00</updated>
<author>
<name>Alexandre Rames</name>
<email>arames@apple.com</email>
</author>
<published>2021-09-03T18:12:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=655bea4226b401a11164f99c6344e38d8742b8e4'/>
<id>655bea4226b401a11164f99c6344e38d8742b8e4</id>
<content type='text'>
Per the comments, `hash_code` values "are not stable to save or
persist", so are unsuitable for the module hash, which must persist
across compilations for the implicit module hashes to match. Note that
in practice, today, `hash_code` are stable. But this is an
implementation detail, with a clear `FIXME` indicating we should switch
to a per-execution seed.

The stability of `MD5` also allows modules cross-compilation use-cases.
The `size_t` underlying storage for `hash_code` varying across platforms
could cause mismatching hashes when cross-compiling from a 64bit
target to a 32bit target.

Note that native endianness is still used for the hash computation. So hashes
will differ between platforms of different endianness.

Reviewed By: jansvoboda11

Differential Revision: https://reviews.llvm.org/D102943
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Per the comments, `hash_code` values "are not stable to save or
persist", so are unsuitable for the module hash, which must persist
across compilations for the implicit module hashes to match. Note that
in practice, today, `hash_code` are stable. But this is an
implementation detail, with a clear `FIXME` indicating we should switch
to a per-execution seed.

The stability of `MD5` also allows modules cross-compilation use-cases.
The `size_t` underlying storage for `hash_code` varying across platforms
could cause mismatching hashes when cross-compiling from a 64bit
target to a 32bit target.

Note that native endianness is still used for the hash computation. So hashes
will differ between platforms of different endianness.

Reviewed By: jansvoboda11

Differential Revision: https://reviews.llvm.org/D102943
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][modules] Use extensible RTTI for ModuleFileExtension</title>
<updated>2021-03-05T10:11:05+00:00</updated>
<author>
<name>Jan Svoboda</name>
<email>jan_svoboda@apple.com</email>
</author>
<published>2021-03-01T17:52:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4295ae96cdf275cdda8bded9271960a4cac11fb2'/>
<id>4295ae96cdf275cdda8bded9271960a4cac11fb2</id>
<content type='text'>
Clang exposes an interface for extending the PCM/PCH file format: `ModuleFileExtension`.

Clang itself has only a single implementation of the interface: `TestModuleFileExtension` that can be instantiated via the `-ftest-module-file_extension=` command line argument (and is stored in `FrontendOptions::ModuleFileExtensions`).

Clients of the Clang library can extend the PCM/PCH file format by pushing an instance of their extension class to the `FrontendOptions::ModuleFileExtensions` vector.

When generating the `-ftest-module-file_extension=` command line argument from `FrontendOptions`, a downcast is used to distinguish between the Clang's testing extension and other (client) extensions.

This functionality is enabled by LLVM-style RTTI. However, this style of RTTI is hard to extend, as it requires patching Clang (adding new case to the `ModuleFileExtensionKind` enum).

This patch switches to the LLVM RTTI for open class hierarchies, which allows libClang users (e.g. Swift) to create implementations of `ModuleFileExtension` without patching Clang. (Documentation of the feature: https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html#rtti-for-open-class-hierarchies)

Reviewed By: artemcm

Differential Revision: https://reviews.llvm.org/D97702
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clang exposes an interface for extending the PCM/PCH file format: `ModuleFileExtension`.

Clang itself has only a single implementation of the interface: `TestModuleFileExtension` that can be instantiated via the `-ftest-module-file_extension=` command line argument (and is stored in `FrontendOptions::ModuleFileExtensions`).

Clients of the Clang library can extend the PCM/PCH file format by pushing an instance of their extension class to the `FrontendOptions::ModuleFileExtensions` vector.

When generating the `-ftest-module-file_extension=` command line argument from `FrontendOptions`, a downcast is used to distinguish between the Clang's testing extension and other (client) extensions.

This functionality is enabled by LLVM-style RTTI. However, this style of RTTI is hard to extend, as it requires patching Clang (adding new case to the `ModuleFileExtensionKind` enum).

This patch switches to the LLVM RTTI for open class hierarchies, which allows libClang users (e.g. Swift) to create implementations of `ModuleFileExtension` without patching Clang. (Documentation of the feature: https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html#rtti-for-open-class-hierarchies)

Reviewed By: artemcm

Differential Revision: https://reviews.llvm.org/D97702
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][cli] NFC: Use .str() instead of operator&lt;&lt;</title>
<updated>2021-03-02T12:14:00+00:00</updated>
<author>
<name>Jan Svoboda</name>
<email>jan_svoboda@apple.com</email>
</author>
<published>2021-03-02T12:14:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=08ccea019fda514ae36454f8d607b6c3cb08698e'/>
<id>08ccea019fda514ae36454f8d607b6c3cb08698e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][cli] Fix gcc warning (NFC)</title>
<updated>2021-02-11T04:38:09+00:00</updated>
<author>
<name>Yang Fan</name>
<email>nullptr.cpp@gmail.com</email>
</author>
<published>2021-02-11T03:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=984cfdc6ee8b4550238dccf212d786c4ded49cf7'/>
<id>984cfdc6ee8b4550238dccf212d786c4ded49cf7</id>
<content type='text'>
GCC warning:
```
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:131:20: warning: ‘llvm::raw_ostream&amp; clang::operator&lt;&lt;(llvm::raw_ostream&amp;, const clang::TestModuleFileExtension&amp;)’ has not been declared within ‘clang’
  131 | llvm::raw_ostream &amp;clang::operator&lt;&lt;(llvm::raw_ostream &amp;OS,
      |                    ^~~~~
In file included from /llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:8:
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.h:75:3: note: only here as a ‘friend’
   75 |   operator&lt;&lt;(llvm::raw_ostream &amp;OS, const TestModuleFileExtension &amp;Extension);
      |   ^~~~~~~~
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC warning:
```
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:131:20: warning: ‘llvm::raw_ostream&amp; clang::operator&lt;&lt;(llvm::raw_ostream&amp;, const clang::TestModuleFileExtension&amp;)’ has not been declared within ‘clang’
  131 | llvm::raw_ostream &amp;clang::operator&lt;&lt;(llvm::raw_ostream &amp;OS,
      |                    ^~~~~
In file included from /llvm-project/clang/lib/Frontend/TestModuleFileExtension.cpp:8:
/llvm-project/clang/lib/Frontend/TestModuleFileExtension.h:75:3: note: only here as a ‘friend’
   75 |   operator&lt;&lt;(llvm::raw_ostream &amp;OS, const TestModuleFileExtension &amp;Extension);
      |   ^~~~~~~~
```
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][cli] Generate and round-trip Frontend options</title>
<updated>2021-02-09T15:40:30+00:00</updated>
<author>
<name>Jan Svoboda</name>
<email>jan_svoboda@apple.com</email>
</author>
<published>2021-02-09T15:30:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e8a246ac9966e6ca43e7bd84db6df78b27d2201'/>
<id>5e8a246ac9966e6ca43e7bd84db6df78b27d2201</id>
<content type='text'>
This patch implements generation of remaining frontend options and tests it by performing parse-generate-parse round trip.

Depends on D96269.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96155
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements generation of remaining frontend options and tests it by performing parse-generate-parse round trip.

Depends on D96269.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96155
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bitcode] Move Bitstream to a separate library</title>
<updated>2019-07-03T22:40:07+00:00</updated>
<author>
<name>Francis Visoiu Mistrih</name>
<email>francisvm@yahoo.com</email>
</author>
<published>2019-07-03T22:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e0308279cbdd18391c533d6501922429ff4ef839'/>
<id>e0308279cbdd18391c533d6501922429ff4ef839</id>
<content type='text'>
This moves Bitcode/Bitstream*, Bitcode/BitCodes.h to Bitstream/.

This is needed to avoid a circular dependency when using the bitstream
code for parsing optimization remarks.

Since Bitcode uses Core for the IR part:

libLLVMRemarks -&gt; Bitcode -&gt; Core

and Core uses libLLVMRemarks to generate remarks (see
IR/RemarkStreamer.cpp):

Core -&gt; libLLVMRemarks

we need to separate the Bitstream and Bitcode part.

For clang-doc, it seems that it doesn't need the whole bitcode layer, so
I updated the CMake to only use the bitstream part.

Differential Revision: https://reviews.llvm.org/D63899

llvm-svn: 365091
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves Bitcode/Bitstream*, Bitcode/BitCodes.h to Bitstream/.

This is needed to avoid a circular dependency when using the bitstream
code for parsing optimization remarks.

Since Bitcode uses Core for the IR part:

libLLVMRemarks -&gt; Bitcode -&gt; Core

and Core uses libLLVMRemarks to generate remarks (see
IR/RemarkStreamer.cpp):

Core -&gt; libLLVMRemarks

we need to separate the Bitstream and Bitcode part.

For clang-doc, it seems that it doesn't need the whole bitcode layer, so
I updated the CMake to only use the bitstream part.

Differential Revision: https://reviews.llvm.org/D63899

llvm-svn: 365091
</pre>
</div>
</content>
</entry>
<entry>
<title>BitStream reader: propagate errors</title>
<updated>2019-06-26T19:50:12+00:00</updated>
<author>
<name>JF Bastien</name>
<email>jfbastien@apple.com</email>
</author>
<published>2019-06-26T19:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0e828958264734e60115ba2482437008c822d7db'/>
<id>0e828958264734e60115ba2482437008c822d7db</id>
<content type='text'>
The bitstream reader handles errors poorly. This has two effects:

 * Bugs in file handling (especially modules) manifest as an "unexpected end of
   file" crash
 * Users of clang as a library end up aborting because the code unconditionally
   calls `report_fatal_error`

The bitstream reader should be more resilient and return Expected / Error as
soon as an error is encountered, not way late like it does now. This patch
starts doing so and adopting the error handling where I think it makes sense.
There's plenty more to do: this patch propagates errors to be minimally useful,
and follow-ups will propagate them further and improve diagnostics.

https://bugs.llvm.org/show_bug.cgi?id=42311
&lt;rdar://problem/33159405&gt;

Differential Revision: https://reviews.llvm.org/D63518

llvm-svn: 364464
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The bitstream reader handles errors poorly. This has two effects:

 * Bugs in file handling (especially modules) manifest as an "unexpected end of
   file" crash
 * Users of clang as a library end up aborting because the code unconditionally
   calls `report_fatal_error`

The bitstream reader should be more resilient and return Expected / Error as
soon as an error is encountered, not way late like it does now. This patch
starts doing so and adopting the error handling where I think it makes sense.
There's plenty more to do: this patch propagates errors to be minimally useful,
and follow-ups will propagate them further and improve diagnostics.

https://bugs.llvm.org/show_bug.cgi?id=42311
&lt;rdar://problem/33159405&gt;

Differential Revision: https://reviews.llvm.org/D63518

llvm-svn: 364464
</pre>
</div>
</content>
</entry>
</feed>
