[Mlir-commits] [mlir] [mlir] Migrate away from a soft-deprecated constructor of APInt (NFC) (PR #166128)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Nov 2 23:38:54 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
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
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();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/166128
More information about the Mlir-commits
mailing list