[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 11:09:24 PDT 2021


efriedma added a comment.

In D102015#2743634 <https://reviews.llvm.org/D102015#2743634>, @rjmccall wrote:

> Objective-C object types also have aggregate evaluation kind.  Those can only be used as value types in an old, fragile ObjC ABI, but I believe we haven't yet formally decided to remove support for that.  Fortunately, however, there's a much better simplification available: this `hasAggregateEvaluationKind(Ty)` call is literally doing nothing that couldn't just be a `getAs<RecordType>()` call, and then we don't need to worry about it.

If you're confident that only RecordTypes need to be destroyed, sure.

Did some grepping, and there's some other places using isParamDestroyedInCallee(); I'll make sure they're also okay.

> ...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.


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