Baltoli / project-docs

Documents for my Part III project
0 stars 0 forks source link

How is a variable in an assertion mapped into IR? #8

Closed Baltoli closed 7 years ago

Baltoli commented 7 years ago

If we have an assertion such as:

eventually(
  acq_rel(lock)
)

How is lock translated into something the IR can use? I think this logic lives inside the argument parser, so it would be good to go digging there to make sure we can work out how to do this for static analysis.

Baltoli commented 7 years ago

This is actually done by the instrumenter, which has a method for collecting arguments at an assertion site (CollectArgs). This builds up a table mapping names to Values from the following sources:

It is possible to get the variable name back from each of these sources.

The assertion itself has a set of arguments with an index attached to them. Its argument vector is then populated by mapping the names in the manifest to the value found in scope.