summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/EmitAssembly.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-05-25 21:59:09 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-05-25 21:59:09 +0000
commit5f36d741db0d0e06c80a59827d9805ecb73e3a1b (patch)
tree355c537f8adea6cf6da9f7cbc833349820be6d7b /llvm/lib/Target/Sparc/EmitAssembly.cpp
parent5b941461b14621ff61b8fb57bf2602c3c163c3f6 (diff)
downloadbcm5719-llvm-5f36d741db0d0e06c80a59827d9805ecb73e3a1b.tar.gz
bcm5719-llvm-5f36d741db0d0e06c80a59827d9805ecb73e3a1b.zip
Bug fix: padding bytes within a structure should go after each field!
llvm-svn: 6333
Diffstat (limited to 'llvm/lib/Target/Sparc/EmitAssembly.cpp')
-rw-r--r--llvm/lib/Target/Sparc/EmitAssembly.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/Sparc/EmitAssembly.cpp b/llvm/lib/Target/Sparc/EmitAssembly.cpp
index 523e21e1642..1509fdbb94e 100644
--- a/llvm/lib/Target/Sparc/EmitAssembly.cpp
+++ b/llvm/lib/Target/Sparc/EmitAssembly.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<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
OpenPOWER on IntegriCloud