aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-31 03:39:24 +0000
committerChris Lattner <sabre@nondot.org>2012-01-31 03:39:24 +0000
commitc63352f6336ab67cdba6d4702dc2bed5fdca1091 (patch)
tree08ba5e0c8a61255ac18d9302fa5e542a1da4aaa1 /lib/CodeGen
parent9a0b604d3382e01208a980eff63193f95324dc37 (diff)
don't emit a 1-byte object as a .fill. This is silly and causes
CodeGen/X86/global-sections.ll to fail with CDArray git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 1e55de4494..4c093665c8 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1615,7 +1615,9 @@ static void EmitGlobalConstantDataSequential(const ConstantDataSequential *CDS,
int Value = isRepeatedByteSequence(CDS, AP.TM);
if (Value != -1) {
uint64_t Bytes = AP.TM.getTargetData()->getTypeAllocSize(CDS->getType());
- return AP.OutStreamer.EmitFill(Bytes, Value, AddrSpace);
+ // Don't emit a 1-byte object as a .fill.
+ if (Bytes > 1)
+ return AP.OutStreamer.EmitFill(Bytes, Value, AddrSpace);
}
// If this can be emitted with .ascii/.asciz, emit it as such.