Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2022 19:59:32 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 9d27f016c7a1 - stable/12 - Fix llvm build after 1b3bef43e3cb, due to API change
Message-ID:  <202203231959.22NJxWH5021341@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d27f016c7a1c76530a47c66a7fd584f3221db62

commit 9d27f016c7a1c76530a47c66a7fd584f3221db62
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-03-19 23:12:58 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-03-23 19:57:33 +0000

    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)
---
 contrib/llvm-project/llvm/lib/IR/Operator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203231959.22NJxWH5021341>