mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
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
This commit is contained in:
parent
601f5cfed9
commit
9080aaba0b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user