Skip to content

Commit 33b5158

Browse files
Replace usage of StringRef::find_last_of with a string literal of size one by the equivalent char literal
1 parent 2060bfc commit 33b5158

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

clang/lib/Driver/ToolChains/ZOS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void zos::Linker::ConstructJob(Compilation &C, const JobAction &JA,
143143
StringRef OutputName = Output.getFilename();
144144
// Strip away the last file suffix in presence from output name and add
145145
// a new .x suffix.
146-
size_t Suffix = OutputName.find_last_of(".");
146+
size_t Suffix = OutputName.find_last_of('.');
147147
const char *SideDeckName =
148148
Args.MakeArgString(OutputName.substr(0, Suffix) + ".x");
149149
CmdArgs.push_back("-x");

llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void AMDGPUPrintfRuntimeBindingImpl::getConversionSpecifiers(
102102
bool ArgDump = false;
103103
StringRef CurFmt = Fmt.substr(PrevFmtSpecifierIdx,
104104
CurFmtSpecifierIdx - PrevFmtSpecifierIdx);
105-
size_t pTag = CurFmt.find_last_of("%");
105+
size_t pTag = CurFmt.find_last_of('%');
106106
if (pTag != StringRef::npos) {
107107
ArgDump = true;
108108
while (pTag && CurFmt[--pTag] == '%') {

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ lookupBuiltin(StringRef DemangledCall,
163163
// the information after angle brackets and return type removed.
164164
if (BuiltinName.find('<') && BuiltinName.back() == '>') {
165165
BuiltinName = BuiltinName.substr(0, BuiltinName.find('<'));
166-
BuiltinName = BuiltinName.substr(BuiltinName.find_last_of(" ") + 1);
166+
BuiltinName = BuiltinName.substr(BuiltinName.find_last_of(' ') + 1);
167167
}
168168

169169
// Check if the extracted name begins with "__spirv_ImageSampleExplicitLod"

mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ lsp::extractSourceDocComment(llvm::SourceMgr &sourceMgr, SMLoc loc) {
8383

8484
// Pop the last line from the buffer string.
8585
auto popLastLine = [&]() -> std::optional<StringRef> {
86-
size_t newlineOffset = buffer.find_last_of("\n");
86+
size_t newlineOffset = buffer.find_last_of('\n');
8787
if (newlineOffset == StringRef::npos)
8888
return std::nullopt;
8989
StringRef lastLine = buffer.drop_front(newlineOffset).trim();

0 commit comments

Comments
 (0)