From 619ea855e72bb67f14ef78d942b84368ca9ab4ae Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 19 Jan 2010 04:59:55 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93854 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index bb7647a5eea..358bb70e2cb 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -660,17 +660,15 @@ void X86AsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { 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 @@ void X86AsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { 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);