diff options
-rw-r--r-- | include/llvm/ADT/StringMap.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 7be418dcaa..895d62b1e6 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -140,10 +140,12 @@ public: // Okay, the item doesn't already exist, and 'Bucket' is the bucket to fill // in. Allocate a new item with space for the string at the end and a null // terminator. + unsigned AllocSize = sizeof(StringMapEntry)+KeyLength+1; - - StringMapEntry *NewItem = static_cast<StringMapEntry*>( - Allocator.Allocate(AllocSize, AlignOf<StringMapEntry>::Alignment)); + unsigned Alignment = alignof<StringMapEntry>(); + + StringMapEntry *NewItem = + static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment)); // Default construct the value. new (NewItem) StringMapEntry(KeyLength); |