This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] printCompactDWARFExpr: don't assert on stack size
ClosedPublic

Authored by scott.linder on Mar 30 2023, 1:51 PM.

Details

Summary

Gracefully handle non-1 stack sizes in printCompactDWARFExpr rather than
assert. Add support for DW_OP_nop and test the zero-sized stack case.

This is intended to be nearly NFC.

Diff Detail

Event Timeline

scott.linder created this revision.Mar 30 2023, 1:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 1:51 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
scott.linder requested review of this revision.Mar 30 2023, 1:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 1:51 PM
Orlando accepted this revision.Mar 31 2023, 1:30 AM
Orlando added a subscriber: Orlando.

Accepting and gracefully handling invalid expressions in printing code SGTM.

This revision is now accepted and ready to land.Mar 31 2023, 1:30 AM
dblaikie accepted this revision.Apr 3 2023, 12:13 PM
dblaikie added a subscriber: dblaikie.

Not the best error handling (like might be better returning Error from this function?) but probably OK.

Not the best error handling (like might be better returning Error from this function?) but probably OK.

I agree, but to avoid shaving too many yaks I adopted the existing mechanism for error handling in the function, which is to write an error message to OS and return false.