[PATCH] D80915: [FileCheck] Implement * and / operators for ExpressionValue.
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 02:46:00 PDT 2020
thopre added inline comments.
================
Comment at: llvm/lib/Support/FileCheck.cpp:286
+ // Result cannot be represented as int64_t.
+ if (ResultValue > (uint64_t)std::numeric_limits<int64_t>::max() + 1)
+ return make_error<OverflowError>();
----------------
jhenderson wrote:
> Same comment as above - I think this assumes 2's complement, which we shouldn't be assuming.
FYI: APInt already assumes 2 complement, see for example the negate method:
/// Negate this APInt in place.
void negate() {
flipAllBits();
++(*this);
}
The reason I still tried to deal with other integer representation is that I didn't want to put more 2-complement representation and using only APInt/CheckedArithmetics was more complicated IIRW.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80915/new/
https://reviews.llvm.org/D80915
More information about the llvm-commits
mailing list