This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef][NFC] Refactor code portions into own functions, name some useful types
ClosedPublic

Authored by jmorse on Jan 28 2022, 4:44 AM.

Details

Summary

This patch shuffles some functions around before another patch that uses them, so this is primarily a refactor. In particular:

  • Move the determination of "which blocks are in scope" to its own function -- this is sometimes trickier than it sounds, and we're going to end up doing it twice. In the process, the "InScopeBlocks" collection is deleted, nothing actually read it, I believe it's a hangover from VarLocBasedLDV.
  • Split transfer emission (i.e., installing DBG_VALUEs into blocks) into its own function.
  • Give type names to a variety of useful collections that are going to be used in several places shortly.
  • Rename a misleading name, "ScopeToBlocks" to "ScopeToAssignBlocks". Because it stores a collection of blocks where assignments happen, not the set of blocks for a scope.

Diff Detail

Event Timeline

jmorse created this revision.Jan 28 2022, 4:44 AM
jmorse requested review of this revision.Jan 28 2022, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2022, 4:44 AM
Orlando accepted this revision.Jan 31 2022, 4:59 AM

The clang-format bot isn't happy and I have one nit inline, otherwise LGTM.

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
998–1001

Is there a way that you could reword this to make it slightly clearer what your chosen definition of "in scope" is?

This revision is now accepted and ready to land.Jan 31 2022, 4:59 AM
jmorse updated this revision to Diff 404535.Jan 31 2022, 7:59 AM

Revise comment for getBlocksInScope -- remove angst and uncertainty, refer to a PR for talking about the edge cases.

Orlando added inline comments.Jan 31 2022, 8:04 AM
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
999

This new comment is much clearer, thanks.
nit: cope -> scope

This revision was landed with ongoing or failed builds.Jan 31 2022, 8:46 AM
This revision was automatically updated to reflect the committed changes.