How should instrumentation look like? What data would the visitor need?
To uniquely identify a location, one would need the index of an instruction in the function as discussed in #2 .
One can uniquely identify if an instruction has to be instrumented as indicated by the InstrumentType enum.
On the first scan of the .wat, we can change InstrumentType to associated value. Second scan as we hit one of this, we do the instrumentation, and then change it back to InstrumentType::NotInstrumented and look for the next one that has a InstrumentType value that is not NotInstrumented.
How should instrumentation look like? What data would the visitor need?
To uniquely identify a location, one would need the index of an instruction in the function as discussed in #2 . One can uniquely identify if an instruction has to be instrumented as indicated by the
InstrumentType
enum.On the first scan of the
.wat
, we can changeInstrumentType
to associated value. Second scan as we hit one of this, we do the instrumentation, and then change it back toInstrumentType::NotInstrumented
and look for the next one that has aInstrumentType
value that is notNotInstrumented
.