mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Remove two uses of the gcc specific 'aligned' attribute. This
is partly because this attribute caused trouble in the past (the SmallVector one had to be changed from aligned to aligned(8) due to causing crashes on i386 for example; in theory the same might be needed in the Allocator case...). But it's mostly because there seems to be no point in special casing gcc here. Using the same implementation for all compilers results in better testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e956f7e3e
commit
75e2016f02
@ -59,17 +59,11 @@ protected:
|
|||||||
// something else. An array of char would work great, but might not be
|
// something else. An array of char would work great, but might not be
|
||||||
// aligned sufficiently. Instead, we either use GCC extensions, or some
|
// aligned sufficiently. Instead, we either use GCC extensions, or some
|
||||||
// number of union instances for the space, which guarantee maximal alignment.
|
// number of union instances for the space, which guarantee maximal alignment.
|
||||||
struct U {
|
union U {
|
||||||
#ifdef __GNUC__
|
double D;
|
||||||
char X __attribute__((aligned(8)));
|
long double LD;
|
||||||
#else
|
long long L;
|
||||||
union {
|
void *P;
|
||||||
double D;
|
|
||||||
long double LD;
|
|
||||||
long long L;
|
|
||||||
void *P;
|
|
||||||
} X;
|
|
||||||
#endif
|
|
||||||
} FirstEl;
|
} FirstEl;
|
||||||
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
|
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
|
||||||
|
|
||||||
|
@ -221,16 +221,12 @@ public:
|
|||||||
inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
|
inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
|
||||||
struct S {
|
struct S {
|
||||||
char c;
|
char c;
|
||||||
#ifdef __GNUC__
|
|
||||||
char x __attribute__((aligned));
|
|
||||||
#else
|
|
||||||
union {
|
union {
|
||||||
double D;
|
double D;
|
||||||
long double LD;
|
long double LD;
|
||||||
long long L;
|
long long L;
|
||||||
void *P;
|
void *P;
|
||||||
} x;
|
} x;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
return Allocator.Allocate(Size, std::min((size_t)llvm::NextPowerOf2(Size),
|
return Allocator.Allocate(Size, std::min((size_t)llvm::NextPowerOf2(Size),
|
||||||
offsetof(S, x)));
|
offsetof(S, x)));
|
||||||
|
Loading…
Reference in New Issue
Block a user