-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Support models-as-data barriers and barrier guards #21185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…r guards with flow states and will be necessary in the next commit for adding MaD specified barriers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
Commit by commit review recommended.
@aschackmull is this something you can review?