Rename alignof -> alignOf to avoid irritating C++'0x compilers,
authorChris Lattner <sabre@nondot.org>
Sat, 30 Oct 2010 05:14:01 +0000 (05:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 30 Oct 2010 05:14:01 +0000 (05:14 +0000)
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
include/llvm/CodeGen/SlotIndexes.h
include/llvm/Support/AlignOf.h
include/llvm/Support/Allocator.h

index 4d8dd64b0bb1da7cda28f547aee5f3c3554b3741..d047a420790ba805960d3c85603169ef6d4e58d6 100644 (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));
index 98426f019c194c7ccfdaf066b1b3d7dc78070b09..4b7721b996dfa9a3ae84cfdb3aad8f29bcf5b677 100644 (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);
 
index 6a7a1a6bd223b4abbd07d35811528e24d5334580..979e5975aa001a310d33eece7c0bf05b15a20888 100644 (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
index 0b7151a72c18ad387202e441f175e84fe8eb52fb..f3c53d14e5acf15c351782e5c556aa655135ddf9 100644 (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();
       }