Skip to content

Use StringRef::find_first_of(char), etc (NFC) #92841

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
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
PluralPiece *Plural = New<PluralPiece>();
do {
Text = Text.drop_front(); // '{' or '|'
size_t End = Text.find_first_of(":");
size_t End = Text.find_first_of(':');
if (End == StringRef::npos)
Builder.PrintFatalError("expected ':' while parsing %plural");
++End;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Support/LockFileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ LockFileManager::readLockFile(StringRef LockFileName) {
StringRef Hostname;
StringRef PIDStr;
std::tie(Hostname, PIDStr) = getToken(MB.getBuffer(), " ");
PIDStr = PIDStr.substr(PIDStr.find_first_not_of(" "));
PIDStr = PIDStr.substr(PIDStr.find_first_not_of(' '));
int PID;
if (!PIDStr.getAsInteger(10, PID)) {
auto Owner = std::make_pair(std::string(Hostname), PID);
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ void applySpecificSectionMappings(RuntimeDyld &Dyld,
const FileToSectionIDMap &FileToSecIDMap) {

for (StringRef Mapping : SpecificSectionMappings) {
size_t EqualsIdx = Mapping.find_first_of("=");
size_t EqualsIdx = Mapping.find_first_of('=');
std::string SectionIDStr = std::string(Mapping.substr(0, EqualsIdx));
size_t ComaIdx = Mapping.find_first_of(",");
size_t ComaIdx = Mapping.find_first_of(',');

if (ComaIdx == StringRef::npos)
report_fatal_error("Invalid section specification '" + Mapping +
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ void MLIRDocument::getCodeActionForDiagnostic(
edit.range = lsp::Range(lsp::Position(pos.line, 0));

// Use the indent of the current line for the expected-* diagnostic.
size_t indent = line.find_first_not_of(" ");
size_t indent = line.find_first_not_of(' ');
if (indent == StringRef::npos)
indent = line.size();

Expand Down
Loading