[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
Sun Jan 26 22:43:11 PST 2020


Jac1494 marked 3 inline comments as done.
Jac1494 added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:172
+    if (DD->useAllLinkageNames())
+    addLinkageName(*VariableDIE, GV->getLinkageName());
+  }
----------------
vsk wrote:
> Why is a linkage name needed on a global variable declaration? Could you leave a comment that explains this?
Currently linkage is add for global variable from method addLocationAttribute ,But after this change for declaration of global variable location will be  not Created,Because of that linkage name is not missing for variable "None" and "__default_lock_policy".I have analysed clang binary from that i have seen this cases.That's why i have added linkage name here.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:173
+    addLinkageName(*VariableDIE, GV->getLinkageName());
+  }
   else
----------------
vsk wrote:
> Please clang-format your diffs so that they conform to llvm's coding standards (https://www.llvm.org/docs/CodingStandards.html#source-code-formatting)
Updated Source code is added.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:186
+  if (GV->isDefinition())
   addLocationAttribute(VariableDIE, GV, GlobalExprs);
 
----------------
vsk wrote:
> How is this source change covered by your test? If not, could you please add test coverage?
Yes, debug-info-extern-variable-declaration.ll test case will cover this source changes.


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

https://reviews.llvm.org/D71599





More information about the llvm-commits mailing list