[llvm] 35e621f - [NFC][AsmPrinter] Expose std::variant-ness of DbgVariable

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 10:33:06 PDT 2023


Author: Scott Linder
Date: 2023-09-11T17:31:59Z
New Revision: 35e621f9ae65009c57b8e3e3c1aac7ba30b28d9a

URL: https://github.com/llvm/llvm-project/commit/35e621f9ae65009c57b8e3e3c1aac7ba30b28d9a
DIFF: https://github.com/llvm/llvm-project/commit/35e621f9ae65009c57b8e3e3c1aac7ba30b28d9a.diff

LOG: [NFC][AsmPrinter] Expose std::variant-ness of DbgVariable

Differential Revision: https://reviews.llvm.org/D158677

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
    llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h
    llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
    llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
index 8c6109880afcfa..700e24a08b5d56 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
@@ -40,8 +40,5 @@ void DebugLocStream::finalizeEntry() {
 DebugLocStream::ListBuilder::~ListBuilder() {
   if (!Locs.finalizeList(Asm))
     return;
-  V.initializeDbgValue(&MI);
-  V.setDebugLocListIndex(ListIndex);
-  if (TagOffset)
-    V.setDebugLocListTagOffset(*TagOffset);
+  V.emplace<Loc::Multi>(ListIndex, TagOffset);
 }

diff  --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h
index a96bdd03491869..c9378ace4fd1be 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h
@@ -156,14 +156,13 @@ class DebugLocStream::ListBuilder {
   DebugLocStream &Locs;
   AsmPrinter &Asm;
   DbgVariable &V;
-  const MachineInstr &MI;
   size_t ListIndex;
   std::optional<uint8_t> TagOffset;
 
 public:
   ListBuilder(DebugLocStream &Locs, DwarfCompileUnit &CU, AsmPrinter &Asm,
-              DbgVariable &V, const MachineInstr &MI)
-      : Locs(Locs), Asm(Asm), V(V), MI(MI), ListIndex(Locs.startList(&CU)),
+              DbgVariable &V)
+      : Locs(Locs), Asm(Asm), V(V), ListIndex(Locs.startList(&CU)),
         TagOffset(std::nullopt) {}
 
   void setTagOffset(uint8_t TO) {

diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index fffbb28256341b..25cad6743196a1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -772,10 +772,10 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
 
   // Add variable address.
 
-  unsigned Index = DV.getDebugLocListIndex();
-  if (Index != ~0U) {
-    addLocationList(*VariableDie, dwarf::DW_AT_location, Index);
-    auto TagOffset = DV.getDebugLocListTagOffset();
+  if (auto *Multi = std::get_if<Loc::Multi>(&DV)) {
+    addLocationList(*VariableDie, dwarf::DW_AT_location,
+                    Multi->getDebugLocListIndex());
+    auto TagOffset = Multi->getDebugLocListTagOffset();
     if (TagOffset)
       addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1,
               *TagOffset);
@@ -783,13 +783,14 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
   }
 
   // Check if variable has a single location description.
-  if (auto *DVal = DV.getValueLoc()) {
+  if (const auto *Single = std::get_if<Loc::Single>(&DV)) {
+    const DbgValueLoc *DVal = &Single->getValueLoc();
     if (!DVal->isVariadic()) {
       const DbgValueLocEntry *Entry = DVal->getLocEntries().begin();
       if (Entry->isLocation()) {
         addVariableAddress(DV, *VariableDie, Entry->getLoc());
       } else if (Entry->isInt()) {
-        auto *Expr = DV.getSingleExpression();
+        auto *Expr = Single->getExpr();
         if (Expr && Expr->getNumElements()) {
           DIELoc *Loc = new (DIEValueAllocator) DIELoc;
           DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
@@ -823,7 +824,7 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
           return Entry.isLocation() && !Entry.getLoc().getReg();
         }))
       return VariableDie;
-    const DIExpression *Expr = DV.getSingleExpression();
+    const DIExpression *Expr = Single->getExpr();
     assert(Expr && "Variadic Debug Value must have an Expression.");
     DIELoc *Loc = new (DIEValueAllocator) DIELoc;
     DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
@@ -882,11 +883,11 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
     return VariableDie;
   }
 
-  if (const std::set<EntryValueInfo> *EntryValues = DV.getEntryValues()) {
+  if (auto *EntryValue = std::get_if<Loc::EntryValue>(&DV)) {
     DIELoc *Loc = new (DIEValueAllocator) DIELoc;
     DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
     // Emit each expression as: EntryValue(Register) <other ops> <Fragment>.
-    for (auto [Register, Expr] : *EntryValues) {
+    for (auto [Register, Expr] : EntryValue->EntryValues) {
       DwarfExpr.addFragmentOffset(&Expr);
       DIExpressionCursor Cursor(Expr.getElements());
       DwarfExpr.beginEntryValueExpression(Cursor);
@@ -899,13 +900,13 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV,
   }
 
   // .. else use frame index.
-  if (!DV.hasFrameIndexExprs())
+  if (!DV.holds<Loc::MMI>())
     return VariableDie;
 
   std::optional<unsigned> NVPTXAddressSpace;
   DIELoc *Loc = new (DIEValueAllocator) DIELoc;
   DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
-  for (const auto &Fragment : DV.getFrameIndexExprs()) {
+  for (const auto &Fragment : DV.get<Loc::MMI>().getFrameIndexExprs()) {
     Register FrameReg;
     const DIExpression *Expr = Fragment.Expr;
     const TargetFrameLowering *TFI = Asm->MF->getSubtarget().getFrameLowering();
@@ -1530,8 +1531,9 @@ void DwarfCompileUnit::addGlobalTypeUnitType(const DIType *Ty,
 
 void DwarfCompileUnit::addVariableAddress(const DbgVariable &DV, DIE &Die,
                                           MachineLocation Location) {
-  if (DV.hasComplexAddress())
-    addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
+  auto *Single = std::get_if<Loc::Single>(&DV);
+  if (Single && Single->getExpr())
+    addComplexAddress(Single->getExpr(), Die, dwarf::DW_AT_location, Location);
   else
     addAddress(Die, dwarf::DW_AT_location, Location);
 }
@@ -1562,12 +1564,11 @@ void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute,
 /// DWARF information necessary to find the actual variable given the extra
 /// address information encoded in the DbgVariable, starting from the starting
 /// location.  Add the DWARF information to the die.
-void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die,
+void DwarfCompileUnit::addComplexAddress(const DIExpression *DIExpr, DIE &Die,
                                          dwarf::Attribute Attribute,
                                          const MachineLocation &Location) {
   DIELoc *Loc = new (DIEValueAllocator) DIELoc;
   DIEDwarfExpression DwarfExpr(*Asm, *this, *Loc);
-  const DIExpression *DIExpr = DV.getSingleExpression();
   DwarfExpr.addFragmentOffset(DIExpr);
   DwarfExpr.setLocation(Location, DIExpr);
 

diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 71f65f44c0f1a5..948ecc21bc94c2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -341,7 +341,7 @@ class DwarfCompileUnit final : public DwarfUnit {
   /// DWARF information necessary to find the actual variable (navigating the
   /// extra location information encoded in the type) based on the starting
   /// location.  Add the DWARF information to the die.
-  void addComplexAddress(const DbgVariable &DV, DIE &Die,
+  void addComplexAddress(const DIExpression *DIExpr, DIE &Die,
                          dwarf::Attribute Attribute,
                          const MachineLocation &Location);
 

diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6abf5ff7dbae8f..566953162bfb46 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -257,44 +257,23 @@ static DbgValueLoc getDebugLocValue(const MachineInstr *MI) {
   return DbgValueLoc(Expr, DbgValueLocEntries, IsVariadic);
 }
 
-/// Initialize from the MMI table.
-void DbgVariable::initializeMMI(const DIExpression *E, int FI) {
-  assert(holds<std::monostate>() && "Already initialized");
-  assert((!E || E->isValid()) && "Expected valid expression");
-  assert(FI != std::numeric_limits<int>::max() && "Expected valid index");
-  emplace<MMILoc>().FrameIndexExprs.push_back({FI, E});
+Loc::Single::Single(DbgValueLoc ValueLoc)
+    : ValueLoc(std::make_unique<DbgValueLoc>(ValueLoc)),
+      Expr(ValueLoc.getExpression()) {
+  if (!Expr->getNumElements())
+    Expr = nullptr;
 }
 
-void DbgVariable::initializeDbgValue(DbgValueLoc Value) {
-  assert(holds<std::monostate>() && "Already initialized");
-  assert(!Value.getExpression()->isFragment() && "Fragments not supported");
-  emplace<SingleLoc>(Value);
-}
-
-void DbgVariable::initializeDbgValue(const MachineInstr *DbgValue) {
-  assert(holds<std::monostate>() && "Already initialized");
-  assert(getVariable() == DbgValue->getDebugVariable() && "Wrong variable");
-  assert(getInlinedAt() == DbgValue->getDebugLoc()->getInlinedAt() &&
-         "Wrong inlined-at");
-  emplace<SingleLoc>(getDebugLocValue(DbgValue));
-}
-
-void DbgVariable::initializeEntryValue(MCRegister Reg,
-                                       const DIExpression &Expr) {
-  assert(holds<std::monostate>() && "Already initialized?");
-  emplace<EntryValueLoc>(Reg, Expr);
-}
-
-ArrayRef<FrameIndexExpr> DbgVariable::getFrameIndexExprs() const {
-  auto &FrameIndexExprs = get<MMILoc>().FrameIndexExprs;
+Loc::Single::Single(const MachineInstr *DbgValue)
+    : Single(getDebugLocValue(DbgValue)) {}
 
+ArrayRef<FrameIndexExpr> Loc::MMI::getFrameIndexExprs() const {
   if (FrameIndexExprs.size() == 1)
     return FrameIndexExprs;
 
-  assert(llvm::all_of(FrameIndexExprs,
-                      [](const FrameIndexExpr &A) {
-                        return A.Expr->isFragment();
-                      }) &&
+  assert(llvm::all_of(
+             FrameIndexExprs,
+             [](const FrameIndexExpr &A) { return A.Expr->isFragment(); }) &&
          "multiple FI expressions without DW_OP_LLVM_fragment");
   llvm::sort(FrameIndexExprs,
              [](const FrameIndexExpr &A, const FrameIndexExpr &B) -> bool {
@@ -305,9 +284,7 @@ ArrayRef<FrameIndexExpr> DbgVariable::getFrameIndexExprs() const {
   return FrameIndexExprs;
 }
 
-void DbgVariable::addMMIEntry(const DIExpression *Expr, int FI) {
-  auto &FrameIndexExprs = get<MMILoc>().FrameIndexExprs;
-
+void Loc::MMI::addFrameIndexExpr(const DIExpression *Expr, int FI) {
   // FIXME: This logic should not be necessary anymore, as we now have proper
   // deduplication. However, without it, we currently run into the assertion
   // below, which means that we are likely dealing with broken input, i.e. two
@@ -1570,19 +1547,20 @@ void DwarfDebug::collectVariableInfoFromMFTable(
     ensureAbstractEntityIsCreatedIfScoped(TheCU, Var.first, Scope->getScopeNode());
 
     if (DbgVariable *DbgVar = MFVars.lookup(Var)) {
-      if (DbgVar->hasFrameIndexExprs())
-        DbgVar->addMMIEntry(VI.Expr, VI.getStackSlot());
+      if (auto *MMI = std::get_if<Loc::MMI>(DbgVar))
+        MMI->addFrameIndexExpr(VI.Expr, VI.getStackSlot());
       else
-        DbgVar->addEntryValueExpr(VI.getEntryValueRegister(), *VI.Expr);
+        DbgVar->get<Loc::EntryValue>().addExpr(VI.getEntryValueRegister(),
+                                               *VI.Expr);
       continue;
     }
 
     auto RegVar = std::make_unique<DbgVariable>(
                     cast<DILocalVariable>(Var.first), Var.second);
     if (VI.inStackSlot())
-      RegVar->initializeMMI(VI.Expr, VI.getStackSlot());
+      RegVar->emplace<Loc::MMI>(VI.Expr, VI.getStackSlot());
     else
-      RegVar->initializeEntryValue(VI.getEntryValueRegister(), *VI.Expr);
+      RegVar->emplace<Loc::EntryValue>(VI.getEntryValueRegister(), *VI.Expr);
     LLVM_DEBUG(dbgs() << "Created DbgVariable for " << VI.Var->getName()
                       << "\n");
     InfoHolder.addScopeVariable(Scope, RegVar.get());
@@ -1921,7 +1899,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
       const auto *End =
           SingleValueWithClobber ? HistoryMapEntries[1].getInstr() : nullptr;
       if (validThroughout(LScopes, MInsn, End, getInstOrdering())) {
-        RegVar->initializeDbgValue(MInsn);
+        RegVar->emplace<Loc::Single>(MInsn);
         continue;
       }
     }
@@ -1931,7 +1909,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
       continue;
 
     // Handle multiple DBG_VALUE instructions describing one variable.
-    DebugLocStream::ListBuilder List(DebugLocs, TheCU, *Asm, *RegVar, *MInsn);
+    DebugLocStream::ListBuilder List(DebugLocs, TheCU, *Asm, *RegVar);
 
     // Build the location list for this variable.
     SmallVector<DebugLocEntry, 8> Entries;
@@ -1941,7 +1919,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU,
     // that is valid throughout the variable's scope. If so, produce single
     // value location.
     if (isValidSingleLocation) {
-      RegVar->initializeDbgValue(Entries[0].getValues()[0]);
+      RegVar->emplace<Loc::Single>(Entries[0].getValues()[0]);
       continue;
     }
 

diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index a77a8b883284f3..d675bae190d5d3 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -101,6 +101,8 @@ class DbgEntity {
   }
 };
 
+class DbgVariable;
+
 /// Proxy for one MMI entry.
 struct FrameIndexExpr {
   int FI;
@@ -124,34 +126,53 @@ struct EntryValueInfo {
   }
 };
 
-// Namespace for private alternatives of a DbgVariable.
-namespace {
+// Namespace for alternatives of a DbgVariable.
+namespace Loc {
 /// Single value location description.
-struct SingleLoc {
+class Single {
   std::unique_ptr<DbgValueLoc> ValueLoc;
   const DIExpression *Expr;
-  SingleLoc(DbgValueLoc ValueLoc)
-      : ValueLoc(std::make_unique<DbgValueLoc>(ValueLoc)),
-        Expr(ValueLoc.getExpression()) {
-    if (!Expr->getNumElements())
-      Expr = nullptr;
-  }
+
+public:
+  explicit Single(DbgValueLoc ValueLoc);
+  explicit Single(const MachineInstr *DbgValue);
+  const DbgValueLoc &getValueLoc() const { return *ValueLoc; }
+  const DIExpression *getExpr() const { return Expr; }
 };
 /// Multi-value location description.
-struct MultiLoc {
+class Multi {
   /// Index of the entry list in DebugLocs.
-  unsigned DebugLocListIndex = ~0u;
+  unsigned DebugLocListIndex;
   /// DW_OP_LLVM_tag_offset value from DebugLocs.
   std::optional<uint8_t> DebugLocListTagOffset;
+
+public:
+  explicit Multi(unsigned DebugLocListIndex,
+                 std::optional<uint8_t> DebugLocListTagOffset)
+      : DebugLocListIndex(DebugLocListIndex),
+        DebugLocListTagOffset(DebugLocListTagOffset) {}
+  unsigned getDebugLocListIndex() const { return DebugLocListIndex; }
+  std::optional<uint8_t> getDebugLocListTagOffset() const {
+    return DebugLocListTagOffset;
+  }
 };
 /// Single location defined by (potentially multiple) MMI entries.
-struct MMILoc {
+struct MMI {
   mutable SmallVector<FrameIndexExpr, 1> FrameIndexExprs;
+
+public:
+  explicit MMI(const DIExpression *E, int FI) : FrameIndexExprs({{FI, E}}) {
+    assert((!E || E->isValid()) && "Expected valid expression");
+    assert(FI != std::numeric_limits<int>::max() && "Expected valid index");
+  }
+  void addFrameIndexExpr(const DIExpression *Expr, int FI);
+  /// Get the FI entries, sorted by fragment offset.
+  ArrayRef<FrameIndexExpr> getFrameIndexExprs() const;
 };
 /// Single location defined by (potentially multiple) EntryValueInfo.
-struct EntryValueLoc {
+struct EntryValue {
   std::set<EntryValueInfo> EntryValues;
-  EntryValueLoc(MCRegister Reg, const DIExpression &Expr) {
+  explicit EntryValue(MCRegister Reg, const DIExpression &Expr) {
     addExpr(Reg, Expr);
   };
   // Add the pair Reg, Expr to the list of entry values describing the variable.
@@ -165,7 +186,7 @@ struct EntryValueLoc {
     EntryValues.insert({Reg, **NonVariadicExpr});
   }
 };
-} // namespace
+} // namespace Loc
 
 //===----------------------------------------------------------------------===//
 /// This class is used to track local variable information.
@@ -175,8 +196,8 @@ struct EntryValueLoc {
 /// which has not be initialized yet.
 ///
 /// Variables can be created from allocas, in which case they're generated from
-/// the MMI table. Such variables hold the \c MMILoc alternative which can have
-/// multiple expressions and frame indices.
+/// the MMI table. Such variables hold the \c Loc::MMI alternative which can
+/// have multiple expressions and frame indices.
 ///
 /// Variables can be created from the entry value of registers, in which case
 /// they're generated from the MMI table. Such variables hold the \c
@@ -184,14 +205,15 @@ struct EntryValueLoc {
 /// multiple *fragment* expressions.
 ///
 /// Variables can be created from \c DBG_VALUE instructions. Those whose
-/// location changes over time hold a \c MultiLoc alternative which uses \c
+/// location changes over time hold a \c Loc::Multi alternative which uses \c
 /// DebugLocListIndex and (optionally) \c DebugLocListTagOffset, while those
-/// with a single location hold a \c SingleLoc alternative which use \c ValueLoc
-/// and (optionally) a single \c Expr.
+/// with a single location hold a \c Loc::Single alternative which use \c
+/// ValueLoc and (optionally) a single \c Expr.
 class DbgVariable : public DbgEntity,
-                    private std::variant<std::monostate, SingleLoc, MultiLoc,
-                                         MMILoc, EntryValueLoc> {
+                    public std::variant<std::monostate, Loc::Single, Loc::Multi,
+                                        Loc::MMI, Loc::EntryValue> {
 
+public:
   /// Member shorthand for std::holds_alternative
   template <typename T> bool holds() const {
     return std::holds_alternative<T>(*this);
@@ -207,78 +229,18 @@ class DbgVariable : public DbgEntity,
     return *std::get_if<T>(this);
   }
 
-public:
   /// Construct a DbgVariable.
   ///
-  /// Creates a variable without any DW_AT_location.  Call \a initializeMMI()
-  /// for MMI entries, or \a initializeDbgValue() for DBG_VALUE instructions.
+  /// Creates a variable without any DW_AT_location.
   DbgVariable(const DILocalVariable *V, const DILocation *IA)
       : DbgEntity(V, IA, DbgVariableKind) {}
 
-  /// Initialize from the MMI table.
-  void initializeMMI(const DIExpression *E, int FI);
-
-  // Initialize variable's location.
-  void initializeDbgValue(DbgValueLoc Value);
-
-  void initializeEntryValue(MCRegister Reg, const DIExpression &Expr);
-
-  const std::set<EntryValueInfo> *getEntryValues() const {
-    if (const auto *EV = std::get_if<EntryValueLoc>(this))
-      return &EV->EntryValues;
-    return nullptr;
-  }
-  std::set<EntryValueInfo> *getEntryValues() {
-    if (auto *EV = std::get_if<EntryValueLoc>(this))
-      return &EV->EntryValues;
-    return nullptr;
-  }
-  void addEntryValueExpr(MCRegister Reg, const DIExpression &Expr) {
-    get<EntryValueLoc>().addExpr(Reg, Expr);
-  }
-
-  /// Initialize from a DBG_VALUE instruction.
-  void initializeDbgValue(const MachineInstr *DbgValue);
-
   // Accessors.
   const DILocalVariable *getVariable() const {
     return cast<DILocalVariable>(getEntity());
   }
 
-  const DIExpression *getSingleExpression() const {
-    return get<SingleLoc>().Expr;
-  }
-
-  void setDebugLocListIndex(uint8_t O) {
-    if (auto *M = std::get_if<MultiLoc>(this))
-      M->DebugLocListIndex = O;
-    else
-      emplace<MultiLoc>().DebugLocListIndex = O;
-  }
-  unsigned getDebugLocListIndex() const {
-    if (auto *M = std::get_if<MultiLoc>(this))
-      return M->DebugLocListIndex;
-    return ~0U;
-  }
-  void setDebugLocListTagOffset(uint8_t O) {
-    if (auto *M = std::get_if<MultiLoc>(this))
-      M->DebugLocListTagOffset = O;
-    else
-      emplace<MultiLoc>().DebugLocListTagOffset = O;
-  }
-  std::optional<uint8_t> getDebugLocListTagOffset() const {
-    return get<MultiLoc>().DebugLocListTagOffset;
-  }
   StringRef getName() const { return getVariable()->getName(); }
-  const DbgValueLoc *getValueLoc() const {
-    if (auto *M = std::get_if<SingleLoc>(this))
-      return M->ValueLoc.get();
-    return nullptr;
-  }
-  /// Get the FI entries, sorted by fragment offset.
-  ArrayRef<FrameIndexExpr> getFrameIndexExprs() const;
-  bool hasFrameIndexExprs() const { return holds<MMILoc>(); }
-  void addMMIEntry(const DIExpression *Expr, int FI);
 
   // Translate tag to proper Dwarf tag.
   dwarf::Tag getTag() const {
@@ -306,8 +268,6 @@ class DbgVariable : public DbgEntity,
     return false;
   }
 
-  bool hasComplexAddress() const { return get<SingleLoc>().Expr; }
-
   const DIType *getType() const;
 
   static bool classof(const DbgEntity *N) {


        


More information about the llvm-commits mailing list