diff options
author | Fangrui Song <maskray@google.com> | 2018-03-23 17:26:12 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-03-23 17:26:12 +0000 |
commit | c244a15801b2f9a679c188cd13e101a9cfbd2b9c (patch) | |
tree | 8c82b4c08442957370d20bdbfc2dd079d347ad38 /llvm/lib/Support/APInt.cpp | |
parent | c98802de09837de0d0a0b2f57c157be92b741291 (diff) | |
download | bcm5719-llvm-c244a15801b2f9a679c188cd13e101a9cfbd2b9c.tar.gz bcm5719-llvm-c244a15801b2f9a679c188cd13e101a9cfbd2b9c.zip |
[ADT] Simplify getMemory. NFC
llvm-svn: 328334
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 48b9613b3ec..603648b002b 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -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. |