[all-commits] [llvm/llvm-project] deffae: [clang] Use StringRef::operator== instead of Strin...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat May 11 11:39:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: deffae5da123b32098914d8346bf4358a6792bdc
      https://github.com/llvm/llvm-project/commit/deffae5da123b32098914d8346bf4358a6792bdc
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-05-11 (Sat, 11 May 2024)

  Changed paths:
    M clang/include/clang/Basic/IdentifierTable.h
    M clang/include/clang/Basic/SourceManager.h
    M clang/lib/ARCMigrate/ObjCMT.cpp
    M clang/lib/AST/PrintfFormatString.cpp
    M clang/lib/ASTMatchers/Dynamic/Marshallers.cpp
    M clang/lib/Basic/Builtins.cpp
    M clang/lib/Basic/Diagnostic.cpp
    M clang/lib/Basic/LangOptions.cpp
    M clang/lib/Basic/Targets/ARM.cpp
    M clang/lib/Basic/Targets/PPC.h
    M clang/lib/Basic/Targets/SystemZ.h
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/Format/ContinuationIndenter.cpp
    M clang/lib/Format/Format.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/lib/Frontend/ModuleDependencyCollector.cpp
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/ParseHLSL.cpp
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Sema/SemaCodeComplete.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaStmtAsm.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
    M clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
    M clang/lib/Tooling/Tooling.cpp
    M clang/tools/diagtool/ShowEnabledWarnings.cpp
    M clang/tools/diagtool/TreeView.cpp
    M clang/unittests/CodeGen/IRMatchers.h

  Log Message:
  -----------
  [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".



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list