This is an archive of the discontinued LLVM Phabricator instance.

Opaque Pointers: deprecate IRBuilder APIs that inspect pointee type
Needs ReviewPublic

Authored by t.p.northover on Aug 5 2020, 6:23 AM.

Details

Summary

The older APIs for creating load and GEP instructions just inferred the necessary pointee type from the value argument, but when pointers become opaque that's not going to be possible any more so IRBuilder has new calls that take an explicit pointee type.

This marks the older variants as deprecated and updates all places in LLVM & Clang to avoid the resulting warning. In almost all cases I was able to find the element type at the callsite in a future-proof way. The exceptions were AttributorAttributes.cpp and ScalarEvolutionExpander.cpp. They'll need to be fixed at some point but for now I've used getPointerElementType.

My main worry here is that it's likely to cause some work for out of tree maintainers to silence the warnings. For now they can mechanically add Whatever->getType()->getPointerElementType() if they don't want to do the real work, but it's still nontrivial.

Diff Detail

Event Timeline

t.p.northover created this revision.Aug 5 2020, 6:23 AM
Herald added a project: Restricted Project. · View Herald Transcript
t.p.northover requested review of this revision.Aug 5 2020, 6:23 AM
ychen added a subscriber: ychen.Aug 5 2020, 8:41 AM