[PATCH] D116971: [AttributorAttributes] Remove hardcoded parameters

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 08:08:04 PST 2022


reames added a comment.

There are some parts of this which look obviously correct, and a couple that I don't understand and want to leave to @jdoerfert.  Bryce, do you mind if I split and land a few pieces of this so you can rebase leaving only the interesting parts?

If so, please confirm again that this is intended for contribution and you agree to the license terms.  (You should probably just email Chris for commit rights...)



================
Comment at: llvm/lib/Analysis/MemoryBuiltins.cpp:314
+llvm::getAllocSizeArgs(const CallBase *V, const TargetLibraryInfo *TLI) {
+  assert((isMallocOrCallocLikeFn(V, TLI) || isReallocLikeFn(V, TLI)) &&
+         "getAllocSizeArgs can only be called on an allocation function that "
----------------
Please replace this with assert(isAllocationFn()).  There's no reason we can't return a result for e.g. op new.  The current client won't use it, but we should be generic.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116971



More information about the llvm-commits mailing list