mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
0eb179baf8
This commit makes possible to execute the GeneratedCodeBasicInfo (GCBI) Pass even on LLVM IR where the AnyPC and UnexpectedPC BasicBlocks are not present. This makes the GCBI pass more flexible, enabling more other passes to depend on it and to use it to retrieve informations on the generated code without architecture-dependent hacks. As an example, one can now use GCBI to retrieve the CSV representing the Stack Pointer Register or the Program Counter Register without relying on the register names (which are architecture-specific), even if some optimization pass along the decompilation pipeline has removed AnyPC or UnexpectedPC. Notice that the contracts of GCBI's methods has not been changed. Calling anyPC() or unexpectedPC() still asserts that those are not nullptr. The contract has just been moved from the execution stage of the pass (basically runOnModule), to the APIs used to query the results.