diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 06:52:15 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 06:52:15 +0800 |
| commit | aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28 (patch) | |
| tree | 20d94c4debfe4900e362c6c7f8443bcfbd58ec28 /backend/lib/CodeGen/MIRParser/MIParser.cpp | |
| parent | d62f022c92fcc3ebe2269273628943a0089683fd (diff) | |
| download | rcc-project-aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28.tar.gz rcc-project-aa7c85ca71859aab15bdf1e6dc1ea3a5aa5d1e28.tar.xz | |
[Support] Split APInt and APFloat ownership
Diffstat (limited to 'backend/lib/CodeGen/MIRParser/MIParser.cpp')
| -rw-r--r-- | backend/lib/CodeGen/MIRParser/MIParser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<IntegerImmediate> parseIntegerImmediateValue(std::uint32_t BitWidth, - std::string_view Spelling) { - if (BitWidth == 0 || BitWidth > IntegerImmediate::MaxBitWidth) +[[nodiscard]] Expected<APInt> 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<std::uint64_t> 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<std::uint32_t>(WideBitWidth); |
