From: Ted Kremenek Date: Wed, 17 Oct 2007 21:13:50 +0000 (+0000) Subject: Updated StringMap to use llvm::AlignOf to compute the alignment of map X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9080aaba0b8d4f313c70913c5a93ddd2bda22170;p=oota-llvm.git Updated StringMap to use llvm::AlignOf to compute the alignment of map entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43089 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 2dff04c5045..7be418dcaab 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -141,15 +141,9 @@ public: // in. Allocate a new item with space for the string at the end and a null // terminator. unsigned AllocSize = sizeof(StringMapEntry)+KeyLength+1; - -#ifdef __GNUC__ - unsigned Alignment = __alignof__(StringMapEntry); -#else - // FIXME: ugly. - unsigned Alignment = 8; -#endif - StringMapEntry *NewItem = - static_cast(Allocator.Allocate(AllocSize, Alignment)); + + StringMapEntry *NewItem = static_cast( + Allocator.Allocate(AllocSize, AlignOf::Alignment)); // Default construct the value. new (NewItem) StringMapEntry(KeyLength);