aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp15
-rw-r--r--lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp12
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 03672411f4..2e576b323a 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1058,12 +1058,6 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
}
}
-/// EmitZeros - Emit a block of zeros.
-///
-void AsmPrinter::EmitZeros(uint64_t NumZeros, unsigned AddrSpace) const {
- OutStreamer.EmitFill(NumZeros, 0, AddrSpace);
-}
-
/// printAsCString - Print the specified array as a C compatible string, only if
/// the predicate isString is true.
///
@@ -1134,7 +1128,7 @@ static void EmitGlobalConstantStruct(const ConstantStruct *CS,
// Insert padding - this may include padding to increase the size of the
// current field up to the ABI size (if the struct is not packed) as well
// as padding to ensure that the next field starts at the right offset.
- AP.EmitZeros(padSize, AddrSpace);
+ AP.OutStreamer.EmitZeros(padSize, AddrSpace);
}
assert(SizeSoFar == cvsLayout->getSizeInBytes() &&
"Layout of constant struct may be incorrect!");
@@ -1283,9 +1277,8 @@ void AsmPrinter::EmitGlobalConstantFP(const ConstantFP *CFP,
}
O << '\n';
}
- LLVMContext &Context = CFP->getContext();
- EmitZeros(TD.getTypeAllocSize(Type::getX86_FP80Ty(Context)) -
- TD.getTypeStoreSize(Type::getX86_FP80Ty(Context)), AddrSpace);
+ OutStreamer.EmitZeros(TD.getTypeAllocSize(CFP->getType()) -
+ TD.getTypeStoreSize(CFP->getType()), AddrSpace);
return;
}
@@ -1412,7 +1405,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
unsigned Size = TD->getTypeAllocSize(type);
if (CV->isNullValue() || isa<UndefValue>(CV))
- return EmitZeros(Size, AddrSpace);
+ return OutStreamer.EmitZeros(Size, AddrSpace);
if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV))
return EmitGlobalConstantArray(CVA, AddrSpace, *this);
diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
index 301a0e9c43..115d041a70 100644
--- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
+++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
@@ -174,15 +174,13 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
EmitGlobalConstant(C);
if (GV->isThreadLocal()) {
- for (unsigned i = 1; i < MaxThreads; ++i) {
+ for (unsigned i = 1; i < MaxThreads; ++i)
EmitGlobalConstant(C);
- }
- }
- if (Size < 4) {
- // The ABI requires that unsigned scalar types smaller than 32 bits
- // are are padded to 32 bits.
- EmitZeros(4 - Size);
}
+ // The ABI requires that unsigned scalar types smaller than 32 bits
+ // are are padded to 32 bits.
+ if (Size < 4)
+ OutStreamer.EmitZeros(4 - Size, 0);
// Mark the end of the global
O << "\t.cc_bottom " << *GVSym << ".data\n";