Fix llvm build after 1b3bef43e3, 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:		1b3bef43e3
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2022-03-20 00:12:58 +01:00
parent 1b3bef43e3
commit 8e72f458c6

View File

@ -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;
}