diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-10-17 22:09:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-10-17 22:09:45 +0000 |
commit | e6f2eac1711d5c5dc1c3935e9ea26dc3fec95385 (patch) | |
tree | 7cd5a934371c741b5d7afea8841994bf2fd398ad /include/llvm/ADT | |
parent | e2fc01ea8d682187df2026c5ffd6fdd2425b2ad2 (diff) | |
download | external_llvm-e6f2eac1711d5c5dc1c3935e9ea26dc3fec95385.zip external_llvm-e6f2eac1711d5c5dc1c3935e9ea26dc3fec95385.tar.gz external_llvm-e6f2eac1711d5c5dc1c3935e9ea26dc3fec95385.tar.bz2 |
Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-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 7be418d..895d62b 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); |