[all-commits] [llvm/llvm-project] 28f6f8: [mlir] Migrate away from std::nullopt (NFC) (#145523)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Wed Jun 25 11:49:44 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28f6f870617fa327bd7bc87eb32c70571c8233aa
      https://github.com/llvm/llvm-project/commit/28f6f870617fa327bd7bc87eb32c70571c8233aa
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-06-25 (Wed, 25 Jun 2025)

  Changed paths:
    M mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
    M mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
    M mlir/lib/Dialect/GPU/Transforms/DecomposeMemRefs.cpp
    M mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir] Migrate away from std::nullopt (NFC) (#145523)

ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

This patch migrates away from std::nullopt in favor of ArrayRef<T>()
where we use perfect forwarding.  Note that {} would be ambiguous for
perfect forwarding to work.



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