[all-commits] [llvm/llvm-project] bb6df0: [llvm] Use StringRef::operator== instead of String...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Wed May 8 10:34:14 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/ADT/SmallString.h
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
    M llvm/lib/FileCheck/FileCheck.cpp
    M llvm/lib/FuzzMutate/FuzzerCLI.cpp
    M llvm/lib/LTO/LTOModule.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/DarwinAsmParser.cpp
    M llvm/lib/MC/MCSymbolXCOFF.cpp
    M llvm/lib/Object/Archive.cpp
    M llvm/lib/Object/MachOObjectFile.cpp
    M llvm/lib/Object/OffloadBinary.cpp
    M llvm/lib/ObjectYAML/COFFEmitter.cpp
    M llvm/lib/Passes/StandardInstrumentations.cpp
    M llvm/lib/ProfileData/GCOV.cpp
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/ProfileData/MemProfReader.cpp
    M llvm/lib/Support/VirtualFileSystem.cpp
    M llvm/lib/TargetParser/ARMTargetParser.cpp
    M llvm/lib/TargetParser/Triple.cpp
    M llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
    M llvm/tools/llvm-dwarfdump/Statistics.cpp
    M llvm/tools/llvm-extract/llvm-extract.cpp
    M llvm/tools/llvm-objdump/MachODump.cpp
    M llvm/tools/llvm-xray/xray-graph-diff.cpp
    M llvm/tools/llvm-yaml-numeric-parser-fuzzer/yaml-numeric-parser-fuzzer.cpp
    M llvm/unittests/ADT/StringRefTest.cpp
    M llvm/unittests/IR/VerifierTest.cpp
    M llvm/unittests/Support/MemoryBufferTest.cpp
    M llvm/unittests/Support/YAMLIOTest.cpp
    M llvm/unittests/TargetParser/CSKYTargetParserTest.cpp
    M llvm/unittests/TargetParser/TargetParserTest.cpp
    M llvm/utils/TableGen/AsmMatcherEmitter.cpp

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

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

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