mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Was pointed out that structure alignment and type alignment are not the same
thing. Doubles still need to be special cased. llvm-svn: 28806
This commit is contained in:
parent
7b72f6e4f0
commit
0dc7ed966c
@ -250,6 +250,9 @@ unsigned AsmPrinter::getPreferredAlignmentLog(const GlobalVariable *GV) const {
|
||||
Alignment = Log2_32(GV->getAlignment());
|
||||
|
||||
if (GV->hasInitializer()) {
|
||||
// Always round up alignment of global doubles to 8 bytes.
|
||||
if (GV->getType()->getElementType() == Type::DoubleTy && Alignment < 3)
|
||||
Alignment = 3;
|
||||
if (Alignment < 4) {
|
||||
// If the global is not external, see if it is large. If so, give it a
|
||||
// larger alignment.
|
||||
|
Loading…
Reference in New Issue
Block a user