Merge pull request #21360 from microsoft/unbreak-changes

C++: Provide `BarrierGuard` API without a `Unit` column when instantiating non-parameterized `BarrierGuard`s
This commit is contained in:
Mathias Vorreiter Pedersen
2026-02-24 16:57:58 +00:00
committed by GitHub
3 changed files with 70 additions and 3 deletions

View File

@@ -15,7 +15,10 @@ predicate instructionGuardChecks(IRGuardCondition gc, Instruction checked, boole
module BarrierGuard = DataFlow::InstructionBarrierGuard<instructionGuardChecks/3>;
predicate indirectBarrierGuard(DataFlow::Node node, string s) {
node = BarrierGuard::getAnIndirectBarrierNode(_) and
// This any(...) could technically be removed, but it helps us verify that we don't
// accidentially change the API of this predicate (for instance, by having
// the column be a unit parameter).
node = BarrierGuard::getAnIndirectBarrierNode(any(int indirectionIndex)) and
if node.isGLValue()
then s = "glval<" + node.getType().toString().replaceAll(" ", "") + ">"
else s = node.getType().toString().replaceAll(" ", "")