From 16c3b647eb100fe404ee65f106d563ddef6c74b7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 30 Oct 2010 05:14:01 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/StringMap.h | 2 +- include/llvm/CodeGen/SlotIndexes.h | 2 +- include/llvm/Support/AlignOf.h | 6 +++--- include/llvm/Support/Allocator.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 4d8dd64b0bb..d047a420790 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -167,7 +167,7 @@ public: unsigned AllocSize = static_cast(sizeof(StringMapEntry))+ KeyLength+1; - unsigned Alignment = alignof(); + unsigned Alignment = alignOf(); StringMapEntry *NewItem = static_cast(Allocator.Allocate(AllocSize,Alignment)); diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index 98426f019c1..4b7721b996d 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -393,7 +393,7 @@ namespace llvm { IndexListEntry *entry = static_cast( ileAllocator.Allocate(sizeof(IndexListEntry), - alignof())); + alignOf())); new (entry) IndexListEntry(mi, index); diff --git a/include/llvm/Support/AlignOf.h b/include/llvm/Support/AlignOf.h index 6a7a1a6bd22..979e5975aa0 100644 --- a/include/llvm/Support/AlignOf.h +++ b/include/llvm/Support/AlignOf.h @@ -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() returns the alignment of an int. +/// alignOf() returns the alignment of an int. template -static inline unsigned alignof() { return AlignOf::Alignment; } +static inline unsigned alignOf() { return AlignOf::Alignment; } } // end namespace llvm #endif diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 0b7151a72c1..f3c53d14e5a 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -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()); + Ptr = Allocator.AlignPtr(Ptr, alignOf()); if (Ptr + sizeof(T) <= End) reinterpret_cast(Ptr)->~T(); }