- User Since
- Jan 15 2018, 8:31 AM (178 w, 3 d)
Add an extra function makeThunkForSameAlternative to force old versions of
gcc to deduce the return value of the overloaded "thunk" being instantiated
before deducing the template arguments for make_array.
Mon, Jun 14
I did try to write an offsetof-based version using inheritance instead of the "common initial sequence" rule, but I am not sure how to do the necessary checks statically. The best I can see to do would be to have some dynamic ASSERTs to confirm that casting the alternative type to the base type does not change the underlying representation (i.e. if both pointers are cast to uintptr_t they are equal).
@stella.stamenova do you still think you'd be able to test this before it lands, to see if the current version of the patch works on the MSVC build bots?
Fri, Jun 4
- Clean up, rename, and document the VariantTraits interfaces
- Expose IntrusiveVariant::index() as it is already available through the traits
- Fix a bug in IntrusiveVariant comparison functions
Make Counted::~Counted non-virtual
Rebase and fix uses in PointerUnion.h
Thu, Jun 3
Thu, May 27
Wed, May 26
Try to factor out the implementation of visit to be based on specializations
of a type VariantTraits. This should make it possible to share one
implementation with other variant-like types, for example PointerUnion.
Rebase and remove incorrect comments
Mon, May 24
Fri, May 21
Thu, May 20
Wed, May 19
Rebase and do some cleanup
I see // TODO: Use GTEST_SKIP() when GTest is updated to version 1.10.0 show up in llvm/unittests/CodeGen/DIEHashTest.cpp, llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp and clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp; would you consider updating those at the same time?
Sorry for the delay in replying, you pose some very good questions and I wanted to revisit the reasoning that led me to my current approach in as thorough a way as possible (which meant it took some time, and I didn't get around to it right away).
May 18 2021
Replace constexpr functions with recursively defined templates, working around
an MSVC bug.
I also neglected to move the extra element to the end of the array, so I'll make that change when I fix the build failure on Windows
May 17 2021
- Update description to reference https://reviews.llvm.org/D99560
- Move code to fall under "Extra additions to <utility>"
May 14 2021
Add constexpr convenience variables
May 12 2021
May 11 2021
Would it be reasonable to just clean up all the types in these functions? I noted the ones I identified.
Apr 30 2021
Apr 29 2021
I'm not sure who else to add, please feel free to update the reviewers
Apr 19 2021
Apr 16 2021
- Change title, "std::" -> "llvm::"
- Use TYPED_TEST instead of a bespoke macro
Fix a typo in the description
- Rename STLShims -> STLForwardCompat
- Change "STL types" -> "STL features"
Remove SHIM macro; it wasn't actually doing anything (there was a typo in the
lint identifier), it seems like clang-tidy just ignored the identifier when it
was wrapped in a macro.
I tried to write a version in https://reviews.llvm.org/D100670 that perfectly-forwards each argument to the (overload resolution selected) constructor of the remove_cvref type of the argument. I ended up doing this after I had already started moving some other things out of STLExtras.h, so the patch currently depends on https://reviews.llvm.org/D100670 and https://reviews.llvm.org/D100669 but you can equally well ignore those and makeVisitor can land first.
Moved tests to STLExtrasTest.cpp from STLShimsTest.cpp
Apr 14 2021
I think I ran into a reason to require the visitor we create be able to derive from all of its Callables: it makes it possible to transparently select the correct overload via the normal overload resolution rules, which as of C++14 and the addition of generic lambdas gives the user a way to naturally describe a "default" case.
Apr 9 2021
LGTM, thank you for bearing with me!
Apr 8 2021
Thank you, I have one remaining nit concerning RS and LiveRegs, but otherwise everything LGTM.
Apr 7 2021
I hadn't thought too much about using ADL, as pre-C++20 there is a subtle issue with ADL when the function is a template, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0846r0.html
Apr 6 2021
Apr 5 2021
To chime in on the spelling of things relative to std, I had similar questions for IntrusiveVariant in https://reviews.llvm.org/D98477
Apr 2 2021
Apr 1 2021
Mar 24 2021
- Address feedback
- Fix bug where last alternative type could not be emplaced
- Misc cleanup
Mar 19 2021
Thank you for taking a look @whisperity! I'm glad there is interest from others in the new type, I was worried at first it may be too niche of a use.
Mar 15 2021
This LGTM, thank you!
Mar 11 2021
Mar 10 2021
Thank you for coming up with a way to test the change! It LGTM.