[llvm-dev] Opaque pointers and GEP

David Lloyd via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 11 06:52:22 PDT 2021


I was experimenting on godbolt with opaque pointers and I noticed that
while GEP with an opaque pointer type seems to work exactly as I would
expect, it returns a non-opaque pointer type.

Would it not make sense for GEP to return `ptr` when its basis pointer
is a `ptr`, at least when thinking about how a migration would work?

Here's an example: https://godbolt.org/z/3sWGbdKdx - the left compiler
is happy with a `bitcast` but the right one is angry without.

-- 
- DML • he/him



More information about the llvm-dev mailing list