This is an archive of the discontinued LLVM Phabricator instance.

[llvm] adapt DWARFExpression.h for 6b9b86db9dd974585a5c71cf2e5231d1e3385f7c
ClosedPublic

Authored by krasimir on Nov 15 2021, 12:42 PM.

Diff Detail

Event Timeline

krasimir requested review of this revision.Nov 15 2021, 12:42 PM
krasimir created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2021, 12:42 PM
krasimir added a subscriber: dexonsmith.
This revision was not accepted when it landed; it landed in state Needs Review.Nov 15 2021, 1:09 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
dexonsmith added inline comments.Nov 15 2021, 1:12 PM
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
106

Should this be const Operation?

110

Do callers really want/need to modify the Operation?

127

Wondering if this should be const class Operation &operator*.

dexonsmith added inline comments.Nov 15 2021, 1:13 PM
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
124

Huh... this is a bit strange. Usually ++ returns iterator&...

Sorry for submitting quickly, I just wanted to unblock build bots. I still think that this patch is OK considering the weirdness of this Operation class.

llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
110

I think yes,

110
127

ditto, the problem is that all public members are non-const, so even checking for stuff needs non-const ref.

I pushed fa39ec5786c08e78cc247a48c17aef66ca5985fb, a35226b9b606f4ea32e7db9e2f4de0d99ab6bef0, and 7a1b670f0f2f0a38a673b5554bb2c4d9d50447bf to fix most of the blockers. Then https://reviews.llvm.org/D113957 fixes Operation::verify() and https://reviews.llvm.org/D113958 makes it iterate over const Operation and removes the mutable.

Sorry for submitting quickly, I just wanted to unblock build bots. I still think that this patch is OK considering the weirdness of this Operation class.

No worries; makes sense.

I pushed fa39ec5786c08e78cc247a48c17aef66ca5985fb, a35226b9b606f4ea32e7db9e2f4de0d99ab6bef0, and 7a1b670f0f2f0a38a673b5554bb2c4d9d50447bf to fix most of the blockers. Then https://reviews.llvm.org/D113957 fixes Operation::verify() and https://reviews.llvm.org/D113958 makes it iterate over const Operation and removes the mutable.

Thank you! These look good!