HomePhabricator

[Attributor] Don't access pointer elem type in constructPointer (NFC)

Authored by nikic on Mar 11 2021, 12:31 PM.

Description

[Attributor] Don't access pointer elem type in constructPointer (NFC)

Splitting this out as the change is non-trivial: The way this code
handled pointer types doesn't really make sense, as GEPs can only
apply an offset to the outermost pointer, but can't drill down
into interior pointer types (which would require dereferencing
memory).

Instead give special treatment to the first (pointer) index.
I've hardcoded it to zero as that's the only way the function is
used right now, but handling non-zero indexes would be
straightforward.

The original goal here was to have an element type for CreateGEP.

Details

Committed
nikicMar 11 2021, 12:36 PM
Parents
rG87fd09b25f88: [InstrProfiling] Generate runtime hook for ELF platforms
Branches
Unknown
Tags
Unknown