[PATCH] D102744: [OpaquePtr] Make GEPs work with opaque pointers
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 11:28:42 PDT 2021
dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.
Looks OK if that expression cleanup can be done - if it can't be done for some reason, might be worth adding a utility function like `isOpaqueOrPointeeTypeMatches` that can handle this case.
================
Comment at: llvm/include/llvm/IR/Instructions.h:957-959
+ assert(cast<PointerType>(Ptr->getType()->getScalarType())->isOpaque() ||
+ PointeeType == cast<PointerType>(Ptr->getType()->getScalarType())
+ ->getElementType());
----------------
Could this be written as:
```
assert(cast<PointerType>(Ptr->getType()->getScalarType())->isOpaqueOrPointeeTypeMatches(PointeeType));
```
? (similarly above)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102744/new/
https://reviews.llvm.org/D102744
More information about the llvm-commits
mailing list