[Mlir-commits] [mlir] 2458e15 - [mlir] Migrate away from a soft-deprecated constructor of APInt (NFC) (#166128)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 3 08:41:22 PST 2025


Author: Kazu Hirata
Date: 2025-11-03T08:41:17-08:00
New Revision: 2458e15e5c819e90e308b28a8d96f23a3d685af1

URL: https://github.com/llvm/llvm-project/commit/2458e15e5c819e90e308b28a8d96f23a3d685af1
DIFF: https://github.com/llvm/llvm-project/commit/2458e15e5c819e90e308b28a8d96f23a3d685af1.diff

LOG: [mlir] Migrate away from a soft-deprecated constructor of APInt (NFC) (#166128)

We have:

/// Once all uses of this constructor are migrated to other
constructors,
/// consider marking this overload ""= delete" to prevent calls from
being
/// incorrectly bound to the APInt(unsigned, uint64_t, bool)
constructor.
LLVM_ABI APInt(unsigned numBits, unsigned numWords, const uint64_t
bigVal[]);

This patch migrates away from this soft-deprecated constructor.

Added: 
    

Modified: 
    mlir/lib/AsmParser/Parser.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index 82bdb844480f1..74936e32bd9d9 100644
--- a/mlir/lib/AsmParser/Parser.cpp
+++ b/mlir/lib/AsmParser/Parser.cpp
@@ -407,8 +407,8 @@ Parser::parseFloatFromIntegerLiteral(std::optional<APFloat> &result,
                      "hexadecimal float constant out of range for type");
   }
 
-  APInt truncatedValue(typeSizeInBits, intValue.getNumWords(),
-                       intValue.getRawData());
+  APInt truncatedValue(typeSizeInBits,
+                       ArrayRef(intValue.getRawData(), intValue.getNumWords()));
   result.emplace(semantics, truncatedValue);
   return success();
 }


        


More information about the Mlir-commits mailing list