[all-commits] [llvm/llvm-project] 6023ba: [mlir] Migrate away from TypeRange(std::nullopt) (...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sun Jun 22 19:09:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6023ba2bf78918c29838f7ab79d9ba9df532a96d
      https://github.com/llvm/llvm-project/commit/6023ba2bf78918c29838f7ab79d9ba9df532a96d
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

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

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.

One of the uses of std::nullopt is in a the constructors for
TypeRange.  This patch takes care of the migration where we need
TypeRange() to facilitate perfect forwarding.  Note that {} would be
ambiguous for perfecting 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