This is an archive of the discontinued LLVM Phabricator instance.

Add "const" in GetUnderlyingObjects
ClosedPublic

Authored by bjope on Apr 23 2019, 2:20 PM.

Details

Summary

Both the input Value pointer and the returned Value
pointers in GetUnderlyingObjects are now declared as
const.

It turned out that all current (in-tree) uses of
GetUnderlyingObjects were trivial to update, being
satisfied with have those Value pointers declared
as const. Actually, in the past several of the users
had to use const_cast, just because of ValueTracking
not providing a version of GetUnderlyingObjects with
"const" Value pointers. With this patch we get rid
of those const casts.

Event Timeline

bjope created this revision.Apr 23 2019, 2:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2019, 2:20 PM
jkorous accepted this revision.Apr 23 2019, 5:50 PM
jkorous added a subscriber: jkorous.

Seems like a NFC.
Looks awesome to me - const correctness for the win!

This revision is now accepted and ready to land.Apr 23 2019, 5:50 PM

Seems like a NFC.
Looks awesome to me - const correctness for the win!

Thanks! I'll add "NFC" to the commit msg before pushing.

This revision was automatically updated to reflect the committed changes.