From d23f0d0451a4ffc0c12d7a73559fa35587ce7abb Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 14 Jul 2009 05:46:55 +0000 Subject: [PATCH] New VNInfo alignment patch by Ryan Flynn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75609 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LiveInterval.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 236ddfe4b91..21af54ffd13 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 #include #include @@ -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 Ranges; @@ -344,7 +333,7 @@ namespace llvm { "PHI def / unused flags should now be passed explicitly."); VNInfo *VNI = static_cast(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), - getVNInfoAlignment())); + alignof())); 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(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), - getVNInfoAlignment())); + alignof())); new (VNI) VNInfo((unsigned)valnos.size(), *orig); valnos.push_back(VNI); -- 2.34.1