[PATCH] D130107: MemoryBuiltins: remove malloc-family funcs from list

Qiongsi Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 07:00:26 PDT 2022


qiongsiwu1 added a comment.

May I ask for some guidance/example on how to use the attributes to identify that the removed functions (e.g. `malloc, calloc, realloc`) are still allocation functions?

Is it true that `bool llvm::isAllocationFn` returns `false` now if the input is a `malloc` call? It seems to be so in my experiments. Is this intended? This is contradictory to the code comment <https://github.com/llvm/llvm-project/blob/bd08f413c089da5a56438cc8902f60df91a08a66/llvm/lib/Analysis/MemoryBuiltins.cpp#L295> .

Additionally, what is the recommended approach now to tell if a library function allocates memory? It seems that `bool llvm::isAllocationFn` is covering //some// functions (ones still included in the list  `AllocationFnData`), but not others (ones this patch removed). When should we use `bool llvm::isAllocationFn`? Or should we migrate to use attributes and avoid using `bool llvm::isAllocationFn`?

Thanks so much!!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130107



More information about the llvm-commits mailing list