simplify the mips target to print .size and .type for c strings
authorChris Lattner <sabre@nondot.org>
Tue, 19 Jan 2010 05:23:59 +0000 (05:23 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Jan 2010 05:23:59 +0000 (05:23 +0000)
just like all other elf targets.  Bruno, if this isn't right, please
let me know + why :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93856 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp

index c254932e96a17ec75bdbc4648412e197d1f23822..2a78de0e522d978ffe83282b5a72ccf3e82f6736 100644 (file)
@@ -438,8 +438,6 @@ void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
   Constant *C = GVar->getInitializer();
   const Type *CTy = C->getType();
   unsigned Size = TD->getTypeAllocSize(CTy);
-  const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
-  bool printSizeAndType = true;
 
   // A data structure or array is aligned in memory to the largest
   // alignment boundary required by any data type inside it (this matches
@@ -494,9 +492,7 @@ void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
    case GlobalValue::PrivateLinkage:
    case GlobalValue::LinkerPrivateLinkage:
    case GlobalValue::InternalLinkage:
-    if (CVA && CVA->isCString())
-      printSizeAndType = false;
-    break;
+      break;
    case GlobalValue::GhostLinkage:
     llvm_unreachable("Should not have any unmaterialized functions!");
    case GlobalValue::DLLImportLinkage:
@@ -509,7 +505,7 @@ void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
 
   EmitAlignment(Align, GVar);
 
-  if (MAI->hasDotTypeDotSizeDirective() && printSizeAndType) {
+  if (MAI->hasDotTypeDotSizeDirective()) {
     O << "\t.type " << *GVarSym << ",@object\n";
     O << "\t.size " << *GVarSym << ',' << Size << '\n';
   }