[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 07:44:44 PST 2020


lebedev.ri added a comment.

In D72998#1838760 <https://reviews.llvm.org/D72998#1838760>, @davezarzycki wrote:

> I understand not wanting to have trivial dependencies on IR for values like this, but what about creating `llvm/Support/InternalLimits.h` to hold values like this, and then *either* have `llvm::Value::MaximumAlignment` derive from the constant in the new file, or `static_assert` that the internal limit constant equals `llvm::Value::MaximumAlignment`?
>
> At the very least, something in clang's IR generation logic should static_assert that the Sema constant is less than or equal to the LLVM constant.


I agree that adding such a sanity check may be a good next step,
although i don't have any great ideas where it should reside.
Feel free to submit a patch!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72998/new/

https://reviews.llvm.org/D72998





More information about the llvm-commits mailing list