@@ -54,11 +54,10 @@ using namespace llvm;
5454enum AllocType : uint8_t {
5555 OpNewLike = 1 <<0 , // allocates; never returns null
5656 MallocLike = 1 <<1 , // allocates; may return null
57- AlignedAllocLike = 1 <<2 , // allocates with alignment; may return null
58- CallocLike = 1 <<3 , // allocates + bzero
59- StrDupLike = 1 <<4 ,
57+ CallocLike = 1 <<2 , // allocates + bzero
58+ StrDupLike = 1 <<3 ,
6059 MallocOrOpNewLike = MallocLike | OpNewLike,
61- MallocOrCallocLike = MallocLike | OpNewLike | CallocLike | AlignedAllocLike ,
60+ MallocOrCallocLike = MallocLike | OpNewLike | CallocLike,
6261 AllocLike = MallocOrCallocLike | StrDupLike,
6362 AnyAlloc = AllocLike
6463};
@@ -310,12 +309,6 @@ static bool isMallocLikeFn(const Value *V, const TargetLibraryInfo *TLI) {
310309 return getAllocationData (V, MallocOrOpNewLike, TLI).has_value ();
311310}
312311
313- // / Tests if a value is a call or invoke to a library function that
314- // / allocates uninitialized memory with alignment (such as aligned_alloc).
315- static bool isAlignedAllocLikeFn (const Value *V, const TargetLibraryInfo *TLI) {
316- return getAllocationData (V, AlignedAllocLike, TLI).has_value ();
317- }
318-
319312// / Tests if a value is a call or invoke to a library function that
320313// / allocates zero-filled memory (such as calloc).
321314static bool isCallocLikeFn (const Value *V, const TargetLibraryInfo *TLI) {
@@ -453,8 +446,8 @@ Constant *llvm::getInitialValueOfAllocation(const Value *V,
453446 if (!Alloc)
454447 return nullptr ;
455448
456- // malloc and aligned_alloc are uninitialized (undef)
457- if (isMallocLikeFn (Alloc, TLI) || isAlignedAllocLikeFn (Alloc, TLI) )
449+ // malloc are uninitialized (undef)
450+ if (isMallocLikeFn (Alloc, TLI))
458451 return UndefValue::get (Ty);
459452
460453 // calloc zero initializes
0 commit comments