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

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Tue Jan 19 10:57:46 PST 2010


On Tue, Jan 19, 2010 at 3:24 AM, Chris Lattner <sabre at nondot.org> wrote:
> 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 :)

I don't remember why I did this, probably to make the output the
same as gcc at sometime. I think this is fine, if I hit any problem
I'll come back with an explanation :)

> 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';
>   }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list