Minor cosmetic cleanups in the calculation of alignments for
authorTed Kremenek <kremenek@apple.com>
Wed, 17 Oct 2007 22:09:45 +0000 (22:09 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 17 Oct 2007 22:09:45 +0000 (22:09 +0000)
StringMapEntry objects.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43097 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringMap.h

index 7be418dcaab002ac5b12e2e7aadd3af7e5bab483..895d62b1e61bb43fe329130c51b210af1c79e2b0 100644 (file)
@@ -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);