mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-15 07:33:18 +00:00
mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
default address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6113b3d323
commit
8a6d7ac88f
@ -436,7 +436,7 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
|
||||
// Emit inter-object padding for alignment.
|
||||
unsigned AlignMask = CPE.getAlignment() - 1;
|
||||
unsigned NewOffset = (Offset + AlignMask) & ~AlignMask;
|
||||
EmitZeros(NewOffset - Offset);
|
||||
OutStreamer.EmitFill(NewOffset - Offset);
|
||||
|
||||
const Type *Ty = CPE.getType();
|
||||
Offset = NewOffset + TM.getTargetData()->getTypeAllocSize(Ty);
|
||||
@ -917,8 +917,8 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV,
|
||||
///
|
||||
void AsmPrinter::EmitZeros(uint64_t NumZeros, unsigned AddrSpace) const {
|
||||
if (NumZeros == 0) return;
|
||||
if (MAI->getZeroDirective()) {
|
||||
O << MAI->getZeroDirective() << NumZeros << '\n';
|
||||
if (MAI->getZeroDirective() || AddrSpace == 0) {
|
||||
OutStreamer.EmitFill(NumZeros);
|
||||
} else {
|
||||
for (; NumZeros; --NumZeros)
|
||||
O << MAI->getData8bitsDirective(AddrSpace) << "0\n";
|
||||
@ -1417,13 +1417,11 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
||||
const Type *type = CV->getType();
|
||||
unsigned Size = TD->getTypeAllocSize(type);
|
||||
|
||||
if (CV->isNullValue() || isa<UndefValue>(CV)) {
|
||||
EmitZeros(Size, AddrSpace);
|
||||
return;
|
||||
}
|
||||
if (CV->isNullValue() || isa<UndefValue>(CV))
|
||||
return EmitZeros(Size, AddrSpace);
|
||||
|
||||
if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
|
||||
EmitGlobalConstantArray(CVA , AddrSpace);
|
||||
EmitGlobalConstantArray(CVA, AddrSpace);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -203,6 +203,8 @@ void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size) {
|
||||
/// EmitFill - Emit NumBytes bytes worth of the value specified by
|
||||
/// FillValue. This implements directives such as '.space'.
|
||||
void MCAsmStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue) {
|
||||
if (NumBytes == 0) return;
|
||||
|
||||
if (const char *ZeroDirective = MAI.getZeroDirective()) {
|
||||
OS << ZeroDirective << NumBytes;
|
||||
if (FillValue != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user