This is an archive of the discontinued LLVM Phabricator instance.

IR: Introduce a GlobalPointer type for all GlobalValues of pointer type.
AbandonedPublic

Authored by pcc on Oct 24 2016, 6:11 PM.

Details

Summary

At the moment, all GlobalValues are of pointer type, but a future
change will introduce a GlobalValue which is not of pointer type. See:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106434.html

To begin with, move PointerType *getType() and getValueType() to
GlobalPointer. Future changes will move other functionality to GlobalPointer.

Event Timeline

pcc updated this revision to Diff 75664.Oct 24 2016, 6:11 PM
pcc retitled this revision from to IR: Introduce a GlobalPointer type for all GlobalValues of pointer type..
pcc updated this object.
pcc added reviewers: efriedma, chandlerc, lattner.
pcc added a subscriber: llvm-commits.
lattner requested changes to this revision.Oct 24 2016, 9:39 PM
lattner edited edge metadata.

This doesn't seem like the right approach. It would be better to introduce a new top level IR concept to represent this, instead of violating the model of GlobalValue.

This revision now requires changes to proceed.Oct 24 2016, 9:39 PM
pcc added a comment.Oct 24 2016, 9:49 PM

Thanks Chris. I'm not really sure what you're proposing. Are you saying that you would like GlobalConstant to derive from Constant rather than GlobalValue?

chandlerc edited edge metadata.Oct 24 2016, 9:57 PM
In D25930#578185, @pcc wrote:

Thanks Chris. I'm not really sure what you're proposing. Are you saying that you would like GlobalConstant to derive from Constant rather than GlobalValue?

Can you both please follow up on the RFC thread that *already has* parts of the design discussion here?

I really don't want to fragment the discussion between this code review and the RFC thread.

pcc abandoned this revision.Nov 8 2016, 11:46 AM

We decided on a different approach.