[llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp
Vikram Adve
vadve at cs.uiuc.edu
Sun May 25 17:00:07 PDT 2003
Changes in directory llvm/lib/Target/Sparc:
EmitAssembly.cpp updated: 1.74 -> 1.75
---
Log message:
Bug fix: padding bytes within a structure should go after each field!
---
Diffs of the changes:
Index: llvm/lib/Target/Sparc/EmitAssembly.cpp
diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.74 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.75
--- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.74 Tue May 20 15:32:23 2003
+++ llvm/lib/Target/Sparc/EmitAssembly.cpp Sun May 25 16:59:09 2003
@@ -544,7 +544,7 @@
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 @@
// 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 @@
}
else
printSingleConstantValue(CV);
+
+ if (numPadBytesAfter)
+ PrintZeroBytesToPad(numPadBytesAfter);
}
// Print a constant (which may be an aggregate) prefixed by all the
More information about the llvm-commits
mailing list