C++: Add a BarrierGuard module for indirect instruction/operand nodes.
#18486
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.
On
mainwe haveBarrierGuardsfor:Operand/Instructionnodes for reasoning about barriers at the instruction level (usingDataFlow::InstructionBarrierGuard<myPredicate/3>::getABarrierNode())Exprnodes for reasoning about barriers at the expression level (using DataFlow::BarrierGuard<myPredicate/3>::getABarrierNode()`)Exprnodes for reasoning about barriers on the pointed-to value of an expression (usingDataFlow::BarrierGuard<myPredicate/3>::getAnIndirectBarrierNode())Spot an obvious missing one? We never added a
BarrierGuardfor reasoning about indirect instruction/operand nodes.Barriers on indirections are nice when working with functions that validate the data pointed to by an argument to a function call. For example:
currently, if you want to reason about
*data(that is, the indirection ofdata) you need to use anExpr-basedBarrierGuardas there is no module for indirect instruction/operand nodes.This PR adds
DataFlow::InstructionBarrierGuard<myPredicate/3>::getAnIndirectBarrierNode()to complete the missing API. We plan on using this predicate internally at Microsoft.Commit-by-commit review recommended:
node.asOperandreplaced withnode.asIndirectOperand. So nothing interesting going on there.I have not started a DCA run as this code isn't used by any queries yet.