Support printing ConstantAggregateZeros.
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 23 Nov 2004 21:10:49 +0000 (21:10 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 23 Nov 2004 21:10:49 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/SparcV8/SparcV8AsmPrinter.cpp

index 30e09ee8fdcdc3c2b4eb7ecd815eb934153053a6..80fc85b1400b7f3f47bc48731528db62c0e061ce 100644 (file)
@@ -270,6 +270,11 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
     unsigned size = TD.getTypeSize (CV->getType ());
     O << "\t.skip\t " << size << "\n";      
     return;
+  } else if (isa<ConstantAggregateZero> (CV)) {
+    unsigned size = TD.getTypeSize (CV->getType ());
+    for (unsigned i = 0; i < size; ++i)
+         O << "\t.byte 0\n";
+    return;
   }
 
   const Type *type = CV->getType();
index 30e09ee8fdcdc3c2b4eb7ecd815eb934153053a6..80fc85b1400b7f3f47bc48731528db62c0e061ce 100644 (file)
@@ -270,6 +270,11 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
     unsigned size = TD.getTypeSize (CV->getType ());
     O << "\t.skip\t " << size << "\n";      
     return;
+  } else if (isa<ConstantAggregateZero> (CV)) {
+    unsigned size = TD.getTypeSize (CV->getType ());
+    for (unsigned i = 0; i < size; ++i)
+         O << "\t.byte 0\n";
+    return;
   }
 
   const Type *type = CV->getType();