mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Emit trailing padding on constant vectors when TargetData says that the vector
is larger than the sum of the elements (including per-element padding). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1516,6 +1516,13 @@ static void EmitGlobalConstantVector(const ConstantVector *CV,
|
||||
unsigned AddrSpace, AsmPrinter &AP) {
|
||||
for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
|
||||
EmitGlobalConstantImpl(CV->getOperand(i), AddrSpace, AP);
|
||||
|
||||
const TargetData &TD = *AP.TM.getTargetData();
|
||||
unsigned Size = TD.getTypeAllocSize(CV->getType());
|
||||
unsigned EmittedSize = TD.getTypeAllocSize(CV->getType()->getElementType()) *
|
||||
CV->getType()->getNumElements();
|
||||
if (unsigned Padding = Size - EmittedSize)
|
||||
AP.OutStreamer.EmitZeros(Padding, AddrSpace);
|
||||
}
|
||||
|
||||
static void EmitGlobalConstantStruct(const ConstantStruct *CS,
|
||||
|
Reference in New Issue
Block a user