[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-20 Thread Joe Loser via Phabricator via cfe-commits
jloser added a comment. Sorry for the delay here; this patch LGTM! Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139973/new/ https://reviews.llvm.org/D139973 ___ cfe-commits mailing list cfe-com

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-20 Thread Sebastian Neubauer 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 rGbb7940e25f6c: [llvm] Make llvm::Any similar to std::any (authored by sebastian-ne). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 accepted this revision. barannikov88 added a comment. In D139973#4005120 , @sebastian-ne wrote: > the question gets wether we want to keep llvm::Any around as a wrapper of > std::any once we can use it (in this case this patch would be obso

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sebastian Neubauer via Phabricator via cfe-commits
sebastian-ne added inline comments. Comment at: lldb/include/lldb/Core/RichManglingContext.h:90-91 assert(parser.has_value()); -assert(llvm::any_isa(parser)); +assert(llvm::any_cast(&parser)); return llvm::any_cast(parser); } barannikov88 wro

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sebastian Neubauer via Phabricator via cfe-commits
sebastian-ne updated this revision to Diff 483975. sebastian-ne marked 2 inline comments as done. sebastian-ne added a comment. > It is surprising to me that std::any can work without RTTI. Never thought it > could be implemented. It seems like libstdc++ and libc++ both implement it the way llvm

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added a comment. Related: https://reviews.llvm.org/D139974 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139973/new/ https://reviews.llvm.org/D139973 ___ cfe-commits mailing list cfe-commits

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added inline comments. Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:193 - if (any_isa(IR)) { -const Function *F = any_cast(IR); -return F->getName().str(); + if (const auto **F = any_cast(&IR)) { +return (*F)->getName().str();

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added a comment. In D139973#4004408 , @jsilvanus wrote: > I just checked on Godbolt that gcc 12.2 with libstdc++, clang 15.0 with both > libstd++ and libc++ and MSVC 19.33 support `std::any` without RTTI. > But gcc and clang do not provide

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Jannik Silvanus via Phabricator via cfe-commits
jsilvanus added a comment. In D139973#4004344 , @barannikov88 wrote: > - std::any uses RTTI, so it is unlikely to ever replace llvm::Any. I just checked on Godbolt that gcc 12.2 with libstdc++, clang 15.0 with both libstd++ and libc++ and MSVC 19.33 su

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added inline comments. Comment at: lldb/include/lldb/Core/RichManglingContext.h:90-91 assert(parser.has_value()); -assert(llvm::any_isa(parser)); +assert(llvm::any_cast(&parser)); return llvm::any_cast(parser); } This is not intu

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Sergei Barannikov via Phabricator via cfe-commits
barannikov88 added a comment. Just thoughts. llvm::any_isa is usually paired with llvm::any_cast; replacing them with llvm::any_cast and nullptr check seems fine. However, - std::any uses RTTI, so it is unlikely to ever replace llvm::Any. - llvm::any_isa<> is kind of convenient and is aligned w

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-19 Thread Jannik Silvanus via Phabricator via cfe-commits
jsilvanus accepted this revision. jsilvanus added a comment. This revision is now accepted and ready to land. LGTM, but let's wait for the other reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139973/new/ https://reviews.llvm.org/D139973

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-17 Thread Joe Loser via Phabricator via cfe-commits
jloser added a comment. I'm +1 for the direction here; I took a brief look but will look closely either later tonight or tomorrow before I approve. Thanks for doing this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139973/new/ https://reviews.l

[PATCH] D139973: [llvm] Make llvm::Any similar to std::any

2022-12-13 Thread Sebastian Neubauer via Phabricator via cfe-commits
sebastian-ne created this revision. sebastian-ne added reviewers: jloser, MaskRay, dblaikie, jsilvanus. Herald added subscribers: ormris, StephenFan, wenlei, hiraditya. Herald added a project: All. sebastian-ne requested review of this revision. Herald added projects: clang, LLDB, LLVM. Herald adde