add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-01-19 04:48:20 +00:00
parent 48d64ba9d8
commit 7517b249ca
6 changed files with 21 additions and 11 deletions

View File

@@ -647,17 +647,18 @@ void X86AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
}
void X86AsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
const TargetData *TD = TM.getTargetData();
MCSymbol *GVarSym = GetGlobalValueSymbol(GVar);
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
const TargetData *TD = TM.getTargetData();
unsigned Size = TD->getTypeAllocSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
printVisibility(GVarSym, GVar->getVisibility());
if (Subtarget->isTargetELF())
if (MAI->hasDotTypeDotSizeDirective())
O << "\t.type\t" << *GVarSym << ",@object\n";
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GVar, TM);
@@ -685,7 +686,7 @@ void X86AsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
if (const char *LComm = MAI->getLCOMMDirective()) {
if (GVar->hasLocalLinkage()) {
O << LComm << *GVarSym << ',' << Size;
if (Subtarget->isTargetDarwin())
if (MAI->getLCOMMDirectiveTakesAlignment())
O << ',' << Align;
}
} else {