LLVM: lib/Analysis/MemoryBuiltins.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "memory-builtins" |
| Enumerations | ||
|---|---|---|
| enum | AllocType : uint8_t { OpNewLike = 1<<0 , MallocLike = 1<<1 , StrDupLike = 1<<2 , MallocOrOpNewLike = MallocLike | OpNewLike , AllocLike = MallocOrOpNewLike | StrDupLike , AnyAlloc = AllocLike } |
| enum class | MallocFamily { Malloc, CPPNew, CPPNewAligned, CPPNewArray, CPPNewArrayAligned, MSVCNew, MSVCArrayNew, VecMalloc, KmpcAllocShared } |
◆ DEBUG_TYPE
#define DEBUG_TYPE "memory-builtins"
◆ AllocType
| Enumerator |
|---|
| OpNewLike |
| MallocLike |
| StrDupLike |
| MallocOrOpNewLike |
| AllocLike |
| AnyAlloc |
Definition at line 59 of file MemoryBuiltins.cpp.
◆ MallocFamily
| Enumerator |
|---|
| Malloc |
| CPPNew |
| CPPNewAligned |
| CPPNewArray |
| CPPNewArrayAligned |
| MSVCNew |
| MSVCArrayNew |
| VecMalloc |
| KmpcAllocShared |
Definition at line 68 of file MemoryBuiltins.cpp.
◆ aggregatePossibleConstantValues()
◆ aggregatePossibleConstantValuesImpl()
◆ CheckedZextOrTrunc()
When we're compiling N-bit code, and the user uses parameters that are greater than N bits (e.g.
uint64_t on a 32-bit build), we can run into trouble with APInt size issues. This function handles resizing + overflow checks for us. Check and zext or trunc I depending on IntTyBits and I's value.
Definition at line 355 of file MemoryBuiltins.cpp.
References I.
Referenced by llvm::getAllocSize().
◆ checkFnAllocKind() [1/2]
◆ checkFnAllocKind() [2/2]
◆ combinePossibleConstantValues()
◆ getAllocationData() [1/2]
◆ getAllocationData() [2/2]
◆ getAllocationDataForFunction()
Returns the allocation data for the given value if it's a call to a known allocation function.
Definition at line 177 of file MemoryBuiltins.cpp.
References AllocationFnData, AllocFnsTy::AllocTy, llvm::find_if(), AllocFnsTy::FstParam, llvm::TargetLibraryInfo::getLibFunc(), llvm::TargetLibraryInfo::has(), AllocFnsTy::NumParams, P, and AllocFnsTy::SndParam.
Referenced by getAllocationData(), getAllocationData(), llvm::getAllocationFamily(), and getAllocationSize().
◆ getAllocationSize()
◆ getAllocFnKind() [1/2]
◆ getAllocFnKind() [2/2]
◆ getCalledFunction()
Definition at line 159 of file MemoryBuiltins.cpp.
References llvm::dyn_cast(), and llvm::isa().
Referenced by llvm::orc::SpeculateQuery::findCalles(), FindPreallocatedCall(), getAllocationData(), getAllocationData(), llvm::getAllocationFamily(), getAllocationSize(), llvm::getFreedOperand(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::BasicTTIImplBase< BasicTTIImpl >::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::WebAssemblyTTIImpl::getUnrollingPreferences(), llvm::InlineAdvice::InlineAdvice(), isNoReturnDef(), and llvm::InstCombinerImpl::visitCallInst().
◆ getFreeFunctionDataForFunction()
◆ getSizeWithOverflow()
◆ mangledNameForMallocFamily()
◆ STATISTIC() [1/2]
| STATISTIC | ( | ObjectVisitorArgument | , |
|---|---|---|---|
| "Number of arguments with unsolved size and offset" | ) |
◆ STATISTIC() [2/2]
| STATISTIC | ( | ObjectVisitorLoad | , |
|---|---|---|---|
| "Number of load instructions with unsolved size and offset" | ) |