<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/IRReader/IRReader.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>[LLVM][IR] Add location tracking to LLVM IR parser (#155797)</title>
<updated>2025-10-22T14:46:12+00:00</updated>
<author>
<name>Bertik23</name>
<email>39457484+Bertik23@users.noreply.github.com</email>
</author>
<published>2025-10-22T14:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=18d4ba593db9d6949300fbd97e900bfb86d651b2'/>
<id>18d4ba593db9d6949300fbd97e900bfb86d651b2</id>
<content type='text'>
This PR is part of the LLVM IR LSP server project
([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))

To be able to make a LSP server, it's crucial to have location
information about the LLVM objects (Functions, BasicBlocks and
Instructions).

This PR adds:
 * Position tracking to the Lexer
 * A new AsmParserContext class, to hold the new position info
 * Tests to check if the location is correct

The AsmParserContext can be passed as an optional parameter into the
parser. Which populates it and it can be then used by other tools, such
as the LSP server.

The AsmParserContext idea was borrowed from MLIR. As we didn't want to
store data no one else uses inside the objects themselves. But the
implementation is different, this class holds several maps of Functions,
BasicBlocks and Instructions, to map them to their location.

And some utility methods were added to get the positions of the
processed tokens.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR is part of the LLVM IR LSP server project
([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))

To be able to make a LSP server, it's crucial to have location
information about the LLVM objects (Functions, BasicBlocks and
Instructions).

This PR adds:
 * Position tracking to the Lexer
 * A new AsmParserContext class, to hold the new position info
 * Tests to check if the location is correct

The AsmParserContext can be passed as an optional parameter into the
parser. Which populates it and it can be then used by other tools, such
as the LSP server.

The AsmParserContext idea was borrowed from MLIR. As we didn't want to
store data no one else uses inside the objects themselves. But the
implementation is different, this class holds several maps of Functions,
BasicBlocks and Instructions, to map them to their location.

And some utility methods were added to get the positions of the
processed tokens.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Don't call raw_string_ostream::flush() (NFC)</title>
<updated>2024-09-20T17:19:59+00:00</updated>
<author>
<name>Youngsuk Kim</name>
<email>youngsuk.kim@hpe.com</email>
</author>
<published>2024-09-20T17:02:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d31e314131b17b0a802a80593a33cb11213c60d1'/>
<id>d31e314131b17b0a802a80593a33cb11213c60d1</id>
<content type='text'>
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
</pre>
</div>
</content>
</entry>
<entry>
<title>[BitcodeReader] Allow reading pointer types from old IR</title>
<updated>2023-01-18T12:20:15+00:00</updated>
<author>
<name>Sebastian Neubauer</name>
<email>Sebastian.Neubauer@amd.com</email>
</author>
<published>2023-01-18T12:19:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c33b9395b1dfe9f8506062c05c658f6541f6163d'/>
<id>c33b9395b1dfe9f8506062c05c658f6541f6163d</id>
<content type='text'>
When opaque pointers are enabled and old IR with typed pointers is read,
the BitcodeReader automatically upgrades all typed pointers to opaque
pointers. This is a lossy conversion, i.e. when a function argument is a
pointer and unused, it’s impossible to reconstruct the original type
behind the pointer.

There are cases where the type information of pointers is needed. One is
reading DXIL, which is bitcode of old LLVM IR and makes a lot of use of
pointers in function signatures.
We’d like to keep using up-to-date llvm to read in and process DXIL, so
in the face of opaque pointers, we need some way to access the type
information of pointers from the read bitcode.

This patch allows extracting type information by supplying functions to
parseBitcodeFile that get called for each function signature or metadata
value. The function can access the type information via the reader’s
type IDs and the getTypeByID and getContainedTypeID functions.
The tests exemplarily shows how type info from pointers can be stored in
metadata for use after the BitcodeReader finished.

Differential Revision: https://reviews.llvm.org/D127728
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When opaque pointers are enabled and old IR with typed pointers is read,
the BitcodeReader automatically upgrades all typed pointers to opaque
pointers. This is a lossy conversion, i.e. when a function argument is a
pointer and unused, it’s impossible to reconstruct the original type
behind the pointer.

There are cases where the type information of pointers is needed. One is
reading DXIL, which is bitcode of old LLVM IR and makes a lot of use of
pointers in function signatures.
We’d like to keep using up-to-date llvm to read in and process DXIL, so
in the face of opaque pointers, we need some way to access the type
information of pointers from the read bitcode.

This patch allows extracting type information by supplying functions to
parseBitcodeFile that get called for each function signature or metadata
value. The function can access the type information via the reader’s
type IDs and the getTypeByID and getContainedTypeID functions.
The tests exemplarily shows how type info from pointers can be stored in
metadata for use after the BitcodeReader finished.

Differential Revision: https://reviews.llvm.org/D127728
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[BitcodeReader] Allow reading pointer types from old IR"</title>
<updated>2023-01-18T08:53:21+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-01-18T08:48:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=610abe8039eaaebfc37cb78b0bc1dbe0bc43ff50'/>
<id>610abe8039eaaebfc37cb78b0bc1dbe0bc43ff50</id>
<content type='text'>
This reverts commit b56df190b01335506ce30a4559d880da76d1a181.

The unit tests are implemented in a way that requires support for
writing typed pointer bitcode, which is going away soon. Please
rewrite it in a way that not have requirement, e.g. by shipping
pre-compiled bitcode, as we do for integration tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit b56df190b01335506ce30a4559d880da76d1a181.

The unit tests are implemented in a way that requires support for
writing typed pointer bitcode, which is going away soon. Please
rewrite it in a way that not have requirement, e.g. by shipping
pre-compiled bitcode, as we do for integration tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>[BitcodeReader] Allow reading pointer types from old IR</title>
<updated>2023-01-17T12:19:40+00:00</updated>
<author>
<name>Sebastian Neubauer</name>
<email>Sebastian.Neubauer@amd.com</email>
</author>
<published>2023-01-17T12:18:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b56df190b01335506ce30a4559d880da76d1a181'/>
<id>b56df190b01335506ce30a4559d880da76d1a181</id>
<content type='text'>
When opaque pointers are enabled and old IR with typed pointers is read,
the BitcodeReader automatically upgrades all typed pointers to opaque
pointers. This is a lossy conversion, i.e. when a function argument is a
pointer and unused, it’s impossible to reconstruct the original type
behind the pointer.

There are cases where the type information of pointers is needed. One is
reading DXIL, which is bitcode of old LLVM IR and makes a lot of use of
pointers in function signatures.
We’d like to keep using up-to-date llvm to read in and process DXIL, so
in the face of opaque pointers, we need some way to access the type
information of pointers from the read bitcode.

This patch allows extracting type information by supplying functions to
parseBitcodeFile that get called for each function signature or metadata
value. The function can access the type information via the reader’s
type IDs and the getTypeByID and getContainedTypeID functions.
The tests exemplarily shows how type info from pointers can be stored in
metadata for use after the BitcodeReader finished.

Differential Revision: https://reviews.llvm.org/D127728
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When opaque pointers are enabled and old IR with typed pointers is read,
the BitcodeReader automatically upgrades all typed pointers to opaque
pointers. This is a lossy conversion, i.e. when a function argument is a
pointer and unused, it’s impossible to reconstruct the original type
behind the pointer.

There are cases where the type information of pointers is needed. One is
reading DXIL, which is bitcode of old LLVM IR and makes a lot of use of
pointers in function signatures.
We’d like to keep using up-to-date llvm to read in and process DXIL, so
in the face of opaque pointers, we need some way to access the type
information of pointers from the read bitcode.

This patch allows extracting type information by supplying functions to
parseBitcodeFile that get called for each function signature or metadata
value. The function can access the type information via the reader’s
type IDs and the getTypeByID and getContainedTypeID functions.
The tests exemplarily shows how type info from pointers can be stored in
metadata for use after the BitcodeReader finished.

Differential Revision: https://reviews.llvm.org/D127728
</pre>
</div>
</content>
</entry>
<entry>
<title>[IRReader] Convert Optional in DataLayoutCallbackTy to std::optional</title>
<updated>2022-12-07T16:47:25+00:00</updated>
<author>
<name>Krzysztof Parzyszek</name>
<email>kparzysz@quicinc.com</email>
</author>
<published>2022-12-07T16:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=110fe4f49561d3695fe5b11a55378b0656a175f7'/>
<id>110fe4f49561d3695fe5b11a55378b0656a175f7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Reordering parameters in getFile and getFileOrSTDIN</title>
<updated>2021-03-25T13:47:49+00:00</updated>
<author>
<name>Abhina Sreeskantharajan</name>
<email>Abhina.Sreeskantharajan@ibm.com</email>
</author>
<published>2021-03-25T13:47:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6'/>
<id>c83cd8feef7eb8319131d968bb8c94fdc8dbb6a6</id>
<content type='text'>
In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used.

```
  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsText = false,
          bool RequiresNullTerminator = true, bool IsVolatile = false);

  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFileOrSTDIN(const Twine &amp;Filename, bool IsText = false,
                 bool RequiresNullTerminator = true);

 static ErrorOr&lt;std::unique_ptr&lt;MB&gt;&gt;
 getFileAux(const Twine &amp;Filename, uint64_t MapSize, uint64_t Offset,
            bool IsText, bool RequiresNullTerminator, bool IsVolatile);

  static ErrorOr&lt;std::unique_ptr&lt;WritableMemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsVolatile = false);
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D99182
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used.

```
  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsText = false,
          bool RequiresNullTerminator = true, bool IsVolatile = false);

  static ErrorOr&lt;std::unique_ptr&lt;MemoryBuffer&gt;&gt;
  getFileOrSTDIN(const Twine &amp;Filename, bool IsText = false,
                 bool RequiresNullTerminator = true);

 static ErrorOr&lt;std::unique_ptr&lt;MB&gt;&gt;
 getFileAux(const Twine &amp;Filename, uint64_t MapSize, uint64_t Offset,
            bool IsText, bool RequiresNullTerminator, bool IsVolatile);

  static ErrorOr&lt;std::unique_ptr&lt;WritableMemoryBuffer&gt;&gt;
  getFile(const Twine &amp;Filename, bool IsVolatile = false);
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D99182
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Formatting changes</title>
<updated>2021-03-23T11:17:54+00:00</updated>
<author>
<name>Abhina Sreeskantharajan</name>
<email>Abhina.Sreeskantharajan@ibm.com</email>
</author>
<published>2021-03-23T11:17:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a234d0319891ae25cdf020dc32bce1c37c0e9867'/>
<id>a234d0319891ae25cdf020dc32bce1c37c0e9867</id>
<content type='text'>
This patch addresses some formatting changes from the comments in https://reviews.llvm.org/D97785.

Reviewed By: anirudhp

Differential Revision: https://reviews.llvm.org/D99072
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch addresses some formatting changes from the comments in https://reviews.llvm.org/D97785.

Reviewed By: anirudhp

Differential Revision: https://reviews.llvm.org/D99072
</pre>
</div>
</content>
</entry>
<entry>
<title>[SystemZ][z/OS] Distinguish between text and binary files on z/OS</title>
<updated>2021-03-19T12:09:57+00:00</updated>
<author>
<name>Abhina Sreeskantharajan</name>
<email>Abhina.Sreeskantharajan@ibm.com</email>
</author>
<published>2021-03-19T12:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4f750f6ebc412869ce6bb28331313a9c9a9d9af7'/>
<id>4f750f6ebc412869ce6bb28331313a9c9a9d9af7</id>
<content type='text'>
This patch consists of the initial changes to help distinguish between text and binary content correctly on z/OS. I would like to get feedback from Windows users on setting OF_None for all ToolOutputFiles. This seems to have been done as an optimization to prevent CRLF translation on Windows in the past.

Reviewed By: zibi

Differential Revision: https://reviews.llvm.org/D97785
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch consists of the initial changes to help distinguish between text and binary content correctly on z/OS. I would like to get feedback from Windows users on setting OF_None for all ToolOutputFiles. This seems to have been done as an optimization to prevent CRLF translation on Windows in the past.

Reviewed By: zibi

Differential Revision: https://reviews.llvm.org/D97785
</pre>
</div>
</content>
</entry>
<entry>
<title>static const char *const foo =&gt; const char foo[]</title>
<updated>2020-12-01T18:33:18+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2020-12-01T18:33:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a5309438fe8d4f1212ae645bc0aaf71fdf73d028'/>
<id>a5309438fe8d4f1212ae645bc0aaf71fdf73d028</id>
<content type='text'>
By default, a non-template variable of non-volatile const-qualified type
having namespace-scope has internal linkage, so no need for `static`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default, a non-template variable of non-volatile const-qualified type
having namespace-scope has internal linkage, so no need for `static`.
</pre>
</div>
</content>
</entry>
</feed>
