Description
As implemented in https://reviews.llvm.org/D119017 and https://reviews.llvm.org/D114732, the __is_trivially_relocatable
type trait is built on top of canPassInRegisters
, which was never meant to implement this type trait:
llvm-project/clang/lib/AST/Type.cpp
Line 2649 in e90ec58
canPassInRegisters
is full of various size checks that have nothing to do with trivial relocatability:
llvm-project/clang/lib/Sema/SemaDeclCXX.cpp
Lines 6909 to 6915 in 340d746
This means __is_trivial_relocatability
doesn't work correctly on Windows or PS4.
There are extensive comments on the original review which I haven't read through, but it seems like the proper solution is to track trivial relocatability as a type trait, and then use that to inform whether things get passed in registers.
I think (at risk of misremembering) that I suggested the name of "canPassInRegisters", and what I think I had in mind is that we should name it something intentionally hyper-specific and low-level so that folks don't rely on it for any other purpose, but I guess that didn't work out as planned. I guess it wasn't that great of a plan in the first place.