diff options
| author | John Criswell <criswell@uiuc.edu> | 2004-02-09 22:15:33 +0000 |
|---|---|---|
| committer | John Criswell <criswell@uiuc.edu> | 2004-02-09 22:15:33 +0000 |
| commit | 4dc5478fbcc4d1606493d69b68c483afd22baa3c (patch) | |
| tree | be8487d33935d476575fbda85187bca6af22db0b /llvm/lib/Target/Sparc/EmitAssembly.cpp | |
| parent | 24fa566960c9c9225ec6d922a162d1095dcb72e9 (diff) | |
| download | bcm5719-llvm-4dc5478fbcc4d1606493d69b68c483afd22baa3c.tar.gz bcm5719-llvm-4dc5478fbcc4d1606493d69b68c483afd22baa3c.zip | |
Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
placed into any alignment situation.
llvm-svn: 11247
Diffstat (limited to 'llvm/lib/Target/Sparc/EmitAssembly.cpp')
| -rw-r--r-- | llvm/lib/Target/Sparc/EmitAssembly.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Target/Sparc/EmitAssembly.cpp b/llvm/lib/Target/Sparc/EmitAssembly.cpp index 5bb2ee62e8d..863ffd7007a 100644 --- a/llvm/lib/Target/Sparc/EmitAssembly.cpp +++ b/llvm/lib/Target/Sparc/EmitAssembly.cpp @@ -184,14 +184,11 @@ namespace { } 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)); } |

