Merge pull request #7469 from hvitved/csharp/promote-adhoc-consistency-checks

C#: Promote existing ad-hoc consistency checks to consistency queries
This commit is contained in:
Tom Hvitved
2022-01-10 11:10:25 +01:00
committed by GitHub
24 changed files with 156 additions and 157 deletions

View File

@@ -659,4 +659,15 @@ module Consistency {
not phiHasInputFromBlock(_, def, _) and
not uncertainWriteDefinitionInput(_, def)
}
query predicate notDominatedByDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
exists(BasicBlock bbDef, int iDef | def.definesAt(v, bbDef, iDef) |
ssaDefReachesReadWithinBlock(v, def, bb, i) and
(bb != bbDef or i < iDef)
or
ssaDefReachesRead(v, def, bb, i) and
not ssaDefReachesReadWithinBlock(v, def, bb, i) and
not def.definesAt(v, getImmediateBasicBlockDominator*(bb), _)
)
}
}