[llvm-commits] [llvm] r149343 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Chris Lattner sabre at nondot.org
Mon Jan 30 19:39:24 PST 2012


Author: lattner
Date: Mon Jan 30 21:39:24 2012
New Revision: 149343

URL: http://llvm.org/viewvc/llvm-project?rev=149343&view=rev
Log:
don't emit a 1-byte object as a .fill.  This is silly and causes
CodeGen/X86/global-sections.ll to fail with CDArray


Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=149343&r1=149342&r2=149343&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jan 30 21:39:24 2012
@@ -1615,7 +1615,9 @@
   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.





More information about the llvm-commits mailing list