This is an archive of the discontinued LLVM Phabricator instance.

Return discriminator in DWARF Info
ClosedPublic

Authored by sque on Dec 9 2016, 6:49 PM.

Details

Summary

This change does two things:

  1. Adds a "Discriminator" field to struct DILineInfo, which defaults to 0.
  2. Fills out the "Discriminator" field in DILineInfo in DWARFDebugLine::LineTable::getFileLineInfoForAddress(). The discriminator value is already present in the internal DWARF data.

Diff Detail

Repository
rL LLVM

Event Timeline

sque updated this revision to Diff 80990.Dec 9 2016, 6:49 PM
sque retitled this revision from to Return discriminator in DWARF Info.
sque updated this object.
sque added a reviewer: echristo.
echristo accepted this revision.Dec 9 2016, 7:24 PM
echristo edited edge metadata.

One nit then OK. I tried to come up with a way to keep the routines fairly neutral here and couldn't come up with an easy one that didn't involve a lot more refactoring than seems necessary if we just want the discriminator and there aren't any other users with special information.

Thanks!

-eric

include/llvm/DebugInfo/DIContext.h
37 ↗(On Diff #80990)

A discriminator isn't format neutral so we'll probably want to start a "format specific information" set in DILineInfo.

This could probably use a comment of the sort:

// Used in DWARF line tables blah blah blah

This revision is now accepted and ready to land.Dec 9 2016, 7:24 PM
sque updated this revision to Diff 81121.Dec 12 2016, 11:55 AM
sque edited edge metadata.

I added a comment explaining that the field is DWARF-specific. If new format-specific fields are added in the future, it can be put under that section for DWARF or under a new section for other formats.

This revision was automatically updated to reflect the committed changes.