diff options
author | Kazu Hirata <kazu@google.com> | 2022-08-27 21:21:04 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-08-27 21:21:04 -0700 |
commit | d0f1283e6b48acb67c1f43e851f6aea2a5f2f516 (patch) | |
tree | 2f19a6f63d42677e0407efca93ae5c47b6c62efc /flang/lib | |
parent | 56ea4f9bd3d6c44f95f9b7b8639c9db043448742 (diff) | |
download | llvm-d0f1283e6b48acb67c1f43e851f6aea2a5f2f516.zip llvm-d0f1283e6b48acb67c1f43e851f6aea2a5f2f516.tar.gz llvm-d0f1283e6b48acb67c1f43e851f6aea2a5f2f516.tar.bz2 |
[flang] Simplify string comparisons (NFC)
Identified with readability-string-compare.
Diffstat (limited to 'flang/lib')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 2 | ||||
-rw-r--r-- | flang/lib/Semantics/resolve-names.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index cce4da3..88e6298 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -796,7 +796,7 @@ void CompilerInvocation::setFortranOpts() { // Add the directory supplied through -J/-module-dir to the list of search // directories - if (moduleDirJ.compare(".") != 0) + if (moduleDirJ != ".") fortranOptions.searchDirectories.emplace_back(moduleDirJ); if (frontendOptions.instrumentedParse) diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp index 8f55852..dc1fffc 100644 --- a/flang/lib/Semantics/resolve-names.cpp +++ b/flang/lib/Semantics/resolve-names.cpp @@ -1690,7 +1690,7 @@ void AttrsVisitor::SetBindNameOn(Symbol &symbol) { symbol.SetBindName(std::move(*label)); if (!oldBindName.empty()) { if (const std::string * newBindName{symbol.GetBindName()}) { - if (oldBindName.compare(*newBindName) != 0) { + if (oldBindName != *newBindName) { Say(symbol.name(), "The entity '%s' has multiple BIND names"_err_en_US); } } |