New VNInfo alignment patch by Ryan Flynn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75609 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames 2009-07-14 05:46:55 +00:00
parent 1cda87c3a0
commit d23f0d0451

View File

@ -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);