No verifier changes needed, the verifier currently doesn't check that
the pointer operand's pointee type matches the GEP type. There is a
similar check in GetElementPtrInst::Create() though.
Details
Details
- Reviewers
dblaikie - Commits
- rG28b9771472fa: [OpaquePtr] Make GEPs work with opaque pointers
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
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.
llvm/include/llvm/IR/Instructions.h | ||
---|---|---|
957–959 | Could this be written as: assert(cast<PointerType>(Ptr->getType()->getScalarType())->isOpaqueOrPointeeTypeMatches(PointeeType)); ? (similarly above) |
Could this be written as:
? (similarly above)