[PATCH] D71599: [LLVM] Support to emit extern variables debuginfo with "-fstandalone-debug"

Jaydeep Chauhan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 04:35:34 PST 2019


Jac1494 created this revision.
Jac1494 added reviewers: dblaikie, vsk, aprantl.
Jac1494 added a project: LLVM.
Herald added a subscriber: hiraditya.

Separate llvm patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71599

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


Index: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -171,7 +171,11 @@
   if (!GV->isDefinition())
     addFlag(*VariableDIE, dwarf::DW_AT_declaration);
   else
+  {
+    // Add location.
+    addLocationAttribute(VariableDIE, GV, GlobalExprs);
     addGlobalName(GV->getName(), *VariableDIE, DeclContext);
+  }
 
   if (uint32_t AlignInBytes = GV->getAlignInBytes())
     addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata,
@@ -180,9 +184,6 @@
   if (MDTuple *TP = GV->getTemplateParams())
     addTemplateParams(*VariableDIE, DINodeArray(TP));
 
-  // Add location.
-  addLocationAttribute(VariableDIE, GV, GlobalExprs);
-
   return VariableDIE;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71599.234274.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/976c7354/attachment.bin>


More information about the llvm-commits mailing list