summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-09-24 17:34:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-09-24 17:34:29 +0000
commitd44f9f2ff88cd03e3f944ecdd6373737d5acdb90 (patch)
tree670adc8506299dfd0ef486b906c0cc9a6b6b4a72 /lib/Analysis
parent085e23841e9c4f4682385fce456704a5f75f9cdc (diff)
downloadllvm-d44f9f2ff88cd03e3f944ecdd6373737d5acdb90.tar.gz
llvm-d44f9f2ff88cd03e3f944ecdd6373737d5acdb90.tar.bz2
llvm-d44f9f2ff88cd03e3f944ecdd6373737d5acdb90.tar.xz
MemoryBuiltins: Reinstate optimizing (uninitialized) loads from operator new.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/MemoryBuiltins.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp
index b904cb188c..0db603b874 100644
--- a/lib/Analysis/MemoryBuiltins.cpp
+++ b/lib/Analysis/MemoryBuiltins.cpp
@@ -31,12 +31,12 @@
using namespace llvm;
enum AllocType {
- MallocLike = 1<<0, // allocates
- CallocLike = 1<<1, // allocates + bzero
- ReallocLike = 1<<2, // reallocates
- StrDupLike = 1<<3,
- OpNewLike = 1<<4, // allocates; never returns null
- AllocLike = MallocLike | CallocLike | StrDupLike | OpNewLike,
+ OpNewLike = 1<<0, // allocates; never returns null
+ MallocLike = 1<<1 | OpNewLike, // allocates; may return null
+ CallocLike = 1<<2, // allocates + bzero
+ ReallocLike = 1<<3, // reallocates
+ StrDupLike = 1<<4,
+ AllocLike = MallocLike | CallocLike | StrDupLike,
AnyAlloc = AllocLike | ReallocLike
};
@@ -118,7 +118,7 @@ static const AllocFnsTy *getAllocationData(const Value *V, AllocType AllocTy,
return 0;
const AllocFnsTy *FnData = &AllocationFnData[i];
- if ((FnData->AllocTy & AllocTy) == 0)
+ if ((FnData->AllocTy & AllocTy) != FnData->AllocTy)
return 0;
// Check function prototype.