Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[TableGen] Use StringRef::substr instead of StringRef::slice (NFC) #139485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 10 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.