diff options
author | Philip Reames <listmail@philipreames.com> | 2016-01-04 22:49:23 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-01-04 22:49:23 +0000 |
commit | 2466719e448d7c010407a758cd7dc1d3ce9c959a (patch) | |
tree | 4a0a0afb4a330edc4f8b1de1b64b58f9da0ae6fc /llvm/lib/Analysis/MemoryBuiltins.cpp | |
parent | bd364ce6945829b3ca124d4f1600ec5c6ec0cc80 (diff) | |
download | bcm5719-llvm-2466719e448d7c010407a758cd7dc1d3ce9c959a.tar.gz bcm5719-llvm-2466719e448d7c010407a758cd7dc1d3ce9c959a.zip |
[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling
This patch removes the isOperatorNewLike predicate since it was only being used to establish a non-null return value and we have attributes specifically for that purpose with generic handling. To keep approximate the same behaviour for existing frontends, I added the various operator new like (i.e. instances of operator new) to InferFunctionAttrs. It's not really clear to me why this isn't handled in Clang, but I didn't want to break existing code and any subtle assumptions it might have.
Once this patch is in, I'm going to start separating the isAllocLike family of predicates. These appear to be being used for a mixture of things which should be more clearly separated and documented. Today, they're being used to indicate (at least) aliasing facts, CSE-ability, and default values from an allocation site.
Differential Revision: http://reviews.llvm.org/D15820
llvm-svn: 256787
Diffstat (limited to 'llvm/lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index b19ecadd316..9e896aed0dc 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -187,13 +187,6 @@ bool llvm::isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI, return getAllocationData(V, AllocLike, TLI, LookThroughBitCast); } -/// \brief Tests if a value is a call or invoke to a library function that -/// allocates memory and never returns null (such as operator new). -bool llvm::isOperatorNewLikeFn(const Value *V, const TargetLibraryInfo *TLI, - bool LookThroughBitCast) { - return getAllocationData(V, OpNewLike, TLI, LookThroughBitCast); -} - /// extractMallocCall - Returns the corresponding CallInst if the instruction /// is a malloc call. Since CallInst::CreateMalloc() only creates calls, we /// ignore InvokeInst here. |