[PATCH] D138707: Remove support for 10.4 Tiger from AsmPrinter

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 00:34:19 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf5dd9dda63d1: Remove support for 10.4 Tiger from AsmPrinter (authored by gchatelet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138707/new/

https://reviews.llvm.org/D138707

Files:
  llvm/include/llvm/MC/MCObjectFileInfo.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/MC/MCObjectFileInfo.cpp


Index: llvm/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/lib/MC/MCObjectFileInfo.cpp
+++ 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;
Index: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ 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;
   }
 
Index: llvm/include/llvm/MC/MCObjectFileInfo.h
===================================================================
--- llvm/include/llvm/MC/MCObjectFileInfo.h
+++ 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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138707.478140.patch
Type: text/x-patch
Size: 3071 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221128/5fa618d6/attachment.bin>


More information about the llvm-commits mailing list