mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
189fbe4651
Calls to `OpaqueExtractValue()` are meant to replace `extractvalue`s found in the LLVM IR. Since the type of an `OpaqueExtractValue` is identified by both the return type (extracted value) and the first argument's type (aggregate operand of the `extractvalue` instruction), we need to consider both when building the associated FunctionPool. Previously, we were identifying each `OpaqueExtractValue` variant using only the returned value, which was wrong. In fact, if we have two `extractvalue` instructions that extract a value of the same type (e.g. i32) from two different aggregate types (e.g. structA and structB), we have to define two different `OpaqueExtractValue`: one that returns an i32 and has a parameter of type structA, and one that returns an i32 and has a parameter of structB. If we use only the return type, we are not able to distinguish the two.