diff --git a/lib/Support/SpecialCaseList.cpp b/lib/Support/SpecialCaseList.cpp index 6feda9de83f..62dcafefd88 100644 --- a/lib/Support/SpecialCaseList.cpp +++ b/lib/Support/SpecialCaseList.cpp @@ -110,7 +110,7 @@ bool SpecialCaseList::parse(const MemoryBuffer *MB, std::string &Error) { } // 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(".*")) { Regexp.replace(pos, strlen("*"), ".*"); } diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index ed8d00256e7..ef021034401 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -203,7 +203,7 @@ namespace options { thinlto_emit_imports_files = true; } else if (opt.startswith("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"); } else if (opt.startswith("cache-dir=")) { cache_dir = opt.substr(strlen("cache-dir=")); diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index 153e5ed2427..0a9807ab003 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -742,7 +742,7 @@ int CodeCoverageTool::show(int argc, const char **argv, auto ModifiedTime = Status.getLastModificationTime(); std::string ModifiedTimeStr = to_string(ModifiedTime); - size_t found = ModifiedTimeStr.rfind(":"); + size_t found = ModifiedTimeStr.rfind(':'); ViewOpts.CreatedTimeStr = (found != std::string::npos) ? "Created: " + ModifiedTimeStr.substr(0, found) : "Created: " + ModifiedTimeStr; diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 4d4e39000b8..4e1caa0400f 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -606,7 +606,7 @@ static void remapSectionsAndSymbols(const llvm::Triple &TargetTriple, // Add dummy symbols to the memory manager. for (const auto &Mapping : DummySymbolMappings) { - size_t EqualsIdx = Mapping.find_first_of("="); + size_t EqualsIdx = Mapping.find_first_of('='); if (EqualsIdx == StringRef::npos) report_fatal_error("Invalid dummy symbol specification '" + Mapping + diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index 792aad87311..4e9f182589b 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -165,7 +165,7 @@ CGIOperandList::ParseOperandName(const std::string &Op, bool AllowWholeOp) { std::string SubOpName; // 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) { SubOpName = OpName.substr(DotIdx+1); if (SubOpName.empty())