mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
Apply clang-tidy's 'performance-faster-string-find' check to LLVM.
No functionality change intended. llvm-svn: 288235
This commit is contained in:
parent
fb60156d20
commit
cc27780987
@ -110,7 +110,7 @@ bool SpecialCaseList::parse(const MemoryBuffer *MB, std::string &Error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace * with .*
|
// Replace * with .*
|
||||||
for (size_t pos = 0; (pos = Regexp.find("*", pos)) != std::string::npos;
|
for (size_t pos = 0; (pos = Regexp.find('*', pos)) != std::string::npos;
|
||||||
pos += strlen(".*")) {
|
pos += strlen(".*")) {
|
||||||
Regexp.replace(pos, strlen("*"), ".*");
|
Regexp.replace(pos, strlen("*"), ".*");
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ namespace options {
|
|||||||
thinlto_emit_imports_files = true;
|
thinlto_emit_imports_files = true;
|
||||||
} else if (opt.startswith("thinlto-prefix-replace=")) {
|
} else if (opt.startswith("thinlto-prefix-replace=")) {
|
||||||
thinlto_prefix_replace = opt.substr(strlen("thinlto-prefix-replace="));
|
thinlto_prefix_replace = opt.substr(strlen("thinlto-prefix-replace="));
|
||||||
if (thinlto_prefix_replace.find(";") == std::string::npos)
|
if (thinlto_prefix_replace.find(';') == std::string::npos)
|
||||||
message(LDPL_FATAL, "thinlto-prefix-replace expects 'old;new' format");
|
message(LDPL_FATAL, "thinlto-prefix-replace expects 'old;new' format");
|
||||||
} else if (opt.startswith("cache-dir=")) {
|
} else if (opt.startswith("cache-dir=")) {
|
||||||
cache_dir = opt.substr(strlen("cache-dir="));
|
cache_dir = opt.substr(strlen("cache-dir="));
|
||||||
|
@ -742,7 +742,7 @@ int CodeCoverageTool::show(int argc, const char **argv,
|
|||||||
|
|
||||||
auto ModifiedTime = Status.getLastModificationTime();
|
auto ModifiedTime = Status.getLastModificationTime();
|
||||||
std::string ModifiedTimeStr = to_string(ModifiedTime);
|
std::string ModifiedTimeStr = to_string(ModifiedTime);
|
||||||
size_t found = ModifiedTimeStr.rfind(":");
|
size_t found = ModifiedTimeStr.rfind(':');
|
||||||
ViewOpts.CreatedTimeStr = (found != std::string::npos)
|
ViewOpts.CreatedTimeStr = (found != std::string::npos)
|
||||||
? "Created: " + ModifiedTimeStr.substr(0, found)
|
? "Created: " + ModifiedTimeStr.substr(0, found)
|
||||||
: "Created: " + ModifiedTimeStr;
|
: "Created: " + ModifiedTimeStr;
|
||||||
|
@ -606,7 +606,7 @@ static void remapSectionsAndSymbols(const llvm::Triple &TargetTriple,
|
|||||||
|
|
||||||
// Add dummy symbols to the memory manager.
|
// Add dummy symbols to the memory manager.
|
||||||
for (const auto &Mapping : DummySymbolMappings) {
|
for (const auto &Mapping : DummySymbolMappings) {
|
||||||
size_t EqualsIdx = Mapping.find_first_of("=");
|
size_t EqualsIdx = Mapping.find_first_of('=');
|
||||||
|
|
||||||
if (EqualsIdx == StringRef::npos)
|
if (EqualsIdx == StringRef::npos)
|
||||||
report_fatal_error("Invalid dummy symbol specification '" + Mapping +
|
report_fatal_error("Invalid dummy symbol specification '" + Mapping +
|
||||||
|
@ -165,7 +165,7 @@ CGIOperandList::ParseOperandName(const std::string &Op, bool AllowWholeOp) {
|
|||||||
std::string SubOpName;
|
std::string SubOpName;
|
||||||
|
|
||||||
// Check to see if this is $foo.bar.
|
// Check to see if this is $foo.bar.
|
||||||
std::string::size_type DotIdx = OpName.find_first_of(".");
|
std::string::size_type DotIdx = OpName.find_first_of('.');
|
||||||
if (DotIdx != std::string::npos) {
|
if (DotIdx != std::string::npos) {
|
||||||
SubOpName = OpName.substr(DotIdx+1);
|
SubOpName = OpName.substr(DotIdx+1);
|
||||||
if (SubOpName.empty())
|
if (SubOpName.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user