mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
placed into any alignment situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
56e670557f
commit
ccb2a677af
1 file changed
+5
-8
@@ -184,14 +184,11 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PrintZeroBytesToPad(int numBytes) {
|
void PrintZeroBytesToPad(int numBytes) {
|
||||||
for (/* no init */; numBytes >= 8; numBytes -= 8)
|
//
|
||||||
printSingleConstantValue(Constant::getNullValue(Type::ULongTy));
|
// Always use single unsigned bytes for padding. We don't know upon
|
||||||
|
// what data size the beginning address is aligned, so using anything
|
||||||
if (numBytes >= 4) {
|
// other than a byte may cause alignment errors in the assembler.
|
||||||
printSingleConstantValue(Constant::getNullValue(Type::UIntTy));
|
//
|
||||||
numBytes -= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (numBytes--)
|
while (numBytes--)
|
||||||
printSingleConstantValue(Constant::getNullValue(Type::UByteTy));
|
printSingleConstantValue(Constant::getNullValue(Type::UByteTy));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user