[PATCH] D119192: [DWARF][codegen] Removed addLocalLabelAddress

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 14:23:21 PST 2022


ayermolo created this revision.
ayermolo added a reviewer: dblaikie.
Herald added subscribers: hoy, modimo, wenlei, hiraditya.
ayermolo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This came out of https://reviews.llvm.org/D118857.
Removing this API that is not used, to streamline
overall logic and functionality.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119192

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h


Index: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -163,11 +163,6 @@
   void addLabelAddress(DIE &Die, dwarf::Attribute Attribute,
                        const MCSymbol *Label);
 
-  /// addLocalLabelAddress - Add a dwarf label attribute data and value using
-  /// DW_FORM_addr only.
-  void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute,
-                            const MCSymbol *Label);
-
   DwarfCompileUnit &getCU() override { return *this; }
 
   unsigned getOrCreateSourceID(const DIFile *File) override;
Index: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -67,13 +67,19 @@
 /// DW_FORM_addr or DW_FORM_GNU_addr_index.
 void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute,
                                        const MCSymbol *Label) {
-  // Don't use the address pool in non-fission or in the skeleton unit itself.
-  if ((!DD->useSplitDwarf() || !Skeleton) && DD->getDwarfVersion() < 5)
-    return addLocalLabelAddress(Die, Attribute, Label);
-
   if (Label)
     DD->addArangeLabel(SymbolCU(this, Label));
 
+  // Don't use the address pool in non-fission or in the skeleton unit itself.
+  if ((!DD->useSplitDwarf() || !Skeleton) && DD->getDwarfVersion() < 5) {
+    if (Label)
+      addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label));
+    else
+      addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0));
+
+    return;
+  }
+
   bool UseAddrOffsetFormOrExpressions =
       DD->useAddrOffsetForm() || DD->useAddrOffsetExpressions();
 
@@ -105,18 +111,6 @@
                      DD->getAddressPool().getIndex(Base), Label, Base));
 }
 
-void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,
-                                            dwarf::Attribute Attribute,
-                                            const MCSymbol *Label) {
-  if (Label)
-    DD->addArangeLabel(SymbolCU(this, Label));
-
-  if (Label)
-    addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label));
-  else
-    addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0));
-}
-
 unsigned DwarfCompileUnit::getOrCreateSourceID(const DIFile *File) {
   // If we print assembly, we can't separate .file entries according to
   // compile units. Thus all files will belong to the default compile unit.
@@ -505,7 +499,7 @@
           // FIXME: when writing dwo, we need to avoid relocations. Probably
           // the "right" solution is to treat globals the way func and data
           // symbols are (with entries in .debug_addr).
-          // For now, since we only ever use index 0, this should work as-is.       
+          // For now, since we only ever use index 0, this should work as-is.
           addUInt(*Loc, dwarf::DW_FORM_data4, FrameBase.Location.WasmLoc.Index);
         }
         addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_stack_value);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119192.406611.patch
Type: text/x-patch
Size: 3193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220207/b58dabb2/attachment.bin>


More information about the llvm-commits mailing list