This is an archive of the discontinued LLVM Phabricator instance.

[LLVM] Support to emit extern variables debuginfo with "-fstandalone-debug"
Needs ReviewPublic

Authored by Jac1494 on Dec 17 2019, 4:33 AM.

Details

Summary

To emit debuginfo for declaration of global extern variable with option "-fstandalone-debug" this patch is created. It is contain change related to llvm code and for clang code patch is available at (https://reviews.llvm.org/D71451)

Diff Detail

Event Timeline

Jac1494 created this revision.Dec 17 2019, 4:33 AM

This'll need a test case

Jac1494 updated this revision to Diff 234749.Dec 19 2019, 10:40 AM

Test case Added

Jac1494 updated this revision to Diff 239002.Jan 19 2020, 11:07 AM

DW_AT_linkage_name attribute support added for global variable declaration.

Jac1494 updated this revision to Diff 239003.Jan 19 2020, 11:11 AM
Jac1494 updated this revision to Diff 239121.Jan 20 2020, 6:56 AM
vsk added a comment.Jan 21 2020, 10:00 AM

Please fill out the 'Summary' field in the Phab review so the context is easier to pick up for reviewers.

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
172

Why is a linkage name needed on a global variable declaration? Could you leave a comment that explains this?

173

Please clang-format your diffs so that they conform to llvm's coding standards (https://www.llvm.org/docs/CodingStandards.html#source-code-formatting)

186

How is this source change covered by your test? If not, could you please add test coverage?

llvm/test/DebugInfo/Generic/debug-info-extern-variable-declaration.ll
31 ↗(On Diff #239121)

Could you reduce this test case by deleting unnecessary attributes?

Jac1494 updated this revision to Diff 239664.Jan 22 2020, 11:47 AM

clang format source file added ,and removed unnecessary attribute from test case.

Jac1494 edited the summary of this revision. (Show Details)Jan 22 2020, 12:00 PM
Jac1494 marked 3 inline comments as done.Jan 26 2020, 10:36 PM
Jac1494 added inline comments.
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
172

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.

173

Updated Source code is added.

186

Yes, debug-info-extern-variable-declaration.ll test case will cover this source changes.