mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Bug fix: padding bytes within a structure should go after each field!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6333 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c2f0939320
commit
9e49824d70
@ -544,7 +544,7 @@ private:
|
||||
void printGlobalVariable (const GlobalVariable *GV);
|
||||
void PrintZeroBytesToPad (int numBytes);
|
||||
void printSingleConstantValue (const Constant* CV);
|
||||
void printConstantValueOnly (const Constant* CV, int numPadBytes = 0);
|
||||
void printConstantValueOnly (const Constant* CV, int numPadBytesAfter = 0);
|
||||
void printConstant (const Constant* CV, string valID = "");
|
||||
|
||||
static void FoldConstants (const Module &M,
|
||||
@ -786,13 +786,10 @@ SparcModuleAsmPrinter::PrintZeroBytesToPad(int numBytes)
|
||||
// Uses printSingleConstantValue() to print each individual value.
|
||||
void
|
||||
SparcModuleAsmPrinter::printConstantValueOnly(const Constant* CV,
|
||||
int numPadBytes /* = 0*/)
|
||||
int numPadBytesAfter /* = 0*/)
|
||||
{
|
||||
const ConstantArray *CVA = dyn_cast<ConstantArray>(CV);
|
||||
|
||||
if (numPadBytes)
|
||||
PrintZeroBytesToPad(numPadBytes);
|
||||
|
||||
if (CVA && isStringCompatible(CVA))
|
||||
{ // print the string alone and return
|
||||
toAsm << "\t" << ".ascii" << "\t" << getAsCString(CVA) << "\n";
|
||||
@ -829,6 +826,9 @@ SparcModuleAsmPrinter::printConstantValueOnly(const Constant* CV,
|
||||
}
|
||||
else
|
||||
printSingleConstantValue(CV);
|
||||
|
||||
if (numPadBytesAfter)
|
||||
PrintZeroBytesToPad(numPadBytesAfter);
|
||||
}
|
||||
|
||||
// Print a constant (which may be an aggregate) prefixed by all the
|
||||
|
Loading…
Reference in New Issue
Block a user