C++: Support models-as-data barriers and barrier guards#21185
Merged
MathiasVP merged 8 commits intogithub:mainfrom Jan 21, 2026
Merged
C++: Support models-as-data barriers and barrier guards#21185MathiasVP merged 8 commits intogithub:mainfrom
MathiasVP merged 8 commits intogithub:mainfrom
Conversation
…r guards with flow states and will be necessary in the next commit for adding MaD specified barriers.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements support for models-as-data (MaD) barriers and barrier guards in C++, allowing barrier specifications to be defined through external YAML files rather than only in QL code.
Changes:
- Adds parameterized barrier guard modules to support additional parameters (kind and model identifiers) for MaD integration
- Implements interpretation of barrier and barrier guard MaD models in the flow summary and external flow infrastructure
- Adds comprehensive test coverage for both direct barriers and barrier guards with various indirection levels
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test.ql | Adds test infrastructure for external barrier guards using the barrierNode predicate |
| test.ext.yml | Defines MaD models for barrier functions and barrier guard functions |
| test.cpp | Adds test cases demonstrating barrier guards with various indirection patterns |
| SsaImpl.qll | Refactors barrier guard modules to support parameterization, enabling kind/model tracking |
| DataFlowUtil.qll | Adds parameterized versions of BarrierGuard and InstructionBarrierGuard modules |
| FlowSummaryImpl.qll | Implements interpretation of barrierModel and barrierGuardModel from MaD specifications |
| ExternalFlow.qll | Implements the main logic for converting MaD barrier specifications to barrier nodes |
Comments suppressed due to low confidence (1)
cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll:1046
- Incorrect apostrophe usage: "GuardValue
s" should be "GuardValues" and "Booleans" should be "Booleans" (no apostrophes for plurals).
// converting the barrier guard API to use `GuardValue`s instead `Boolean`s
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cpp/ql/test/library-tests/dataflow/ir-barrier-guards/test.ext.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit by commit review recommended.
@aschackmull is this something you can review?