summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-11-30 10:01:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-11-30 10:01:11 +0000
commite6ba5efa80465f27463af3146ae59144a06742d1 (patch)
tree9b8951c50c28f9bfb829a5a99bd1d3fc5d79799b /llvm
parentd13634016677b003369f7cba919496ed7fe75870 (diff)
downloadbcm5719-llvm-e6ba5efa80465f27463af3146ae59144a06742d1.tar.gz
bcm5719-llvm-e6ba5efa80465f27463af3146ae59144a06742d1.zip
Apply clang-tidy's 'performance-faster-string-find' check to LLVM.
No functionality change intended. llvm-svn: 288235
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Support/SpecialCaseList.cpp2
-rw-r--r--llvm/tools/gold/gold-plugin.cpp2
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp2
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp2
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 6feda9de83f..62dcafefd88 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/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/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index ed8d00256e7..ef021034401 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/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/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 153e5ed2427..0a9807ab003 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/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/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 4d4e39000b8..4e1caa0400f 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/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/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp
index 792aad87311..4e9f182589b 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.cpp
+++ b/llvm/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())
OpenPOWER on IntegriCloud