During development I often used NoSrc for some nodes for which it wasn't clear what node they corresponded to. We should fix this.
There are 2 potential directions we can go to:
-
We make all sources an instance of ASTSource, and just use that as source information. Source wouldn't carry any more information beyond just what location in the original code does this roughly correspond to.
-
We have multiple classes for the various "source" relations. For example, given this piece of code:
uint[] memory a;
...
foo(a):
Where foo(uint[] storage) expect storage, a call to some copy function is emitted in the IR for the implict cast. We can have a special class ImplicitCast that tracks that this call is due to the implicit cast of the argument a.
Not sure if 2 is worth it? Might be overkill. Also its possible to just go with (1) for now and eventually convert to 2 if we feel we need the extra info? Need to think a bit more on this.
During development I often used NoSrc for some nodes for which it wasn't clear what node they corresponded to. We should fix this.
There are 2 potential directions we can go to:
We make all sources an instance of
ASTSource, and just use that as source information. Source wouldn't carry any more information beyond just what location in the original code does this roughly correspond to.We have multiple classes for the various "source" relations. For example, given this piece of code:
Where
foo(uint[] storage)expect storage, a call to some copy function is emitted in the IR for the implict cast. We can have a special classImplicitCastthat tracks that this call is due to the implicit cast of the argumenta.Not sure if 2 is worth it? Might be overkill. Also its possible to just go with (1) for now and eventually convert to 2 if we feel we need the extra info? Need to think a bit more on this.