C++: Add some comments to the two 'flowThrough' predicates.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-11-24 10:50:44 +00:00
parent 2e7ddb479e
commit 6c7a01d3d5

View File

@@ -863,7 +863,12 @@ module ReadNodeFlow {
)
}
/** Holds if the read node `nodeTo` should receive flow from the read node `nodeFrom`. */
/**
* Holds if the read node `nodeTo` should receive flow from the read node `nodeFrom`.
*
* This happens when `readFrom` is _not_ the source of a `readStep`, and `nodeTo` is
* the `ReadNode` that represents an address that directly depends on `nodeFrom`.
*/
predicate flowThrough(ReadNode nodeFrom, ReadNode nodeTo) {
not readStep(nodeFrom, _, _) and
nodeFrom.getOuter() = nodeTo
@@ -911,11 +916,16 @@ module StoreNodeFlow {
nodeTo.flowInto(Ssa::getDestinationAddress(instrFrom))
}
/** Holds if the store node `nodeTo` should receive flow from `nodeFom`. */
predicate flowThrough(StoreNode nFrom, StoreNode nodeTo) {
/**
* Holds if the store node `nodeTo` should receive flow from `nodeFom`.
*
* This happens when `nodeFrom` is _not_ the source of a `storeStep`, and `nodeFrom` is
* the `Storenode` that represents an address that directly depends on `nodeTo`.
*/
predicate flowThrough(StoreNode nodeFrom, StoreNode nodeTo) {
// Flow through a post update node that doesn't need a store step.
not storeStep(nFrom, _, _) and
nodeTo.getOuter() = nFrom
not storeStep(nodeFrom, _, _) and
nodeTo.getOuter() = nodeFrom
}
/**