<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Demangle/MicrosoftDemangle.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>Remove unused &lt;array&gt; and &lt;list&gt; inclusion (#167116)</title>
<updated>2025-11-09T15:15:10+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2025-11-09T15:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=04b05998b16721d41d2ad1e453cc4549483bb8e7'/>
<id>04b05998b16721d41d2ad1e453cc4549483bb8e7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MsDemangle] Use NodeList over SmallVector for target names (#166586)</title>
<updated>2025-11-05T17:19:43+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-11-05T17:19:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a1f0fe140a0e8f15dcd33df42b2c8cf170f69db8'/>
<id>a1f0fe140a0e8f15dcd33df42b2c8cf170f69db8</id>
<content type='text'>
Using `SmallVector` would introduce a dependency cycle (see
https://github.com/llvm/llvm-project/pull/155630#discussion_r2495268497),
so this uses a NodeList.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using `SmallVector` would introduce a dependency cycle (see
https://github.com/llvm/llvm-project/pull/155630#discussion_r2495268497),
so this uses a NodeList.</pre>
</div>
</content>
</entry>
<entry>
<title>[MsDemangle] Read entire chain of target names in special tables (#155630)</title>
<updated>2025-11-05T15:48:24+00:00</updated>
<author>
<name>nerix</name>
<email>nerixdev@outlook.de</email>
</author>
<published>2025-11-05T15:48:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3641e269b0fdf3614b6a2a068678d8431204a489'/>
<id>3641e269b0fdf3614b6a2a068678d8431204a489</id>
<content type='text'>
When there's a deep inheritance hierarchy of multiple C++ classes (see
below), then the mangled name of a VFTable can include multiple key
nodes in the target name.
For example, in the following code, MSVC will generate mangled names for
the VFTables that have up to three key classes in the context.
&lt;details&gt;&lt;summary&gt;Code&lt;/summary&gt;

```cpp
class Base1 {
  virtual void a() {};
};
class Base2 {
  virtual void b() {}
};

class Ind1 : public Base1 {};
class Ind2 : public Base1 {};

class A : public Ind1, public Ind2 {};

class Ind3 : public A {};
class Ind4 : public A {};

class B : public Ind3, public Ind4 {};

class Ind5 : public B {};
class Ind6 : public B {};

class C : public Ind5, public Ind6 {};

int main() { auto i = new C; }
```
&lt;/details&gt; 

This will include `??_7C@@6BInd1@@Ind4@@Ind5@@@` (and every other
combination). Microsoft's undname will demangle this to "const
C::\`vftable'{for \`Ind1's \`Ind4's \`Ind5'}". Previously, LLVM would
demangle this to "const C::\`vftable'{for \`Ind1'}".

With this PR, the output of LLVM's undname will be identical to
Microsoft's version. This changes `SpecialTableSymbolNode::TargetName`
to a node array which contains each key from the name. Unlike
namespaces, these keys are not in reverse order - they are in the same
order as in the mangled name.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When there's a deep inheritance hierarchy of multiple C++ classes (see
below), then the mangled name of a VFTable can include multiple key
nodes in the target name.
For example, in the following code, MSVC will generate mangled names for
the VFTables that have up to three key classes in the context.
&lt;details&gt;&lt;summary&gt;Code&lt;/summary&gt;

```cpp
class Base1 {
  virtual void a() {};
};
class Base2 {
  virtual void b() {}
};

class Ind1 : public Base1 {};
class Ind2 : public Base1 {};

class A : public Ind1, public Ind2 {};

class Ind3 : public A {};
class Ind4 : public A {};

class B : public Ind3, public Ind4 {};

class Ind5 : public B {};
class Ind6 : public B {};

class C : public Ind5, public Ind6 {};

int main() { auto i = new C; }
```
&lt;/details&gt; 

This will include `??_7C@@6BInd1@@Ind4@@Ind5@@@` (and every other
combination). Microsoft's undname will demangle this to "const
C::\`vftable'{for \`Ind1's \`Ind4's \`Ind5'}". Previously, LLVM would
demangle this to "const C::\`vftable'{for \`Ind1'}".

With this PR, the output of LLVM's undname will be identical to
Microsoft's version. This changes `SpecialTableSymbolNode::TargetName`
to a node array which contains each key from the name. Unlike
namespaces, these keys are not in reverse order - they are in the same
order as in the mangled name.</pre>
</div>
</content>
</entry>
<entry>
<title>[PAC] Add support for __ptrauth type qualifier (#100830)</title>
<updated>2025-04-15T19:54:25+00:00</updated>
<author>
<name>Akira Hatanaka</name>
<email>ahatanak@gmail.com</email>
</author>
<published>2025-04-15T19:54:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3283a92aea147e89d9d404fa7c8500223c7c22a'/>
<id>a3283a92aea147e89d9d404fa7c8500223c7c22a</id>
<content type='text'>
The qualifier allows programmer to directly control how pointers are
signed when they are stored in a particular variable.

The qualifier takes three arguments: the signing key, a flag specifying
whether address discrimination should be used, and a non-negative
integer that is used for additional discrimination.

```
typedef void (*my_callback)(const void*);
my_callback __ptrauth(ptrauth_key_process_dependent_code, 1, 0xe27a) callback;
```

Co-Authored-By: John McCall rjmccall@apple.com</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The qualifier allows programmer to directly control how pointers are
signed when they are stored in a particular variable.

The qualifier takes three arguments: the signing key, a flag specifying
whether address discrimination should be used, and a non-negative
integer that is used for additional discrimination.

```
typedef void (*my_callback)(const void*);
my_callback __ptrauth(ptrauth_key_process_dependent_code, 1, 0xe27a) callback;
```

Co-Authored-By: John McCall rjmccall@apple.com</pre>
</div>
</content>
</entry>
<entry>
<title>[LLVM][Demangle] Fix MS Demangler to be stricter about wide string literals (#134483)</title>
<updated>2025-04-07T20:18:53+00:00</updated>
<author>
<name>Shafik Yaghmour</name>
<email>shafik.yaghmour@intel.com</email>
</author>
<published>2025-04-07T20:18:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d4c16424cf295e7edb7ecd5f8831ff195f7a8fa7'/>
<id>d4c16424cf295e7edb7ecd5f8831ff195f7a8fa7</id>
<content type='text'>
Static analysis detected that Demangler::demangleStringLiteral had a
potential overflow if not checking StringByteSize properly.

Added check to ensure that for wide string it is always even and that
there were the byte count did not mismatch the actual size of the
literal.

Fixes: https://github.com/llvm/llvm-project/issues/129970</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Static analysis detected that Demangler::demangleStringLiteral had a
potential overflow if not checking StringByteSize properly.

Added check to ensure that for wide string it is always even and that
there were the byte count did not mismatch the actual size of the
literal.

Fixes: https://github.com/llvm/llvm-project/issues/129970</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][aarch64] Fix Arm64EC name mangling algorithm (#115567)</title>
<updated>2024-11-13T23:35:03+00:00</updated>
<author>
<name>Daniel Paoliello</name>
<email>danpao@microsoft.com</email>
</author>
<published>2024-11-13T23:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa0cf3d39e03c3c63478f30a4c8c17d119b54b7f'/>
<id>fa0cf3d39e03c3c63478f30a4c8c17d119b54b7f</id>
<content type='text'>
Arm64EC uses a special name mangling mode that adds `$$h` between the
symbol name and its type. In MSVC's name mangling `@` is used to
separate the name and type BUT it is also used for other purposes, such
as the separator between paths in a fully qualified name.

The original algorithm was quite fragile and made assumptions that
didn't hold true for all MSVC mangled symbols, so instead of trying to
improve this algorithm we are now using the demangler to indicate where
the insertion point should be (i.e., to parse the fully-qualified name
and return the current string offset).

Also fixed `isArm64ECMangledFunctionName` to search for `@$$h` since the
`$$h` must always be after a `@`.

Fixes #115231</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Arm64EC uses a special name mangling mode that adds `$$h` between the
symbol name and its type. In MSVC's name mangling `@` is used to
separate the name and type BUT it is also used for other purposes, such
as the separator between paths in a fully qualified name.

The original algorithm was quite fragile and made assumptions that
didn't hold true for all MSVC mangled symbols, so instead of trying to
improve this algorithm we are now using the demangler to indicate where
the insertion point should be (i.e., to parse the fully-qualified name
and return the current string offset).

Also fixed `isArm64ECMangledFunctionName` to search for `@$$h` since the
`$$h` must always be after a `@`.

Fixes #115231</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] [Demangle] Fix MSVC demangling for placeholder return types (#106178)</title>
<updated>2024-09-18T03:05:44+00:00</updated>
<author>
<name>Max Winkler</name>
<email>max.enrico.winkler@gmail.com</email>
</author>
<published>2024-09-18T03:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8280651ad57cb9fb24a404cec2401040c28dec98'/>
<id>8280651ad57cb9fb24a404cec2401040c28dec98</id>
<content type='text'>
Properly demangle `_T` and `_P` return type manglings for MSVC 1920+.
Also added a unit test for `@` return type that is used when mangling
non-template auto placeholder return type function.

Tested the output against the undname shipped with MSVC 19.40.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Properly demangle `_T` and `_P` return type manglings for MSVC 1920+.
Also added a unit test for `@` return type that is used when mangling
non-template auto placeholder return type function.

Tested the output against the undname shipped with MSVC 19.40.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix MSVC 1920+ auto NTTP mangling for pointers to members (#97007)</title>
<updated>2024-07-04T17:17:32+00:00</updated>
<author>
<name>Max Winkler</name>
<email>max.enrico.winkler@gmail.com</email>
</author>
<published>2024-07-04T17:17:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d1dc4169838381688a74f245cdaedbe9fce13848'/>
<id>d1dc4169838381688a74f245cdaedbe9fce13848</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/70899.

This is a continuation of
https://github.com/llvm/llvm-project/pull/92477 for pointers to member
data and pointers to member functions.

The mangled name must be prefixed with `$M &lt;mangled-type&gt;` for the
deduced type of the nttp parameter.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/70899.

This is a continuation of
https://github.com/llvm/llvm-project/pull/92477 for pointers to member
data and pointers to member functions.

The mangled name must be prefixed with `$M &lt;mangled-type&gt;` for the
deduced type of the nttp parameter.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix MSVC Demangling with auto NTTP mangled names for function pointer, pointer to data and integral types (#96590)</title>
<updated>2024-06-27T05:24:28+00:00</updated>
<author>
<name>Max Winkler</name>
<email>max.enrico.winkler@gmail.com</email>
</author>
<published>2024-06-27T05:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ef067cf4b6d46cd48d2ed5cfe2300fe83b6bcc8a'/>
<id>ef067cf4b6d46cd48d2ed5cfe2300fe83b6bcc8a</id>
<content type='text'>
As cited here, https://github.com/llvm/llvm-project/pull/92477, undname
needs updating to support the new auto NTTP name mangling.

In short the deduced type of the auto NTTP parameter is mangled as `$M
&lt;type&gt; &lt;nttp-param&gt;`. However the deduced type is not printed for the
undecorated name so the `$M &lt;type&gt;` is parsed but simply ignored when
stringifying the generated AST.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As cited here, https://github.com/llvm/llvm-project/pull/92477, undname
needs updating to support the new auto NTTP name mangling.

In short the deduced type of the auto NTTP parameter is mangled as `$M
&lt;type&gt; &lt;nttp-param&gt;`. However the deduced type is not printed for the
undecorated name so the `$M &lt;type&gt;` is parsed but simply ignored when
stringifying the generated AST.</pre>
</div>
</content>
</entry>
<entry>
<title>[Demangle] use std::string_view::data rather than &amp;*std::string_view::begin</title>
<updated>2023-07-13T17:20:09+00:00</updated>
<author>
<name>Nick Desaulniers</name>
<email>ndesaulniers@google.com</email>
</author>
<published>2023-07-13T17:10:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8bb9414f1474d6a8caed2e7be5f1d3d999c8bae1'/>
<id>8bb9414f1474d6a8caed2e7be5f1d3d999c8bae1</id>
<content type='text'>
To fix expensive check builds that were failing when using MSVC's
std::string_view::iterator::operator*, I added a few expressions like
&amp;*std::string_view::begin.  @nico pointed out that this is literally the
same thing and more clearly expressed as std::string_view::data.

Link: https://github.com/llvm/llvm-project/issues/63740

Reviewed By: #libc_abi, ldionne, philnik, MaskRay

Differential Revision: https://reviews.llvm.org/D154876
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To fix expensive check builds that were failing when using MSVC's
std::string_view::iterator::operator*, I added a few expressions like
&amp;*std::string_view::begin.  @nico pointed out that this is literally the
same thing and more clearly expressed as std::string_view::data.

Link: https://github.com/llvm/llvm-project/issues/63740

Reviewed By: #libc_abi, ldionne, philnik, MaskRay

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