aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/StringMap.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h
index 2dff04c504..7be418dcaa 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<StringMapEntry*>(Allocator.Allocate(AllocSize, Alignment));
+
+ StringMapEntry *NewItem = static_cast<StringMapEntry*>(
+ Allocator.Allocate(AllocSize, AlignOf<StringMapEntry>::Alignment));
// Default construct the value.
new (NewItem) StringMapEntry(KeyLength);