[libcxx-commits] [PATCH] D84200: Disable trivial weak_ptr test on ARM because it is not expected to work.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 21 09:43:56 PDT 2020


ldionne added a comment.

In D84200#2164525 <https://reviews.llvm.org/D84200#2164525>, @oontvoo wrote:

> > My point is that someone compiling for ARM will define `_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI` thinking they are getting trivial `weak_ptr` and `shared_ptr` passed in registers, but they won't (and silently so). That deception is what I think should be flagged explicitly through an error of some sort. Do you agree?
>
> I can agree that it would seem a bit misleading.
>
> I'm concerned that if we try to get into this business of flagging any potential unsupported case, we'll open a can of worms. That is, the checking here, if we were to be complete, would have to say, if the size of the struct is larger than the limit defined by the target platform, then it's an error. But how do we know what the limit is? There's the theory and there's the practice. For eg, the ARMv7 specs say it reserves 4 registers for the return value, but in practice, it looks like it allows only one (hence the 4 bytes limit). All of these heuristics may turn into an ugly hack (especially if we want to put them in libcxx).


Similarly, one could argue the same for `unique_ptr` for some unknown platform where even a pointer can't be passed by register. Ok, I guess I'm with you now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84200/new/

https://reviews.llvm.org/D84200





More information about the libcxx-commits mailing list