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:
Chris Lattner 2010-10-30 05:14:01 +00:00
parent 9a82e70275
commit 16c3b647eb
4 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ public:
unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
KeyLength+1;
unsigned Alignment = alignof<StringMapEntry>();
unsigned Alignment = alignOf<StringMapEntry>();
StringMapEntry *NewItem =
static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));

View File

@ -393,7 +393,7 @@ namespace llvm {
IndexListEntry *entry =
static_cast<IndexListEntry*>(
ileAllocator.Allocate(sizeof(IndexListEntry),
alignof<IndexListEntry>()));
alignOf<IndexListEntry>()));
new (entry) IndexListEntry(mi, index);

View File

@ -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
/// 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>
static inline unsigned alignof() { return AlignOf<T>::Alignment; }
static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
} // end namespace llvm
#endif

View File

@ -201,7 +201,7 @@ public:
char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
(char *)Slab + Slab->Size;
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)
reinterpret_cast<T*>(Ptr)->~T();
}