This is an archive of the discontinued LLVM Phabricator instance.

[NFC][SelectionDAG][DebugInfo] Refactor DanglingDebugInfo class
ClosedPublic

Authored by Orlando on Oct 19 2022, 5:01 AM.

Details

Summary

Hide the underlying DbgValueInst by adding methods to extract the necessary
information and by adding a raw_ostream &operator<< overload to print it.

Remove the DebugLoc field as this is always the same as the DbgValueInst's
DebugLoc (see D136247).


This refactor will be useful for an upcoming assignment tracking patch.

Diff Detail

Event Timeline

Orlando created this revision.Oct 19 2022, 5:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 5:01 AM
Orlando requested review of this revision.Oct 19 2022, 5:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 5:01 AM
Orlando edited the summary of this revision. (Show Details)Oct 19 2022, 5:01 AM

A few minor inline comments, other than that LGTM.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
111–112

DL can be removed as an argument now, right? Also just as a point of style, could you drive-by change the first argument to use correct casing?

121

Would request the assert text be updated with a little more detail - also if there will be an assert here, it's probably a good idea to put one in the constructor too.

124

Apologies since this will probably increase the line-count of this change, but while we're refactoring this interface could we just rename this? The original name is unnecessarily terse and doesn't follow the style guidelines, and now that it doesn't even match the name of a member it should probably be changed.

Orlando updated this revision to Diff 469611.Oct 21 2022, 7:55 AM
Orlando marked 3 inline comments as done.

Address comments and clean up a few nearby style issues.

StephenTozer accepted this revision.Oct 24 2022, 1:28 AM
This revision is now accepted and ready to land.Oct 24 2022, 1:28 AM
This revision was landed with ongoing or failed builds.Nov 16 2022, 2:15 AM
This revision was automatically updated to reflect the committed changes.

(accidentally didn't submit an inline reply)

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
111–112

Good point, and similarly I've now removed the DebugLoc parameter from addDanglingDebugInfo.