summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit2939dd3d1193701b8f57609554f576ba30075eb5 (patch)
treea68d3a6a68f1d1bc099cc10eae5054c503af4943 /llvm/lib/Analysis
parentedf2d9179e9fb4ef9fc6069deee9e356bd220866 (diff)
downloadbcm5719-llvm-2939dd3d1193701b8f57609554f576ba30075eb5.tar.gz
bcm5719-llvm-2939dd3d1193701b8f57609554f576ba30075eb5.zip
MemoryBuiltins: Reinstate optimizing (uninitialized) loads from operator new.
llvm-svn: 191315
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/MemoryBuiltins.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index b904cb188c4..0db603b8743 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud