[llvm-commits] [llvm] r93856 - /llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp

Chris Lattner sabre at nondot.org
Mon Jan 18 21:24:00 PST 2010


Author: lattner
Date: Mon Jan 18 23:23:59 2010
New Revision: 93856

URL: http://llvm.org/viewvc/llvm-project?rev=93856&view=rev
Log:
simplify the mips target to print .size and .type for c strings 
just like all other elf targets.  Bruno, if this isn't right, please
let me know + why :)

Modified:
    llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp?rev=93856&r1=93855&r2=93856&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp Mon Jan 18 23:23:59 2010
@@ -438,8 +438,6 @@
   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 @@
    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 @@
 
   EmitAlignment(Align, GVar);
 
-  if (MAI->hasDotTypeDotSizeDirective() && printSizeAndType) {
+  if (MAI->hasDotTypeDotSizeDirective()) {
     O << "\t.type " << *GVarSym << ", at object\n";
     O << "\t.size " << *GVarSym << ',' << Size << '\n';
   }





More information about the llvm-commits mailing list