[PATCH] D96554: Store the LocationKind of an entry value buffer independently from the main LocationKind (NFC)

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 16:59:57 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG982b89190534: Store the LocationKind of an entry value buffer independently from the main… (authored by aprantl).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96554

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


Index: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
+++ llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
@@ -148,6 +148,7 @@
   enum { EntryValue = 1 << 0, Indirect = 1 << 1, CallSiteParamValue = 1 << 2 };
 
   unsigned LocationKind : 3;
+  unsigned SavedLocationKind : 3;
   unsigned LocationFlags : 3;
   unsigned DwarfVersion : 4;
 
@@ -284,8 +285,8 @@
 public:
   DwarfExpression(unsigned DwarfVersion, DwarfCompileUnit &CU)
       : CU(CU), SubRegisterSizeInBits(0), SubRegisterOffsetInBits(0),
-        LocationKind(Unknown), LocationFlags(Unknown),
-        DwarfVersion(DwarfVersion) {}
+        LocationKind(Unknown), SavedLocationKind(Unknown),
+        LocationFlags(Unknown), DwarfVersion(DwarfVersion) {}
 
   /// This needs to be called last to commit any pending changes.
   void finalize();
Index: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -365,11 +365,7 @@
 void DwarfExpression::setLocation(const MachineLocation &Loc,
                                   const DIExpression *DIExpr) {
   if (Loc.isIndirect())
-    // Do not treat entry value descriptions of indirect parameters as memory
-    // locations. This allows DwarfExpression::addReg() to add DW_OP_regN to an
-    // entry value description.
-    if (!DIExpr->isEntryValue())
-      setMemoryLocationKind();
+    setMemoryLocationKind();
 
   if (DIExpr->isEntryValue())
     setEntryValueFlags(Loc);
@@ -380,12 +376,12 @@
   auto Op = ExprCursor.take();
   (void)Op;
   assert(Op && Op->getOp() == dwarf::DW_OP_LLVM_entry_value);
-  assert(!isMemoryLocation() &&
-         "We don't support entry values of memory locations yet");
   assert(!IsEmittingEntryValue && "Already emitting entry value?");
   assert(Op->getArg(0) == 1 &&
          "Can currently only emit entry values covering a single operation");
 
+  SavedLocationKind = LocationKind;
+  LocationKind = Register;
   IsEmittingEntryValue = true;
   enableTemporaryBuffer();
 }
@@ -403,6 +399,7 @@
   // Emit the entry value's DWARF block operand.
   commitTemporaryBuffer();
 
+  LocationKind = SavedLocationKind;
   IsEmittingEntryValue = false;
 }
 
@@ -415,6 +412,7 @@
   assert(getTemporaryBufferSize() == 0 &&
          "Began emitting entry value block before cancelling entry value");
 
+  LocationKind = SavedLocationKind;
   IsEmittingEntryValue = false;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96554.323503.patch
Type: text/x-patch
Size: 2609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210213/3d1b23e3/attachment.bin>


More information about the llvm-commits mailing list