<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/ConstantInitBuilder.cpp, branch users/nico/python-1</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>[CodeGen] Remove unnecessary casts (NFC) (#146463)</title>
<updated>2025-07-01T14:32:21+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-01T14:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb080107e4017ca49aaab1394662683359ffc39a'/>
<id>bb080107e4017ca49aaab1394662683359ffc39a</id>
<content type='text'>
Both of these functions return void.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both of these functions return void.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (#123157)</title>
<updated>2025-01-16T16:44:37+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-01-16T16:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dea4e613a05cd7d7438a365beb81998b36185ed9'/>
<id>dea4e613a05cd7d7438a365beb81998b36185ed9</id>
<content type='text'>
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect Data to be nonnull.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect Data to be nonnull.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Migrate away from PointerUnion::{is,get} (NFC) (#118600)</title>
<updated>2024-12-06T09:45:56+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-12-06T09:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=91d6e10cca4ea8d50927aba024f33c9076785d3a'/>
<id>91d6e10cca4ea8d50927aba024f33c9076785d3a</id>
<content type='text'>
Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.</pre>
</div>
</content>
</entry>
<entry>
<title> [clang] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (#94056)</title>
<updated>2024-06-27T01:35:10+00:00</updated>
<author>
<name>Oliver Hunt</name>
<email>oliver@apple.com</email>
</author>
<published>2024-06-27T01:35:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1b8ab2f08998d3220e5d95003d47bb3d7cac966b'/>
<id>1b8ab2f08998d3220e5d95003d47bb3d7cac966b</id>
<content type='text'>
Virtual function pointer entries in v-tables are signed with address
discrimination in addition to declaration-based discrimination, where an
integer discriminator the string hash (see
`ptrauth_string_discriminator`) of the mangled name of the overridden
method. This notably provides diversity based on the full signature of
the overridden method, including the method name and parameter types.
This patch introduces ItaniumVTableContext logic to find the original
declaration of the overridden method.
On AArch64, these pointers are signed using the `IA` key (the
process-independent code key.)

V-table pointers can be signed with either no discrimination, or a
similar scheme using address and decl-based discrimination. In this
case, the integer discriminator is the string hash of the mangled
v-table identifier of the class that originally introduced the vtable
pointer.
On AArch64, these pointers are signed using the `DA` key (the
process-independent data key.)

Not using discrimination allows attackers to simply copy valid v-table
pointers from one object to another. However, using a uniform
discriminator of 0 does have positive performance and code-size
implications on AArch64, and diversity for the most important v-table
access pattern (virtual dispatch) is already better assured by the
signing schemas used on the virtual functions. It is also known that
some code in practice copies objects containing v-tables with `memcpy`,
and while this is not permitted formally, it is something that may be
invasive to eliminate.

This is controlled by:
```
  -fptrauth-vtable-pointer-type-discrimination
  -fptrauth-vtable-pointer-address-discrimination
```

In addition, this provides fine-grained controls in the
ptrauth_vtable_pointer attribute, which allows overriding the default
ptrauth schema for vtable pointers on a given class hierarchy, e.g.:
```
  [[clang::ptrauth_vtable_pointer(no_authentication, no_address_discrimination, 
                                  no_extra_discrimination)]]
  [[clang::ptrauth_vtable_pointer(default_key, default_address_discrimination,
                                  custom_discrimination, 0xf00d)]]
```

The override is then mangled as a parametrized vendor extension:
```
"__vtptrauth" I
 &lt;key&gt;
 &lt;addressDiscriminated&gt;
 &lt;extraDiscriminator&gt;
E
```

To support this attribute, this patch adds a small extension to the
attribute-emitter tablegen backend.

Note that there are known areas where signing is either missing
altogether or can be strengthened. Some will be addressed in later
changes (e.g., member function pointers, some RTTI).
`dynamic_cast` in particular is handled by emitting an artificial
v-table pointer load (in a way that always authenticates it) before the
runtime call itself, as the runtime doesn't have enough information
today to properly authenticate it. Instead, the runtime is currently
expected to strip the v-table pointer.

---------

Co-authored-by: John McCall &lt;rjmccall@apple.com&gt;
Co-authored-by: Ahmed Bougacha &lt;ahmed@bougacha.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Virtual function pointer entries in v-tables are signed with address
discrimination in addition to declaration-based discrimination, where an
integer discriminator the string hash (see
`ptrauth_string_discriminator`) of the mangled name of the overridden
method. This notably provides diversity based on the full signature of
the overridden method, including the method name and parameter types.
This patch introduces ItaniumVTableContext logic to find the original
declaration of the overridden method.
On AArch64, these pointers are signed using the `IA` key (the
process-independent code key.)

V-table pointers can be signed with either no discrimination, or a
similar scheme using address and decl-based discrimination. In this
case, the integer discriminator is the string hash of the mangled
v-table identifier of the class that originally introduced the vtable
pointer.
On AArch64, these pointers are signed using the `DA` key (the
process-independent data key.)

Not using discrimination allows attackers to simply copy valid v-table
pointers from one object to another. However, using a uniform
discriminator of 0 does have positive performance and code-size
implications on AArch64, and diversity for the most important v-table
access pattern (virtual dispatch) is already better assured by the
signing schemas used on the virtual functions. It is also known that
some code in practice copies objects containing v-tables with `memcpy`,
and while this is not permitted formally, it is something that may be
invasive to eliminate.

This is controlled by:
```
  -fptrauth-vtable-pointer-type-discrimination
  -fptrauth-vtable-pointer-address-discrimination
```

In addition, this provides fine-grained controls in the
ptrauth_vtable_pointer attribute, which allows overriding the default
ptrauth schema for vtable pointers on a given class hierarchy, e.g.:
```
  [[clang::ptrauth_vtable_pointer(no_authentication, no_address_discrimination, 
                                  no_extra_discrimination)]]
  [[clang::ptrauth_vtable_pointer(default_key, default_address_discrimination,
                                  custom_discrimination, 0xf00d)]]
```

The override is then mangled as a parametrized vendor extension:
```
"__vtptrauth" I
 &lt;key&gt;
 &lt;addressDiscriminated&gt;
 &lt;extraDiscriminator&gt;
E
```

To support this attribute, this patch adds a small extension to the
attribute-emitter tablegen backend.

Note that there are known areas where signing is either missing
altogether or can be strengthened. Some will be addressed in later
changes (e.g., member function pointers, some RTTI).
`dynamic_cast` in particular is handled by emitting an artificial
v-table pointer load (in a way that always authenticates it) before the
runtime call itself, as the runtime doesn't have enough information
today to properly authenticate it. Instead, the runtime is currently
expected to strip the v-table pointer.

---------

Co-authored-by: John McCall &lt;rjmccall@apple.com&gt;
Co-authored-by: Ahmed Bougacha &lt;ahmed@bougacha.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][NFC] Remove dependency on DataLayout::getPrefTypeAlignment</title>
<updated>2023-01-13T15:01:29+00:00</updated>
<author>
<name>Guillaume Chatelet</name>
<email>gchatelet@google.com</email>
</author>
<published>2023-01-13T15:01:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bf5c17ed0f402f603782d28264dab1157994c43d'/>
<id>bf5c17ed0f402f603782d28264dab1157994c43d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part</title>
<updated>2023-01-09T11:15:24+00:00</updated>
<author>
<name>serge-sans-paille</name>
<email>sguelton@mozilla.com</email>
</author>
<published>2023-01-06T15:56:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3c248db87ebe88084386950846678c9a52dd7c0'/>
<id>a3c248db87ebe88084386950846678c9a52dd7c0</id>
<content type='text'>
This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential Revision: https://reviews.llvm.org/D141139
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential Revision: https://reviews.llvm.org/D141139
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][CodeGen] Switch a few placeholders from UndefValue to PoisonValue</title>
<updated>2022-06-12T18:07:59+00:00</updated>
<author>
<name>Nuno Lopes</name>
<email>nuno.lopes@tecnico.ulisboa.pt</email>
</author>
<published>2022-06-12T18:03:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4dd1bffc9dac02b34bd1de78808edd9a5955c987'/>
<id>4dd1bffc9dac02b34bd1de78808edd9a5955c987</id>
<content type='text'>
This change is cosmetic, as these are dummy values that are not observable, but it
gets us closer to removing undef.
NFC
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change is cosmetic, as these are dummy values that are not observable, but it
gets us closer to removing undef.
NFC
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ConstantAggregateBuilderBase::getRelativeOffset</title>
<updated>2020-06-15T19:23:20+00:00</updated>
<author>
<name>Arnold Schwaighofer</name>
<email>aschwaighofer@apple.com</email>
</author>
<published>2020-06-15T17:28:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a8120ca9fb904b50e6940457e0f891ca1fdb605'/>
<id>4a8120ca9fb904b50e6940457e0f891ca1fdb605</id>
<content type='text'>
Summary:
If a record has a mix of relative pointers and other fields they
wouldn't necessarily be the same.

Fallout from D77592.

rdar://64309883

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81857
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
If a record has a mix of relative pointers and other fields they
wouldn't necessarily be the same.

Fallout from D77592.

rdar://64309883

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81857
</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Frontend components for the relative vtables ABI (round 2)</title>
<updated>2020-06-11T18:17:08+00:00</updated>
<author>
<name>Leonard Chan</name>
<email>leonardchan@google.com</email>
</author>
<published>2020-06-11T18:17:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=71568a9e28d6aa5ed580cbedcb96634452555143'/>
<id>71568a9e28d6aa5ed580cbedcb96634452555143</id>
<content type='text'>
This patch contains all of the clang changes from D72959.

- Generalize the relative vtables ABI such that it can be used by other targets.
- Add an enum VTableComponentLayout which controls whether components in the
  vtable should be pointers to other structs or relative offsets to those structs.
  Other ABIs can change this enum to restructure how components in the vtable
  are laid out/accessed.
- Add methods to ConstantInitBuilder for inserting relative offsets to a
  specified position in the aggregate being constructed.
- Fix failing tests under new PM and ASan and MSan issues.

See D72959 for background info.

Differential Revision: https://reviews.llvm.org/D77592
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch contains all of the clang changes from D72959.

- Generalize the relative vtables ABI such that it can be used by other targets.
- Add an enum VTableComponentLayout which controls whether components in the
  vtable should be pointers to other structs or relative offsets to those structs.
  Other ABIs can change this enum to restructure how components in the vtable
  are laid out/accessed.
- Add methods to ConstantInitBuilder for inserting relative offsets to a
  specified position in the aggregate being constructed.
- Fix failing tests under new PM and ASan and MSan issues.

See D72959 for background info.

Differential Revision: https://reviews.llvm.org/D77592
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[clang] Frontend components for the relative vtables ABI"</title>
<updated>2020-06-10T20:50:05+00:00</updated>
<author>
<name>Leonard Chan</name>
<email>leonardchan@google.com</email>
</author>
<published>2020-06-10T20:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7201272d4c1b7822c11593ea3ef97bc65b647e54'/>
<id>7201272d4c1b7822c11593ea3ef97bc65b647e54</id>
<content type='text'>
This reverts commit 2e009dbcb3e373a59e6e84dce6d51ae8a29f60a5.

Reverting since there were some test failures on buildbots that used the
new pass manager. ASan and MSan are also finding some bugs in this that
I'll need to address.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 2e009dbcb3e373a59e6e84dce6d51ae8a29f60a5.

Reverting since there were some test failures on buildbots that used the
new pass manager. ASan and MSan are also finding some bugs in this that
I'll need to address.
</pre>
</div>
</content>
</entry>
</feed>
