[PATCH] D102015: [clang CodeGen] Don't crash on large atomic function parameter.

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 12:21:44 PDT 2021


efriedma added a comment.

In D102015#2748441 <https://reviews.llvm.org/D102015#2748441>, @efriedma wrote:

>> ...I'm confused about why this code is doing what it's doing with cleanups, though.  Why does it only apply when the parameter is indirect?  I believe `isParamDestroyedInCallee()` can apply to types that are passed in other ways, so where we pushing the destructor for those, and why isn't it good enough to handle this case as well?
>
> Objects with a non-trivial destructor end up indirect anyway under the normal ABI rules.  Not sure how it interacts with trivial_abi; I'll look into it.

Figured it out.  "isIndirect()" here doesn't mean the same thing that it means in ABIArgInfo.  If `hasScalarEvaluationKind(Ty)` is false, the caller ensures the value is "isIndirect()", i.e. on the stack.  It doesn't matter if the value was actually passed in registers.

It's not immediately obvious to me why the responsibility for creating stack temporaries was split this way, but it's not really relevant to this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102015



More information about the cfe-commits mailing list