diff options
author | Kazu Hirata <kazu@google.com> | 2023-03-14 18:56:06 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-03-14 18:56:07 -0700 |
commit | b595eb83e5c128ee969fb6491372438ea1974169 (patch) | |
tree | 494cc6b2ba2aacf64412f92e853be9e80614b388 /llvm/lib/FileCheck/FileCheck.cpp | |
parent | 768211f48f2d52fdd555a07f3dae8fbf1def88cc (diff) | |
download | llvm-b595eb83e5c128ee969fb6491372438ea1974169.zip llvm-b595eb83e5c128ee969fb6491372438ea1974169.tar.gz llvm-b595eb83e5c128ee969fb6491372438ea1974169.tar.bz2 |
[llvm] Use *{Set,Map}::contains (NFC)
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
-rw-r--r-- | llvm/lib/FileCheck/FileCheck.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp index ec963c2..ebebe05 100644 --- a/llvm/lib/FileCheck/FileCheck.cpp +++ b/llvm/lib/FileCheck/FileCheck.cpp @@ -493,8 +493,7 @@ Expected<NumericVariable *> Pattern::parseNumericVariableDefinition( // Detect collisions between string and numeric variables when the latter // is created later than the former. - if (Context->DefinedVariableTable.find(Name) != - Context->DefinedVariableTable.end()) + if (Context->DefinedVariableTable.contains(Name)) return ErrorDiagnostic::get( SM, Name, "string variable with name '" + Name + "' already exists"); @@ -1072,8 +1071,7 @@ bool Pattern::parsePattern(StringRef PatternStr, StringRef Prefix, // Detect collisions between string and numeric variables when the // former is created later than the latter. - if (Context->GlobalNumericVariableTable.find(Name) != - Context->GlobalNumericVariableTable.end()) { + if (Context->GlobalNumericVariableTable.contains(Name)) { SM.PrintMessage( SMLoc::getFromPointer(Name.data()), SourceMgr::DK_Error, "numeric variable with name '" + Name + "' already exists"); @@ -2753,8 +2751,7 @@ Error FileCheckPatternContext::defineCmdlineVariables( // Detect collisions between string and numeric variables when the former // is created later than the latter. - if (GlobalNumericVariableTable.find(Name) != - GlobalNumericVariableTable.end()) { + if (GlobalNumericVariableTable.contains(Name)) { Errs = joinErrors(std::move(Errs), ErrorDiagnostic::get(SM, Name, "numeric variable with name '" + |