Skip to content

Commit 8ae3551

Browse files
committed
C++: Normalize TInstruction in raw IR
This definition was denormalized to the extent that an instruction was defined in terms of the six main attributes it could be queried for. This made it possible to do multi-column joins on those six attributes, but it doesn't appear that this feature was useful in practice. The main multi-column join that was in use was on the pair of (`TranslatedElement, InstructionTag`), but the `TranslatedElement` was not part of the `TInstruction`. This commit changes `TInstruction` to be defined in terms of what it's _built from_ (`TranslatedElement, InstructionTag`) instead. This makes it possible to do multi-column joins on those two components, and then there are separate predicates (usually with two columns) to query instruction attributes, replacing the many uncached projections from `MkInstruction` that were generated before. An immediate advantage is that an `Expr` with multiple types will no longer give rise to multiple `Instruction`s, fixing most of the errors from the sanity query `ambiguousSuccessors`. The code inside `IRConstruction.qll` becomes simpler and hopefully faster as there is no longer a translation from `TranslatedElement` to `Locatable` and back again.
1 parent 6d3d902 commit 8ae3551

File tree

7 files changed

+342
-337
lines changed

7 files changed

+342
-337
lines changed

0 commit comments

Comments
 (0)