1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

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 :)

llvm-svn: 93856
This commit is contained in:
Chris Lattner 2010-01-19 05:23:59 +00:00
parent f0edf967c7
commit baaf5eae3c

View 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';
}