summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-21 21:25:05 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-21 21:25:05 +0000
commit2b3e9580536dfb5666b9d91e99baebf6d45bfa5f (patch)
treee7fda8237bde8672db2d797f4327493186bc57c0 /include
parent54c5bc87992ebeaa9e71f2bfb60ac5cf74b77db3 (diff)
downloadllvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.tar.gz
llvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.tar.bz2
llvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.tar.xz
Add support for invoke to the MemoryBuiltin analysid.
Update comments accordingly. Make instcombine remove useless invokes to C++'s 'new' allocation function (test attached). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/MemoryBuiltins.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/include/llvm/Analysis/MemoryBuiltins.h b/include/llvm/Analysis/MemoryBuiltins.h
index c212bbbba1..3694f8f864 100644
--- a/include/llvm/Analysis/MemoryBuiltins.h
+++ b/include/llvm/Analysis/MemoryBuiltins.h
@@ -31,28 +31,29 @@ class Type;
class Value;
-/// \brief Tests if a value is a call to a library function that allocates or
-/// reallocates memory (either malloc, calloc, realloc, or strdup like).
+/// \brief Tests if a value is a call or invoke to a library function that
+/// allocates or reallocates memory (either malloc, calloc, realloc, or strdup
+/// like).
bool isAllocationFn(const Value *V, bool LookThroughBitCast = false);
-/// \brief Tests if a value is a call to a function that returns a NoAlias
-/// pointer (including malloc/calloc/strdup-like functions).
+/// \brief Tests if a value is a call or invoke to a function that returns a
+/// NoAlias pointer (including malloc/calloc/strdup-like functions).
bool isNoAliasFn(const Value *V, bool LookThroughBitCast = false);
-/// \brief Tests if a value is a call to a library function that allocates
-/// uninitialized memory (such as malloc).
+/// \brief Tests if a value is a call or invoke to a library function that
+/// allocates uninitialized memory (such as malloc).
bool isMallocLikeFn(const Value *V, bool LookThroughBitCast = false);
-/// \brief Tests if a value is a call to a library function that allocates
-/// zero-filled memory (such as calloc).
+/// \brief Tests if a value is a call or invoke to a library function that
+/// allocates zero-filled memory (such as calloc).
bool isCallocLikeFn(const Value *V, bool LookThroughBitCast = false);
-/// \brief Tests if a value is a call to a library function that allocates
-/// memory (either malloc, calloc, or strdup like).
+/// \brief Tests if a value is a call or invoke to a library function that
+/// allocates memory (either malloc, calloc, or strdup like).
bool isAllocLikeFn(const Value *V, bool LookThroughBitCast = false);
-/// \brief Tests if a value is a call to a library function that reallocates
-/// memory (such as realloc).
+/// \brief Tests if a value is a call or invoke to a library function that
+/// reallocates memory (such as realloc).
bool isReallocLikeFn(const Value *V, bool LookThroughBitCast = false);