This is an archive of the discontinued LLVM Phabricator instance.

[lldb-mi] Clean up CMICmdArgSet usage.
ClosedPublic

Authored by brucem on Sep 15 2015, 2:22 AM.

Details

Summary

CMICmdArgSet stores a vector of non-const pointers to the arguments
that it is validating. It owns them and is responsible for deleting
them.

We don't need to pass a const reference to the argument to
CMICmdArgSet::Add and then take the address and const_cast it
when we can just pass the argument pointer in directly.

This lets us remove some noise at every call site for CMICmdArgSet::Add
and then clean up a couple of bits inside CMICmdArgSet to remove
const_casts.

Diff Detail

Repository
rL LLVM

Event Timeline

brucem updated this revision to Diff 34790.Sep 15 2015, 2:22 AM
brucem retitled this revision from to [lldb-mi] Clean up CMICmdArgSet usage..
brucem updated this object.
brucem added reviewers: abidh, ki.stfu, domipheus.
brucem added a subscriber: lldb-commits.

This could be cleaner still, but this is a good first pass and removes the worst of it.

tools/lldb-mi/MICmdArgSet.cpp
92 ↗(On Diff #34790)

Should this say something other than (R) here?

ki.stfu accepted this revision.Sep 15 2015, 3:55 AM
ki.stfu edited edge metadata.

lgtm

tools/lldb-mi/MICmdArgSet.cpp
92 ↗(On Diff #34790)

This comment is useless, and for me it looks like an attempt to write something to follow the coding style. FMPOV, we should remove all comments like that, and move others to corresponding .h files.

This revision is now accepted and ready to land.Sep 15 2015, 3:55 AM
brucem added inline comments.Sep 15 2015, 4:48 AM
tools/lldb-mi/MICmdArgSet.cpp
92 ↗(On Diff #34790)

If / when that move happens, we should also move to Doxygen syntax.

This revision was automatically updated to reflect the committed changes.