mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[ADT] Simplify getMemory. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -33,8 +33,7 @@ using namespace llvm;
|
||||
/// A utility function for allocating memory, checking for allocation failures,
|
||||
/// and ensuring the contents are zeroed.
|
||||
inline static uint64_t* getClearedMemory(unsigned numWords) {
|
||||
uint64_t * result = new uint64_t[numWords];
|
||||
assert(result && "APInt memory allocation fails!");
|
||||
uint64_t *result = new uint64_t[numWords];
|
||||
memset(result, 0, numWords * sizeof(uint64_t));
|
||||
return result;
|
||||
}
|
||||
@@ -42,9 +41,7 @@ inline static uint64_t* getClearedMemory(unsigned numWords) {
|
||||
/// A utility function for allocating memory and checking for allocation
|
||||
/// failure. The content is not zeroed.
|
||||
inline static uint64_t* getMemory(unsigned numWords) {
|
||||
uint64_t * result = new uint64_t[numWords];
|
||||
assert(result && "APInt memory allocation fails!");
|
||||
return result;
|
||||
return new uint64_t[numWords];
|
||||
}
|
||||
|
||||
/// A utility function that converts a character to a digit.
|
||||
|
||||
Reference in New Issue
Block a user