[llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp

John Criswell criswell at cs.uiuc.edu
Mon Feb 9 16:16:02 PST 2004


Changes in directory llvm/lib/Target/Sparc:

EmitAssembly.cpp updated: 1.101 -> 1.102

---
Log message:

Fix PR#226: When emitting padding, always emit it as bytes.  Bytes can be
placed into any alignment situation.



---
Diffs of the changes:  (+5 -8)

Index: llvm/lib/Target/Sparc/EmitAssembly.cpp
diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.101 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.102
--- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.101	Thu Jan 15 16:44:19 2004
+++ llvm/lib/Target/Sparc/EmitAssembly.cpp	Mon Feb  9 16:15:33 2004
@@ -184,14 +184,11 @@
     }
 
     void PrintZeroBytesToPad(int numBytes) {
-      for (/* no init */; numBytes >= 8; numBytes -= 8)
-        printSingleConstantValue(Constant::getNullValue(Type::ULongTy));
-
-      if (numBytes >= 4) {
-        printSingleConstantValue(Constant::getNullValue(Type::UIntTy));
-        numBytes -= 4;
-      }
-
+      //
+      // Always use single unsigned bytes for padding.  We don't know upon
+      // what data size the beginning address is aligned, so using anything
+      // other than a byte may cause alignment errors in the assembler.
+      //
       while (numBytes--)
         printSingleConstantValue(Constant::getNullValue(Type::UByteTy));
     }





More information about the llvm-commits mailing list