Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,

if (End) {
Parsed.push_back(New<TextPiece>(Text.slice(0, End), "diagtext"));
Text = Text.slice(End, StringRef::npos);
Text = Text.substr(End);
if (Text.empty())
break;
}
Expand All @@ -1103,7 +1103,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
// Extract the (optional) modifier.
size_t ModLength = Text.find_first_of("0123456789<{");
StringRef Modifier = Text.slice(0, ModLength);
Text = Text.slice(ModLength, StringRef::npos);
Text = Text.substr(ModLength);
ModifierType ModType = StringSwitch<ModifierType>{Modifier}
.Case("select", MT_Select)
.Case("enum_select", MT_EnumSelect)
Expand Down Expand Up @@ -1154,7 +1154,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
Text = Text.drop_front(); // Drop '<'
size_t EnumNameLen = Text.find_first_of('>');
EnumSelect->EnumName = Text.slice(0, EnumNameLen);
Text = Text.slice(EnumNameLen, StringRef::npos);
Text = Text.substr(EnumNameLen);
ExpectAndConsume(">");

if (Text[0] != '{')
Expand All @@ -1169,7 +1169,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
Text = Text.drop_front(); // '%'
size_t OptionNameLen = Text.find_first_of("{");
EnumSelect->OptionEnumNames.push_back(Text.slice(0, OptionNameLen));
Text = Text.slice(OptionNameLen, StringRef::npos);
Text = Text.substr(OptionNameLen);
} else {
EnumSelect->OptionEnumNames.push_back({});
}
Expand Down Expand Up @@ -1206,7 +1206,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
assert(!Text.empty());
Plural->OptionPrefixes.push_back(
New<TextPiece>(Text.slice(0, End), "diagtext"));
Text = Text.slice(End, StringRef::npos);
Text = Text.substr(End);
Plural->Options.push_back(
parseDiagText(Text, StopAt::PipeOrCloseBrace));
assert(!Text.empty() && "malformed %plural");
Expand Down
Loading