This is an archive of the discontinued LLVM Phabricator instance.

[DEBUGINFO] Add flag for DWARF2 to use sections as references.
ClosedPublic

Authored by ABataev on Mar 1 2018, 7:28 AM.

Details

Summary

Some targets does not support labels inside debug sections, but support
references in form section+offset. Patch adds initial support
for this. Also, this patch disables emission of all additional debug
sections that may have labels inside of it (like pub sections and
string tables).

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev created this revision.Mar 1 2018, 7:28 AM

Some inline comments.

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
320 ↗(On Diff #136521)

Why?

751 ↗(On Diff #136521)

Can you explain why this one is necessary?

1579–1583 ↗(On Diff #136521)

Let's refactor this into a "DwarfEmitOffset" function and use it in all of the places we want to emit a label plus an offset, then this becomes a two line patch.

ABataev added inline comments.Mar 21 2018, 6:33 AM
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
320 ↗(On Diff #136521)

Removed

751 ↗(On Diff #136521)

It was fixed already in another patch

1579–1583 ↗(On Diff #136521)

Ok, will do

ABataev updated this revision to Diff 139288.Mar 21 2018, 7:16 AM

Updated to the latest version + fixes.

echristo added inline comments.Mar 22 2018, 8:23 AM
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
1579–1583 ↗(On Diff #136521)

Feels like you should be able to refactor the if conditional into the function as well and generally just use it everywhere?

Also means you can probably split it into two patches:

  1. Add EmitDwarfOffset
  2. Add support for useSectionsAsReferences

Thoughts?

ABataev updated this revision to Diff 139479.Mar 22 2018, 11:09 AM

Update after review

echristo accepted this revision.Mar 22 2018, 11:42 AM

Works for me. Might want to make sure that any other uses are updated as well.

This revision is now accepted and ready to land.Mar 22 2018, 11:42 AM
This revision was automatically updated to reflect the committed changes.