diff options
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | clang/lib/Frontend/CacheTokens.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index 72e8f68dc05..851ea25e9b1 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/lib/Frontend/CacheTokens.cpp @@ -662,7 +662,8 @@ std::pair<Offset,Offset> PTHWriter::EmitIdentifierTable() { // (2) a map from (IdentifierInfo*, Offset)* -> persistent IDs // Note that we use 'calloc', so all the bytes are 0. - PTHIdKey *IIDMap = (PTHIdKey*)calloc(idcount, sizeof(PTHIdKey)); + PTHIdKey *IIDMap = static_cast<PTHIdKey*>( + llvm::safe_calloc(idcount, sizeof(PTHIdKey))); // Create the hashtable. llvm::OnDiskChainedHashTableGenerator<PTHIdentifierTableTrait> IIOffMap; |