mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-23 21:13:02 +02:00
158e1663f3
In r325551 many calls of malloc/calloc/realloc were replaces with calls of their safe counterparts defined in the namespace llvm. There functions generate crash if memory cannot be allocated, such behavior facilitates handling of out of memory errors on Windows. If the result of *alloc function were checked for success, the function was not replaced with the safe variant. In these cases the calling function made the error handling, like: T *NewElts = static_cast<T*>(malloc(NewCapacity*sizeof(T))); if (NewElts == nullptr) report_bad_alloc_error("Allocation of SmallVector element failed."); Actually knowledge about the function where OOM occurred is useless. Moreover having a single entry point for OOM handling is convenient for investigation of memory problems. This change removes custom OOM errors handling and replaces them with calls to functions `llvm::safe_*alloc`. Declarations of `safe_*alloc` are moved to a separate include file, to avoid cyclic dependency in SmallVector.h Differential Revision: https://reviews.llvm.org/D47440 llvm-svn: 333390 |
||
---|---|---|
.. | ||
AsmWriter.cpp | ||
AttributeImpl.h | ||
Attributes.cpp | ||
AttributesCompatFunc.td | ||
AutoUpgrade.cpp | ||
BasicBlock.cpp | ||
CMakeLists.txt | ||
Comdat.cpp | ||
ConstantFold.cpp | ||
ConstantFold.h | ||
ConstantRange.cpp | ||
Constants.cpp | ||
ConstantsContext.h | ||
Core.cpp | ||
DataLayout.cpp | ||
DebugInfo.cpp | ||
DebugInfoMetadata.cpp | ||
DebugLoc.cpp | ||
DiagnosticHandler.cpp | ||
DiagnosticInfo.cpp | ||
DiagnosticPrinter.cpp | ||
DIBuilder.cpp | ||
Dominators.cpp | ||
Function.cpp | ||
Globals.cpp | ||
GVMaterializer.cpp | ||
InlineAsm.cpp | ||
Instruction.cpp | ||
Instructions.cpp | ||
IntrinsicInst.cpp | ||
IRBuilder.cpp | ||
IRPrintingPasses.cpp | ||
LegacyPassManager.cpp | ||
LLVMBuild.txt | ||
LLVMContext.cpp | ||
LLVMContextImpl.cpp | ||
LLVMContextImpl.h | ||
Mangler.cpp | ||
MDBuilder.cpp | ||
Metadata.cpp | ||
MetadataImpl.h | ||
Module.cpp | ||
ModuleSummaryIndex.cpp | ||
Operator.cpp | ||
OptBisect.cpp | ||
Pass.cpp | ||
PassManager.cpp | ||
PassRegistry.cpp | ||
ProfileSummary.cpp | ||
SafepointIRVerifier.cpp | ||
Statepoint.cpp | ||
SymbolTableListTraitsImpl.h | ||
Type.cpp | ||
TypeFinder.cpp | ||
Use.cpp | ||
User.cpp | ||
Value.cpp | ||
ValueSymbolTable.cpp | ||
Verifier.cpp |