[llvm] [LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (PR #109133)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 23:50:37 PDT 2024
kazutakahirata wrote:
> @kazutakahirata what do you think?
Great idea! Thank you for cleaning this up! The use of `std::nullopt` for `ArrayRef` is a historical artifact. We used to have `llvm::None` for `llvm::Optional`, and we used `llvm::None` for empty `ArrayRef`, too. It's a bad idea to use `std::nullopt` for anything other than empty `std::optional`.
https://github.com/llvm/llvm-project/pull/109133
More information about the llvm-commits
mailing list