diff options
author | Lang Hames <lhames@gmail.com> | 2009-07-14 05:46:55 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2009-07-14 05:46:55 +0000 |
commit | d23f0d0451a4ffc0c12d7a73559fa35587ce7abb (patch) | |
tree | 739a28b8142778f07e4b32994d4e08b28dbb2009 | |
parent | 1cda87c3a07dc097f27e365f7f3ff4bcb31f5699 (diff) |
New VNInfo alignment patch by Ryan Flynn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75609 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 236ddfe4b9..21af54ffd1 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -23,6 +23,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/AlignOf.h" #include <iosfwd> #include <cassert> #include <climits> @@ -212,18 +213,6 @@ namespace llvm { /// register or value. This class also contains a bit of register allocator /// state. class LiveInterval { - private: - - inline unsigned getVNInfoAlignment(void) { -#ifdef __GNUC__ - return (unsigned)__alignof__(VNInfo); -#else - // FIXME: ugly. - return 8u; -#endif - } - - public: typedef SmallVector<LiveRange,4> Ranges; @@ -344,7 +333,7 @@ namespace llvm { "PHI def / unused flags should now be passed explicitly."); VNInfo *VNI = static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), - getVNInfoAlignment())); + alignof<VNInfo>())); new (VNI) VNInfo((unsigned)valnos.size(), MIIdx, CopyMI); VNI->setIsDefAccurate(isDefAccurate); valnos.push_back(VNI); @@ -357,7 +346,7 @@ namespace llvm { VNInfo *VNI = static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), - getVNInfoAlignment())); + alignof<VNInfo>())); new (VNI) VNInfo((unsigned)valnos.size(), *orig); valnos.push_back(VNI); |