diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-19 04:59:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-19 04:59:55 +0000 |
| commit | 826d77fb07a026d9cf8ff4579bf4a77d497b684b (patch) | |
| tree | 323ead2bb67a454fb41f496e6631f9171cf32287 | |
| parent | f8a128a1a8a98cb08c62b2dcb7ce4d0d0cd80e94 (diff) | |
| download | bcm5719-llvm-826d77fb07a026d9cf8ff4579bf4a77d497b684b.tar.gz bcm5719-llvm-826d77fb07a026d9cf8ff4579bf4a77d497b684b.zip | |
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.
llvm-svn: 93854
| -rw-r--r-- | llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index bb7647a5eea..358bb70e2cb 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/llvm/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); |

