[PATCH] D104663: [OpaquePtr] Remove checking pointee type for byval/preallocated type

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 12:16:09 PDT 2021


aeubanks added a comment.

CallBase::isByValArgument() and CallBase::getParamByValType() are *always* used together, so they need to match. We need to make sure that if isByValArgument() returns true, then getParamByValType() returns a non-null Type. Either we go down this route and preserve existing behavior, or we only look at the argument attributes, which is a change in behavior. For now I'd like to preserve existing behavior.

We could try to define whether or not mismatched byval parameter vs argument attributes is UB or not, but that's not what this patch is about. (I think currently the answer is that it's not, and we typically look at both the call instruction and the callee) I'll update the description to not say that it's "arguably incorrect" since currently it's not.

As for preallocated, my stance is still the same. It's not in used at all anywhere (I'm the person who implemented it but never got around to finishing it up). It's a lot of work to setup a preallocated call that it's very hard to forget the argument attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104663



More information about the llvm-commits mailing list