<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp, branch users/koachan/spr/main.sparcias-enable-parseforallfeatures-in-matchoperandparserimpl</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>[MC] Remove SectionKind from MCSection (#96067)</title>
<updated>2024-06-20T08:52:49+00:00</updated>
<author>
<name>aengelke</name>
<email>engelke@in.tum.de</email>
</author>
<published>2024-06-20T08:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46beeaa3940ef8380ee99b9f666cd27b884f63e4'/>
<id>46beeaa3940ef8380ee99b9f666cd27b884f63e4</id>
<content type='text'>
There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.

ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.

This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.

ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.

This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.
</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Set IS_64 flag correctly on __indirect_function_table in object files (#94487)</title>
<updated>2024-06-06T03:28:51+00:00</updated>
<author>
<name>Sam Clegg</name>
<email>sbc@chromium.org</email>
</author>
<published>2024-06-06T03:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c2244f8284f45471aba911f08b33cb72a6e8de9c'/>
<id>c2244f8284f45471aba911f08b33cb72a6e8de9c</id>
<content type='text'>
Follow up to #92042</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up to #92042</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Allocate MCSymbolWasm data on MCContext (#85866)</title>
<updated>2024-04-02T17:59:29+00:00</updated>
<author>
<name>Tim Neumann</name>
<email>timnn@google.com</email>
</author>
<published>2024-04-02T17:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f792f14b01605453c7c0c17f3b4564335c0d9d14'/>
<id>f792f14b01605453c7c0c17f3b4564335c0d9d14</id>
<content type='text'>
Fixes #85578, a use-after-free caused by some `MCSymbolWasm` data being
freed too early.

Previously, `WebAssemblyAsmParser` owned the data that is moved to
`MCContext` by this PR, which caused problems when handling module ASM,
because the ASM parser was destroyed after parsing the module ASM, but
the symbols persisted.

The added test passes locally with an LLVM build with AddressSanitizer
enabled.

Implementation notes:

* I've called the added method
&lt;code&gt;allocate&lt;b&gt;&lt;i&gt;Generic&lt;/i&gt;&lt;/b&gt;String&lt;/code&gt; and added the second
paragraph of its documentation to maybe guide people a bit on when to
use this method (based on my (limited) understanding of the `MCContext`
class). We could also just call it `allocateString` and remove that
second paragraph.
* The added `createWasmSignature` method does not support taking the
return and parameter types as arguments: Specifying them afterwards is
barely any longer and prevents them from being accidentally specified in
the wrong order.
* This removes a _"TODO: Do the uniquing of Signatures here instead of
ObjectFileWriter?"_ since the field it's attached to is also removed.
Let me know if you think that TODO should be preserved somewhere.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #85578, a use-after-free caused by some `MCSymbolWasm` data being
freed too early.

Previously, `WebAssemblyAsmParser` owned the data that is moved to
`MCContext` by this PR, which caused problems when handling module ASM,
because the ASM parser was destroyed after parsing the module ASM, but
the symbols persisted.

The added test passes locally with an LLVM build with AddressSanitizer
enabled.

Implementation notes:

* I've called the added method
&lt;code&gt;allocate&lt;b&gt;&lt;i&gt;Generic&lt;/i&gt;&lt;/b&gt;String&lt;/code&gt; and added the second
paragraph of its documentation to maybe guide people a bit on when to
use this method (based on my (limited) understanding of the `MCContext`
class). We could also just call it `allocateString` and remove that
second paragraph.
* The added `createWasmSignature` method does not support taking the
return and parameter types as arguments: Specifying them afterwards is
barely any longer and prevents them from being accidentally specified in
the wrong order.
* This removes a _"TODO: Do the uniquing of Signatures here instead of
ObjectFileWriter?"_ since the field it's attached to is also removed.
Let me know if you think that TODO should be preserved somewhere.</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Make `MCParsedAsmOperand::getReg()` return `MCRegister` (#86444)</title>
<updated>2024-03-25T02:13:48+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2024-03-25T02:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e5b6561029665e69e033cff4216fecb78302259'/>
<id>5e5b6561029665e69e033cff4216fecb78302259</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Use ValType instead of integer types to model wasm tables (#78012)</title>
<updated>2024-01-17T19:29:19+00:00</updated>
<author>
<name>Derek Schuff</name>
<email>dschuff@chromium.org</email>
</author>
<published>2024-01-17T19:29:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=103fa3250c46b0c4cf04573c5e075185ca574016'/>
<id>103fa3250c46b0c4cf04573c5e075185ca574016</id>
<content type='text'>
LLVM models some features found in the binary format with raw integers
and others with nested or enumerated types. This PR switches modeling of
tables and segments to use wasm::ValType rather than uint32_t. This NFC
change is in preparation for modeling more reference types, but IMO is
also cleaner and closer to the spec.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM models some features found in the binary format with raw integers
and others with nested or enumerated types. This PR switches modeling of
tables and segments to use wasm::ValType rather than uint32_t. This NFC
change is in preparation for modeling more reference types, but IMO is
also cleaner and closer to the spec.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)</title>
<updated>2023-12-12T05:01:36+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-12-12T05:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=586ecdf205aa8b3d162da6f955170a6736656615'/>
<id>586ecdf205aa8b3d162da6f955170a6736656615</id>
<content type='text'>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Stop including llvm/Support/Endian.h (NFC)</title>
<updated>2023-11-02T06:16:33+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-11-02T06:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bf383dca36953fbd37c979d78f781ba37eab129c'/>
<id>bf383dca36953fbd37c979d78f781ba37eab129c</id>
<content type='text'>
Identified with misc-include-cleaner.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.
</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Change tryParseRegister to return ParseStatus (NFC)</title>
<updated>2023-09-06T07:28:12+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2023-09-06T07:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a479be0f39a3301e9ca634d37cf6454b6d3865c6'/>
<id>a479be0f39a3301e9ca634d37cf6454b6d3865c6</id>
<content type='text'>
This finishes the work of replacing OperandMatchResultTy with
ParseStatus, started in D154101.
As a drive-by change, rename some RegNo variables to just Reg
(a leftover from the days when RegNo had 'unsigned' type).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This finishes the work of replacing OperandMatchResultTy with
ParseStatus, started in D154101.
As a drive-by change, rename some RegNo variables to just Reg
(a leftover from the days when RegNo had 'unsigned' type).
</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Add three-state parseDirective as a replacement for ParseDirective</title>
<updated>2023-07-01T01:33:28+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2023-06-29T14:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af20c1c1298d15f36470cd9d5b2cccb3b9b59c30'/>
<id>af20c1c1298d15f36470cd9d5b2cccb3b9b59c30</id>
<content type='text'>
Conventionally, parsing methods return false on success and true on
error. However, directive parsing methods need a third state: the
directive is not target specific. AsmParser::parseStatement detected
this case by using a fragile heuristic: if the target parser did not
consume any tokens, the directive is assumed to be not target-specific.

Some targets fail to follow the convention: they return success after
emitting an error or do not consume the entire line and return failure
on successful parsing. This was partially worked around by checking for
pending errors in parseStatement.

This patch tries to improve the situation by introducing parseDirective
method that returns ParseStatus -- three-state class. The new method
should eventually replace the old one returning bool.

ParseStatus is intentionally implicitly constructible from bool to allow
uses like `return Error(Loc, "message")`. It also has a potential to
replace OperandMatchResulTy as it is more convenient to use due to the
implicit construction from bool and more type safe.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154101
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conventionally, parsing methods return false on success and true on
error. However, directive parsing methods need a third state: the
directive is not target specific. AsmParser::parseStatement detected
this case by using a fragile heuristic: if the target parser did not
consume any tokens, the directive is assumed to be not target-specific.

Some targets fail to follow the convention: they return success after
emitting an error or do not consume the entire line and return failure
on successful parsing. This was partially worked around by checking for
pending errors in parseStatement.

This patch tries to improve the situation by introducing parseDirective
method that returns ParseStatus -- three-state class. The new method
should eventually replace the old one returning bool.

ParseStatus is intentionally implicitly constructible from bool to allow
uses like `return Error(Loc, "message")`. It also has a potential to
replace OperandMatchResulTy as it is more convenient to use due to the
implicit construction from bool and more type safe.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154101
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] format llvm/lib/Target/WebAssembly/AsmParser</title>
<updated>2023-04-11T13:41:29+00:00</updated>
<author>
<name>Congcong Cai</name>
<email>congcongcai0907@163.com</email>
</author>
<published>2023-04-11T13:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d8a0dc425cbf2fdf8415976560b4379bbb976c83'/>
<id>d8a0dc425cbf2fdf8415976560b4379bbb976c83</id>
<content type='text'>
Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D147884
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D147884
</pre>
</div>
</content>
</entry>
</feed>
