This is an archive of the discontinued LLVM Phabricator instance.

[Statepoints][NFC] Constify accessors on Statepoint.
ClosedPublic

Authored by sanjoy on Jun 25 2015, 5:51 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy updated this revision to Diff 28520.Jun 25 2015, 5:51 PM
sanjoy retitled this revision from to [Statepoints][NFC] Constify accessors on Statepoint..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added a subscriber: Unknown Object (MLST).
reames added a subscriber: reames.Jun 26 2015, 11:31 AM

Returning a pointer to a non-const component of the underlying call from
a const function seems deceptive.

ValueTy *getActualCallee() const {

I'm open to being convinced that's reasonable, but I'd prefer to see
those left non-const or overrides which return pointers-to-const added.

Philip

Returning a pointer to a non-const component of the underlying call from
a const function seems deceptive.

I wouldn't quite call it deceptive -- CallSite uses the same idiom, and the const conveys that, for instance, there is no caching going on in the background and the calling getArgument is reallyt idempotent.

ValueTy *getActualCallee() const {

I'm open to being convinced that's reasonable, but I'd prefer to see
those left non-const or overrides which return pointers-to-const added.

ImmutableStatepoint will return const Value *s as usual.

Having said that, I'm not going to argue that this change is a particularly useful one; the real reason behind this change and D10756 is to make Statepoint more similar to CallSite with the eventual goal of merging these classes.

Philip

This revision was automatically updated to reflect the committed changes.