diff options
author | Nikita Popov <npopov@redhat.com> | 2022-02-10 09:45:08 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-03-23 15:51:16 +0100 |
commit | 5737ce259bf5f07976d6f0440e08acd7016a42c8 (patch) | |
tree | 2eb30741176c8a12fe5b04b54ac9e522b6573e87 /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | |
parent | 3d9485173556c4e52426bc18239c2fb423d43ac3 (diff) | |
download | llvm-5737ce259bf5f07976d6f0440e08acd7016a42c8.zip llvm-5737ce259bf5f07976d6f0440e08acd7016a42c8.tar.gz llvm-5737ce259bf5f07976d6f0440e08acd7016a42c8.tar.bz2 |
[LangRef] Allow non-power-of-two assume operand bundle
There has been a lot of confusion on this in the past (see for
example https://reviews.llvm.org/D110634 and earlier revisions),
so let's try to get some clarity here. This patch specifies that
a) specifying a non-constant assumed alignment is explicitly
allowed and b) an invalid (non-power-of-two) alignment is not UB,
but rather converts it into an assumption that the pointer is null.
This change is done for two reasons:
a) Assume operand bundles are specifically used in cases where the
alignment is not known during frontend codegen (otherwise we'd just
use an align attribute), so rejecting this case doesn't make sense.
b) At least for aligned_alloc the C standard specifies that passing
an invalid alignment results in a null pointer, not undefined
behavior.
Differential Revision: https://reviews.llvm.org/D119414
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
0 files changed, 0 insertions, 0 deletions