From 9e49824d70714778be78a0d8ebf91486a78ce8ab Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 25 May 2003 21:59:09 +0000 Subject: [PATCH] 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 --- lib/Target/SparcV9/SparcV9AsmPrinter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp index 523e21e1642..1509fdbb94e 100644 --- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp +++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp @@ -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(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 -- 2.40.0