[llvm-commits] [llvm] r93854 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp

Chris Lattner sabre at nondot.org
Mon Jan 18 20:59:55 PST 2010


Author: lattner
Date: Mon Jan 18 22:59:55 2010
New Revision: 93854

URL: http://llvm.org/viewvc/llvm-project?rev=93854&view=rev
Log:
more cleanups.  Emit the .local directive even on cygwin/mingw.
I'm not sure that this is correct, but it causes no test failures,
and just emitting a .comm without protecting its linkage somehow
is surely not right.

Modified:
    llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=93854&r1=93853&r2=93854&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Mon Jan 18 22:59:55 2010
@@ -660,17 +660,15 @@
   
   SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GVar, TM);
 
-  const Type *Type = GVar->getType()->getElementType();
-  
   const TargetData *TD = TM.getTargetData();
-  unsigned Size = TD->getTypeAllocSize(Type);
+  unsigned Size = TD->getTypeAllocSize(GVar->getType()->getElementType());
   unsigned AlignLog = TD->getPreferredAlignmentLog(GVar);
   
   // Handle normal common symbols.
   if (GVKind.isCommon()) {
     if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
     
-    O << ".comm " << *GVarSym << ',' << Size;
+    O << MAI->getCOMMDirective() << *GVarSym << ',' << Size;
     if (MAI->getCOMMDirectiveTakesAlignment())
       O << ',' << (MAI->getAlignmentIsInBytes() ? (1 << AlignLog) : AlignLog);
     
@@ -693,8 +691,7 @@
           O << ',' << AlignLog;
       }
     } else {
-      if (!Subtarget->isTargetCygMing())
-        O << "\t.local\t" << *GVarSym << '\n';
+      O << "\t.local\t" << *GVarSym << '\n';
       O << MAI->getCOMMDirective() << *GVarSym << ',' << Size;
       if (MAI->getCOMMDirectiveTakesAlignment())
         O << ',' << (MAI->getAlignmentIsInBytes() ? (1 << AlignLog) : AlignLog);





More information about the llvm-commits mailing list