This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Add helper for finding entry value candidates [NFC]
ClosedPublic

Authored by dstenb on Nov 7 2019, 10:07 AM.

Details

Summary

The conditions that are used to determine if entry values should be
emitted for a parameter are quite many, and will grow slightly
in a follow-up commit, so move those to a helper function, as was
suggested in the code review for D69889.

Diff Detail

Event Timeline

dstenb created this revision.Nov 7 2019, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2019, 10:07 AM

Please remember to provide full-context diffs.

llvm/lib/CodeGen/LiveDebugValues.cpp
1304

Not clear why a lambda is better than a static function. The [&] captures way more than you need, for one thing. The only values it uses are MI (already passed as a parameter) and DebugEntryVals.

Thanks! This looks good to me, with minor nits inlined.

llvm/lib/CodeGen/LiveDebugValues.cpp
1304

Yes, If we are using lambdas, it is better to use an explicit capture instead of the default capture.

dstenb updated this revision to Diff 228416.Nov 8 2019, 4:38 AM

Move the helper to a separate function rather than a lambda. Include full diff context.

dstenb marked an inline comment as done.Nov 8 2019, 4:39 AM

Please remember to provide full-context diffs.

Yes, sorry about that!

llvm/lib/CodeGen/LiveDebugValues.cpp
95

Taken from D68209.

This looks very good to me! Thanks!

llvm/lib/CodeGen/LiveDebugValues.cpp
95

This is OK. I will rebase the diff on top of this one.

1361

One if with the &&?

dstenb updated this revision to Diff 228664.Nov 11 2019, 3:56 AM
dstenb marked an inline comment as done.

Merge if statements.

djtodoro accepted this revision.Nov 11 2019, 11:13 PM

lgtm, thanks!

This revision is now accepted and ready to land.Nov 11 2019, 11:13 PM
This revision was automatically updated to reflect the committed changes.