[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2023-03-02 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D138539#4164313 , @steakhal wrote: > Oh, I forgot to mention why this change breaks the equality operator of > `llvm::StringSet`. It's because the `StringMap::operator==` will try to > compare the `value` as well, which is

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2023-03-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Hm, it would be easier to use `llvm::StringMap` instead of `std::nullopt_t`, or some adhoc empty struct. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138539/new/ https://reviews.llvm.org/D138539

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2023-03-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Oh, I forgot to mention why this change breaks the equality operator of `llvm::StringSet`. It's because the `StringMap::operator==` will try to compare the `value` as well, which is of type `std::nullopt_t` and that has no equality comparison operator. Previously, the

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2023-03-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Herald added a subscriber: thopre. This patch breaks `llvm::StringSet` equality. The following code would no longer compile: llvm::StringSet LHS; llvm::StringSet RHS; bool equal = LHS == RHS; Such code might be used as gtest assertions like `EXPECT_EQ(LHS, RHS)`.

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2022-11-23 Thread Kazu Hirata via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG34bcadc38c22: Use std::nullopt_t instead of NoneType (NFC) (authored by kazu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2022-11-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:218 + explicit NameLookup(std::nullopt_t) : Data(nullptr, true) {} explicit NameLookup(std::nullptr_t) : Data(nullptr, false) {} NameLookup() : NameLookup(nullptr) {}

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2022-11-23 Thread David Blaikie via Phabricator via cfe-commits
dblaikie accepted this revision. dblaikie added a comment. This revision is now accepted and ready to land. Sounds good to me, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138539/new/ https://reviews.llvm.org/D138539

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2022-11-23 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added a reviewer: DavidSpickett. DavidSpickett added a comment. lldb parts LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138539/new/ https://reviews.llvm.org/D138539 ___ cfe-commits

[PATCH] D138539: Use std::nullopt_t instead of NoneType (NFC)

2022-11-22 Thread Kazu Hirata via Phabricator via cfe-commits
kazu created this revision. Herald added subscribers: Moerafaat, zero9178, bzcheeseman, ayermolo, sdasgup3, carlosgalvezp, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen,