aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-03-19 23:12:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-03-23 19:57:49 +0000
commit4743b9623bd48ba1e6c7edc19a2cc63b43625b34 (patch)
tree2a8e7905493f0f7a006c02953ee90072bbe64359
parent420907a4387f4337e481797e96093c6bdee2fd2c (diff)
Fix llvm build after 1b3bef43e3cb, due to API change
After merging llvm commit b9ca73e1a8fd for PR 262608, it would fail to compile with: /usr/src/contrib/llvm-project/llvm/lib/IR/Operator.cpp:197:22: error: no member named 'isZero' in 'llvm::APInt' if (!IndexedSize.isZero()) { ~~~~~~~~~~~ ^ Upstream refactored their APInt class, and isZero() was one of the newer methods which did not yet exist in llvm 13.0.0. Fix this by using the older but equivalent isNullValue() method instead. Fixes: 1b3bef43e3cb MFC after: 3 days (cherry picked from commit 8e72f458c6d389870730ae0e95d28a0d8609a018)
-rw-r--r--contrib/llvm-project/llvm/lib/IR/Operator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/Operator.cpp b/contrib/llvm-project/llvm/lib/IR/Operator.cpp
index f9dbed31c44c..272c260d0111 100644
--- a/contrib/llvm-project/llvm/lib/IR/Operator.cpp
+++ b/contrib/llvm-project/llvm/lib/IR/Operator.cpp
@@ -194,7 +194,7 @@ bool GEPOperator::collectOffset(
APInt(BitWidth, DL.getTypeAllocSize(GTI.getIndexedType()));
// Insert an initial offset of 0 for V iff none exists already, then
// increment the offset by IndexedSize.
- if (!IndexedSize.isZero()) {
+ if (!IndexedSize.isNullValue()) {
VariableOffsets.insert({V, APInt(BitWidth, 0)});
VariableOffsets[V] += IndexedSize;
}