Revert r325224 "Report fatal error in the case of out of memory"

It caused fails on some buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Serge Pavlov
2018-02-15 09:45:59 +00:00
parent 9d4478cdf2
commit 165fd931ac
21 changed files with 30 additions and 101 deletions
+8 -5
View File
@@ -57,9 +57,10 @@ void StringMapImpl::init(unsigned InitSize) {
NumItems = 0;
NumTombstones = 0;
TheTable = static_cast<StringMapEntryBase **>(
std::calloc(NewNumBuckets+1,
sizeof(StringMapEntryBase **) + sizeof(unsigned)));
TheTable = (StringMapEntryBase **)calloc(NewNumBuckets+1,
sizeof(StringMapEntryBase **) +
sizeof(unsigned));
if (TheTable == nullptr)
report_bad_alloc_error("Allocation of StringMap table failed.");
@@ -218,8 +219,10 @@ unsigned StringMapImpl::RehashTable(unsigned BucketNo) {
unsigned NewBucketNo = BucketNo;
// Allocate one extra bucket which will always be non-empty. This allows the
// iterators to stop at end.
StringMapEntryBase **NewTableArray = static_cast<StringMapEntryBase **>(
std::calloc(NewSize+1, sizeof(StringMapEntryBase *) + sizeof(unsigned)));
StringMapEntryBase **NewTableArray =
(StringMapEntryBase **)calloc(NewSize+1, sizeof(StringMapEntryBase *) +
sizeof(unsigned));
if (NewTableArray == nullptr)
report_bad_alloc_error("Allocation of StringMap hash table failed.");