This is an archive of the discontinued LLVM Phabricator instance.

[Dominators] Change getNode parameter type to const NodeT * (NFC).
ClosedPublic

Authored by fhahn on Jun 15 2018, 12:23 PM.

Details

Summary

DominatorTreeBase::getNode does not modify its parameter and this change
allows callers that only have access to const pointers to use it without
casting.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Jun 15 2018, 12:23 PM
fhahn added a subscriber: sdesmalen.
dblaikie accepted this revision.Jun 15 2018, 12:34 PM

Feel free to commit changes like this without review - seems sensible/obvious enough. (in theory you could write a unit test, perhaps? but hardly seems worth it for this change - maybe if an existing test covers this code you could change it to have a const parameter)

This revision is now accepted and ready to land.Jun 15 2018, 12:34 PM
kuhar added inline comments.Jun 15 2018, 12:40 PM
include/llvm/Support/GenericDomTree.h
362 ↗(On Diff #151540)

How about this place?

This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Jun 16 2018, 8:59 AM

Thanks, I've committed this and added const to the operator[] type as well as tweaked a test to pass in a const pointer.