[all-commits] [llvm/llvm-project] 677ddd: [Transforms] Use StringRef::operator== instead of ...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat May 4 12:33:34 PDT 2024


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

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/lib/Transforms/IPO/BlockExtractor.cpp
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    M llvm/lib/Transforms/Scalar/ADCE.cpp
    M llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    M llvm/lib/Transforms/Utils/LoopUnroll.cpp
    M llvm/lib/Transforms/Utils/LoopUtils.cpp
    M llvm/lib/Transforms/Utils/SymbolRewriter.cpp
    M llvm/unittests/Transforms/Utils/LocalTest.cpp

  Log Message:
  -----------
  [Transforms] Use StringRef::operator== instead of StringRef::equals (NFC) (#91072)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
  31 under llvm/ 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