Revert "C++: Don't count write operations as uses."

This reverts commit 092beb8b73.
This commit is contained in:
Mathias Vorreiter Pedersen
2021-11-03 10:37:32 +00:00
parent 3e6ac74d73
commit ad5619ff07

View File

@@ -182,16 +182,10 @@ private class ReturnParameterIndirection extends Use, TReturnParamIndirection {
}
private predicate isExplicitUse(Operand op) {
exists(VariableAddressInstruction vai | vai = op.getDef() |
// Don't include this operand as a use if it only exists to initialize the
// indirection of a parameter.
not exists(LoadInstruction load |
load.getSourceAddressOperand() = op and
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
) and
// Don't include this operand as a use if the only use of the address is for a write
// that definately overrides a variable.
not (explicitWrite(true, _, vai) and exists(unique( | | vai.getAUse())))
op.getDef() instanceof VariableAddressInstruction and
not exists(LoadInstruction load |
load.getSourceAddressOperand() = op and
load.getAUse().getUse() instanceof InitializeIndirectionInstruction
)
}