[llvm-commits] [llvm] r43097 - /llvm/trunk/include/llvm/ADT/StringMap.h
Ted Kremenek
kremenek at apple.com
Wed Oct 17 15:09:45 PDT 2007
Author: kremenek
Date: Wed Oct 17 17:09:45 2007
New Revision: 43097
URL: http://llvm.org/viewvc/llvm-project?rev=43097&view=rev
Log:
Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects. No functionality change.
Modified:
llvm/trunk/include/llvm/ADT/StringMap.h
Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=43097&r1=43096&r2=43097&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Wed Oct 17 17:09:45 2007
@@ -140,10 +140,12 @@
// 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);
More information about the llvm-commits
mailing list