Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

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.

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.
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Nov 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2025

@llvm/pr-subscribers-mlir-core

Author: Kazu Hirata (kazutakahirata)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/166128.diff

1 Files Affected:

  • (modified) mlir/lib/AsmParser/Parser.cpp (+2-2)
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index 82bdb844480f1..6c1fde4b9542c 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, llvm::ArrayRef(intValue.getRawData(),
+                                                      intValue.getNumWords()));
   result.emplace(semantics, truncatedValue);
   return success();
 }

@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2025

@llvm/pr-subscribers-mlir

Author: Kazu Hirata (kazutakahirata)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/166128.diff

1 Files Affected:

  • (modified) mlir/lib/AsmParser/Parser.cpp (+2-2)
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp
index 82bdb844480f1..6c1fde4b9542c 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, llvm::ArrayRef(intValue.getRawData(),
+                                                      intValue.getNumWords()));
   result.emplace(semantics, truncatedValue);
   return success();
 }

@kazutakahirata kazutakahirata merged commit 2458e15 into llvm:main Nov 3, 2025
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251102_APInt_deprecate_mlir branch November 3, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mlir:core MLIR Core Infrastructure mlir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants