From aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Thu, 13 Aug 2026 06:52:15 +0800 Subject: [Support] Split APInt and APFloat ownership --- backend/lib/CodeGen/MIRParser/MIParser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backend/lib/CodeGen/MIRParser') diff --git a/backend/lib/CodeGen/MIRParser/MIParser.cpp b/backend/lib/CodeGen/MIRParser/MIParser.cpp index e38b9f1..183e6b3 100644 --- a/backend/lib/CodeGen/MIRParser/MIParser.cpp +++ b/backend/lib/CodeGen/MIRParser/MIParser.cpp @@ -116,9 +116,9 @@ namespace { Token.isKeyword("llvm_vector_register_mask"); } -[[nodiscard]] Expected parseIntegerImmediateValue(std::uint32_t BitWidth, - std::string_view Spelling) { - if (BitWidth == 0 || BitWidth > IntegerImmediate::MaxBitWidth) +[[nodiscard]] Expected parseIntegerImmediateValue(std::uint32_t BitWidth, + std::string_view Spelling) { + if (BitWidth == 0 || BitWidth > APInt::MaxBitWidth) return makeUnexpected(ErrorCode::ParseError, "typed integer width is out of range"); const bool Negative = Spelling.starts_with('-'); @@ -155,7 +155,7 @@ namespace { if (BitWidth % 64U != 0) Words.back() &= (std::uint64_t{1} << (BitWidth % 64U)) - 1U; } - return IntegerImmediate::create(BitWidth, Words); + return APInt::create(BitWidth, Words); } [[nodiscard]] std::optional minimumTypeSizeInBits(LLT Type) noexcept { @@ -1244,7 +1244,7 @@ bool MIParser::Impl::parseTypedIntegerOperand(ParsedOperand &Result) { return fail(Begin, "typed integer operand must use an 'iN' type"); std::uint64_t WideBitWidth = 0; if (!parseUnsignedDigits(TypeSpelling.substr(1), WideBitWidth) || - WideBitWidth > IntegerImmediate::MaxBitWidth) { + WideBitWidth > APInt::MaxBitWidth) { return fail(Begin, "typed integer operand has an invalid bit width"); } const auto BitWidth = static_cast(WideBitWidth); -- cgit v1.2.3