diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h --- a/llvm/include/llvm/MC/MCObjectFileInfo.h +++ b/llvm/include/llvm/MC/MCObjectFileInfo.h @@ -27,10 +27,6 @@ class MCObjectFileInfo { protected: - /// True if .comm supports alignment. This is a hack for as long as we - /// support 10.4 Tiger, whose assembler doesn't support alignment on comm. - bool CommDirectiveSupportsAlignment = false; - /// True if target object file supports a weak_definition of constant 0 for an /// omitted EH frame. bool SupportsWeakOmittedEHFrame = false; @@ -257,10 +253,6 @@ return OmitDwarfIfHaveCompactUnwind; } - bool getCommDirectiveSupportsAlignment() const { - return CommDirectiveSupportsAlignment; - } - unsigned getFDEEncoding() const { return FDECFIEncoding; } unsigned getCompactUnwindDwarfEHFrameOnly() const { diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -744,10 +744,7 @@ if (GVKind.isCommon()) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. // .comm _foo, 42, 4 - const bool SupportsAlignment = - getObjFileLowering().getCommDirectiveSupportsAlignment(); - OutStreamer->emitCommonSymbol(GVSym, Size, - SupportsAlignment ? Alignment.value() : 0); + OutStreamer->emitCommonSymbol(GVSym, Size, Alignment.value()); return; } @@ -788,10 +785,7 @@ // .local _foo OutStreamer->emitSymbolAttribute(GVSym, MCSA_Local); // .comm _foo, 42, 4 - const bool SupportsAlignment = - getObjFileLowering().getCommDirectiveSupportsAlignment(); - OutStreamer->emitCommonSymbol(GVSym, Size, - SupportsAlignment ? Alignment.value() : 0); + OutStreamer->emitCommonSymbol(GVSym, Size, Alignment.value()); return; } diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -80,10 +80,6 @@ FDECFIEncoding = dwarf::DW_EH_PE_pcrel; - // .comm doesn't support alignment before Leopard. - if (T.isMacOSX() && T.isMacOSXVersionLT(10, 5)) - CommDirectiveSupportsAlignment = false; - TextSection // .text = Ctx->getMachOSection("__TEXT", "__text", MachO::S_ATTR_PURE_INSTRUCTIONS, @@ -556,8 +552,6 @@ // and to set the ISA selection bit for calls accordingly. const bool IsThumb = T.getArch() == Triple::thumb; - CommDirectiveSupportsAlignment = true; - // COFF BSSSection = Ctx->getCOFFSection( ".bss", COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA | @@ -1035,7 +1029,6 @@ Ctx = &MCCtx; // Common. - CommDirectiveSupportsAlignment = true; SupportsWeakOmittedEHFrame = true; SupportsCompactUnwindWithoutEHFrame = false; OmitDwarfIfHaveCompactUnwind = false;