[all-commits] [llvm/llvm-project] 298ace: [TableGen] Use std::string::find (NFC) (#139681)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Tue May 13 15:50:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 298ace7dff4f612e1d7dbf7bc18c32ee6c6c774b
      https://github.com/llvm/llvm-project/commit/298ace7dff4f612e1d7dbf7bc18c32ee6c6c774b
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M llvm/lib/TableGen/Record.cpp

  Log Message:
  -----------
  [TableGen] Use std::string::find (NFC) (#139681)

This patch partially reverts #139661 for a better solution.
Specifically, we can take advantage of the fact that std::string::find
accepts anything that can be converted to std::string_view, including
StringRef, starting with C++17.  This way, we do not need to cast Val
to StringRef or LHSs->getValue() to std::string.



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