diff options
Diffstat (limited to 'backend/lib/MIR')
| -rw-r--r-- | backend/lib/MIR/EmbeddedIR.cpp | 4 | ||||
| -rw-r--r-- | backend/lib/MIR/MIRFunctionRecordsParser.cpp | 6 | ||||
| -rw-r--r-- | backend/lib/MIR/MIRMetadataParser.cpp | 8 |
3 files changed, 7 insertions, 11 deletions
diff --git a/backend/lib/MIR/EmbeddedIR.cpp b/backend/lib/MIR/EmbeddedIR.cpp index 93cd534..25aea05 100644 --- a/backend/lib/MIR/EmbeddedIR.cpp +++ b/backend/lib/MIR/EmbeddedIR.cpp @@ -741,8 +741,8 @@ private: bool InQuote = false; for (std::size_t Position = Begin; Position < End; ++Position) { const char Character = Line[Position]; - if (InQuote && Character == '\\' && Position + 2 < End && - isHexDigit(Line[Position + 1]) && isHexDigit(Line[Position + 2])) { + if (InQuote && Character == '\\' && Position + 2 < End && isHexDigit(Line[Position + 1]) && + isHexDigit(Line[Position + 2])) { Position += 2; continue; } diff --git a/backend/lib/MIR/MIRFunctionRecordsParser.cpp b/backend/lib/MIR/MIRFunctionRecordsParser.cpp index aed6947..04857bb 100644 --- a/backend/lib/MIR/MIRFunctionRecordsParser.cpp +++ b/backend/lib/MIR/MIRFunctionRecordsParser.cpp @@ -240,16 +240,14 @@ bool MIRDocumentParser::parseFunctionRecords(const yaml::Node &Root, MachineFunc TargetNode->scalarStyle() == yaml::ScalarStyle::DoubleQuoted) { ++ContentOffset; } - const auto ErrorRange = [this, ContentOffset](std::size_t Begin, - std::size_t End = 1U) { + const auto ErrorRange = [this, ContentOffset](std::size_t Begin, std::size_t End = 1U) { return Result.Source.range(ContentOffset + Begin, ContentOffset + Begin + End); }; const auto SkipSpace = [&Text](std::size_t &Cursor) { while (Cursor < Text.size() && (Text[Cursor] == ' ' || Text[Cursor] == '\t')) ++Cursor; }; - const auto ParseNumber = [&Text, &SkipSpace](std::size_t &Cursor, - std::uint32_t &Value) { + const auto ParseNumber = [&Text, &SkipSpace](std::size_t &Cursor, std::uint32_t &Value) { SkipSpace(Cursor); const std::size_t Begin = Cursor; while (Cursor < Text.size() && Text[Cursor] >= '0' && Text[Cursor] <= '9') diff --git a/backend/lib/MIR/MIRMetadataParser.cpp b/backend/lib/MIR/MIRMetadataParser.cpp index 911edb6..63727ee 100644 --- a/backend/lib/MIR/MIRMetadataParser.cpp +++ b/backend/lib/MIR/MIRMetadataParser.cpp @@ -187,8 +187,7 @@ bool MIRDocumentParser::parseMetadata(const yaml::Node &Root, MachineFunction &F MILexer Lexer("machine-metadata", std::string(Text)); MIToken Token = Lexer.next(); - const auto LexerFailed = [this, &Lexer, DefinitionNode, &TranslateRange, - &Token]() -> bool { + const auto LexerFailed = [this, &Lexer, DefinitionNode, &TranslateRange, &Token]() -> bool { if (!Token.is(MITokenKind::Error)) return false; const auto Diagnostics = Lexer.diagnostics(); @@ -203,7 +202,7 @@ bool MIRDocumentParser::parseMetadata(const yaml::Node &Root, MachineFunction &F return LexerFailed(); }; const auto FailAtToken = [this, DefinitionNode, &TranslateRange](const MIToken &At, - std::string Message) { + std::string Message) { return fail(TranslateRange(*DefinitionNode, At.range()), std::move(Message)); }; @@ -214,8 +213,7 @@ bool MIRDocumentParser::parseMetadata(const yaml::Node &Root, MachineFunction &F if (Advance()) return true; std::uint32_t Slot = 0; - if (!Token.is(MITokenKind::IntegerLiteral) || - !parseUnsigned32(Token.integerValue(), Slot)) { + if (!Token.is(MITokenKind::IntegerLiteral) || !parseUnsigned32(Token.integerValue(), Slot)) { return FailAtToken(Token, "expected metadata id after '!'"); } if (Advance()) |
