]> granicus.if.org Git - llvm/commit
[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the...
authorCraig Topper <craig.topper@gmail.com>
Tue, 18 Apr 2017 21:43:46 +0000 (21:43 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 18 Apr 2017 21:43:46 +0000 (21:43 +0000)
commita8fe21d79ae6b46b0a5ed2eb1bb3f0e4be20445f
tree6c1b2422cc77caf21f806c09d7c8b8ad37e67f18
parent0b4630581a4f9bef8ca7fe45fb7c01c13add1393
[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the same time

BasicAA wants to know if a function is either a malloc or calloc like function. Currently we have to check both separately. This means both calls check if its an intrinsic, query TLI, check the nobuiltin attribute, scan the AllocationFnData, etc.

This patch adds a isMallocOrCallocLikeFn so we can go through all of the checks once per call.

This also changes the one other location I saw that called both together.

Differential Revision: https://reviews.llvm.org/D32188

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300608 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/MemoryBuiltins.h
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFLGraph.h
lib/Analysis/MemoryBuiltins.cpp