forked from OSchip/llvm-project
[OpaquePtrs] Deprecate PointerType::getElementType()
This deprecates PointerType::getElementType() in favor of Type::getPointerElementType(). The motivation is to make it more apparent when code accesses the pointer element type, because getElementType() may also also refer to at least ArrayType::getElementType() and VectorType::getElementType(). Differential Revision: https://reviews.llvm.org/D117885
This commit is contained in:
parent
22487280dc
commit
184591aeeb
|
@ -667,9 +667,11 @@ public:
|
|||
unsigned AddressSpace) {
|
||||
if (PT->isOpaque())
|
||||
return get(PT->getContext(), AddressSpace);
|
||||
return get(PT->getElementType(), AddressSpace);
|
||||
return get(PT->PointeeTy, AddressSpace);
|
||||
}
|
||||
|
||||
[[deprecated("Pointer element types are deprecated. You can *temporarily* "
|
||||
"use Type::getPointerElementType() instead")]]
|
||||
Type *getElementType() const {
|
||||
assert(!isOpaque() && "Attempting to get element type of opaque pointer");
|
||||
return PointeeTy;
|
||||
|
|
Loading…
Reference in New Issue