mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-13 17:38:39 +00:00
Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423, patch by nobled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a82e70275
commit
16c3b647eb
@ -167,7 +167,7 @@ public:
|
|||||||
|
|
||||||
unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
|
unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
|
||||||
KeyLength+1;
|
KeyLength+1;
|
||||||
unsigned Alignment = alignof<StringMapEntry>();
|
unsigned Alignment = alignOf<StringMapEntry>();
|
||||||
|
|
||||||
StringMapEntry *NewItem =
|
StringMapEntry *NewItem =
|
||||||
static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
|
static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
|
||||||
|
@ -393,7 +393,7 @@ namespace llvm {
|
|||||||
IndexListEntry *entry =
|
IndexListEntry *entry =
|
||||||
static_cast<IndexListEntry*>(
|
static_cast<IndexListEntry*>(
|
||||||
ileAllocator.Allocate(sizeof(IndexListEntry),
|
ileAllocator.Allocate(sizeof(IndexListEntry),
|
||||||
alignof<IndexListEntry>()));
|
alignOf<IndexListEntry>()));
|
||||||
|
|
||||||
new (entry) IndexListEntry(mi, index);
|
new (entry) IndexListEntry(mi, index);
|
||||||
|
|
||||||
|
@ -49,12 +49,12 @@ struct AlignOf {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// alignof - A templated function that returns the mininum alignment of
|
/// alignOf - A templated function that returns the mininum alignment of
|
||||||
/// of a type. This provides no extra functionality beyond the AlignOf
|
/// of a type. This provides no extra functionality beyond the AlignOf
|
||||||
/// class besides some cosmetic cleanliness. Example usage:
|
/// class besides some cosmetic cleanliness. Example usage:
|
||||||
/// alignof<int>() returns the alignment of an int.
|
/// alignOf<int>() returns the alignment of an int.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static inline unsigned alignof() { return AlignOf<T>::Alignment; }
|
static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
#endif
|
#endif
|
||||||
|
@ -201,7 +201,7 @@ public:
|
|||||||
char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
|
char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
|
||||||
(char *)Slab + Slab->Size;
|
(char *)Slab + Slab->Size;
|
||||||
for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
|
for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
|
||||||
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
|
Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
|
||||||
if (Ptr + sizeof(T) <= End)
|
if (Ptr + sizeof(T) <= End)
|
||||||
reinterpret_cast<T*>(Ptr)->~T();
|
reinterpret_cast<T*>(Ptr)->~T();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user