aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-10-19 08:54:02 -0700
committerKazu Hirata <kazu@google.com>2021-10-19 08:54:02 -0700
commitcf68e1b2fb4f6172b08f3430b2530dc2d193ab60 (patch)
treeebb82a66653ddbf96cd26fc1d73bd7f87b266cfc /clang/lib/Frontend/CompilerInvocation.cpp
parentb492b0be95d9134bfb092eb2c73cf6996c4518f7 (diff)
downloadllvm-cf68e1b2fb4f6172b08f3430b2530dc2d193ab60.zip
llvm-cf68e1b2fb4f6172b08f3430b2530dc2d193ab60.tar.gz
llvm-cf68e1b2fb4f6172b08f3430b2530dc2d193ab60.tar.bz2
[Driver, Frontend] Use StringRef::contains (NFC)
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 410702d..8d33a59 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -999,7 +999,7 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
diag::err_analyzer_config_no_value) << configVal;
break;
}
- if (val.find('=') != StringRef::npos) {
+ if (val.contains('=')) {
Diags.Report(SourceLocation(),
diag::err_analyzer_config_multiple_values)
<< configVal;
@@ -2061,13 +2061,13 @@ static bool ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
if (!Args.hasArg(OPT_fno_sanitize_ignorelist)) {
for (const auto *A : Args.filtered(OPT_fsanitize_ignorelist_EQ)) {
StringRef Val = A->getValue();
- if (Val.find('=') == StringRef::npos)
+ if (!Val.contains('='))
Opts.ExtraDeps.emplace_back(std::string(Val), EDK_SanitizeIgnorelist);
}
if (Opts.IncludeSystemHeaders) {
for (const auto *A : Args.filtered(OPT_fsanitize_system_ignorelist_EQ)) {
StringRef Val = A->getValue();
- if (Val.find('=') == StringRef::npos)
+ if (!Val.contains('='))
Opts.ExtraDeps.emplace_back(std::string(Val), EDK_SanitizeIgnorelist);
}
}
@@ -2084,7 +2084,7 @@ static bool ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
// Only the -fmodule-file=<file> form.
for (const auto *A : Args.filtered(OPT_fmodule_file)) {
StringRef Val = A->getValue();
- if (Val.find('=') == StringRef::npos)
+ if (!Val.contains('='))
Opts.ExtraDeps.emplace_back(std::string(Val), EDK_ModuleFile);
}
@@ -2728,7 +2728,7 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
// Only the -fmodule-file=<file> form.
for (const auto *A : Args.filtered(OPT_fmodule_file)) {
StringRef Val = A->getValue();
- if (Val.find('=') == StringRef::npos)
+ if (!Val.contains('='))
Opts.ModuleFiles.push_back(std::string(Val));
}
@@ -3003,7 +3003,7 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
// Only the -fmodule-file=<name>=<file> form.
for (const auto *A : Args.filtered(OPT_fmodule_file)) {
StringRef Val = A->getValue();
- if (Val.find('=') != StringRef::npos){
+ if (Val.contains('=')) {
auto Split = Val.split('=');
Opts.PrebuiltModuleFiles.insert(
{std::string(Split.first), std::string(Split.second)});