From deffae5da123b32098914d8346bf4358a6792bdc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 11 May 2024 11:38:52 -0700 Subject: [clang] Use StringRef::operator== instead of StringRef::equals (NFC) (#91844) I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 24 under clang/ in terms of their usage. - The elimination of StringRef::equals brings StringRef closer to std::string_view, which has operator== but not equals. - S == "foo" is more readable than S.equals("foo"), especially for !Long.Expression.equals("str") vs Long.Expression != "str". --- clang/lib/Frontend/CompilerInvocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index dbb5f56..14ee02c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1969,7 +1969,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << A->getValue(); else if (Val == llvm::FunctionReturnThunksKind::Extern && - Args.getLastArgValue(OPT_mcmodel_EQ).equals("large")) + Args.getLastArgValue(OPT_mcmodel_EQ) == "large") Diags.Report(diag::err_drv_argument_not_allowed_with) << A->getAsString(Args) << Args.getLastArg(OPT_mcmodel_EQ)->getAsString(Args); -- cgit v1.1