[clang] [Clang][CIR] Replace -1ULL with std::numeric_limits in Itanium CXXABI (PR #178225)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 27 09:40:21 PST 2026
================
@@ -177,7 +172,7 @@ mlir::TypedAttr LowerItaniumCXXABI::lowerDataMemberConstant(
if (attr.isNullPtr()) {
// Itanium C++ ABI 2.3:
// A NULL pointer is represented as -1.
- memberOffset = -1ull;
+ memberOffset = std::numeric_limits<uint64_t>::max();
----------------
andykaylor wrote:
Here we should change the type of `memberOffset` to `int64_t`. As indicated by the comment in the else block, this is conceptually a `ptrdiff_t` value, but it's `ptrdiff_t` for an Itanium target, so I think it's safest to use `int64_t` directly rather than hoping the compiler's host `ptrdiff_t` aligns with that.
https://github.com/llvm/llvm-project/pull/178225
More information about the cfe-commits
mailing list