diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:50:06 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:50:49 +0300 |
commit | d096f8d306b2b16a25f65ffb70849ca7963a0dac (patch) | |
tree | 964a9413f8cedf0218d1c65bc4238dc0313651ae /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | c2a9061ac5166e48fe85ea2b6dbce9457c964958 (diff) | |
download | llvm-d096f8d306b2b16a25f65ffb70849ca7963a0dac.zip llvm-d096f8d306b2b16a25f65ffb70849ca7963a0dac.tar.gz llvm-d096f8d306b2b16a25f65ffb70849ca7963a0dac.tar.bz2 |
[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant
Summary:
I initially encountered those assertions when trying to create
this IR `alignment` attribute from clang's `__attribute__((assume_aligned(imm)))`,
because until D72994 there is no sanity checking for the value of `imm`.
But even then, we have `llvm::Value::MaximumAlignment` constant (which is `536870912`),
which is enforced for clang attributes, and then there are some other magical constant
(`0x40000000` i.e. `1073741824` i.e. `2 * 536870912`) in
`Attribute::getWithAlignment()`/`AttrBuilder::addAlignmentAttr()`.
I strongly suspect that `0x40000000` is incorrect,
and that also should be `llvm::Value::MaximumAlignment`.
Reviewers: erichkeane, hfinkel, jdoerfert, gchatelet, courbet
Reviewed By: erichkeane
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D72998
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions