Tracing updates in the variables requires an insertion of additional (debug-only) node into compilation graph.
This however is impossible if we produce debug info in a separate module.
Therefore a design change was required and this PR implements it. In here we are removing a module dedicated for debug only: starting from this PR the DI builder writes to the same module as the compiler Builder. The added debug info consists of:
additional debug nodes;
metadata debug info attached to the existing compiler created nodes.
The nodes does not affect anything in the llvm BE, since any optimization either knows how to update debug info, or just drops this info otherwise.
Also keep in mind that any debug related changes in the compiler graph (nodes or metadata) are activated only with "-g" compilation option. If "-g" is not set any call to a DIBuilder->func (or similar) is void.
Notable changes
All named local variables, %local_1 in the example below, appended with an extra debug call @llvm.dbg.declare
Motivation
Tracing updates in the variables requires an insertion of additional (debug-only) node into compilation graph. This however is impossible if we produce debug info in a separate module.
Therefore a design change was required and this PR implements it. In here we are removing a module dedicated for debug only: starting from this PR the DI builder writes to the same module as the compiler Builder. The added debug info consists of:
Also keep in mind that any debug related changes in the compiler graph (nodes or metadata) are activated only with "-g" compilation option. If "-g" is not set any call to a DIBuilder->func (or similar) is void.
Notable changes
Ref issue
https://github.com/anza-xyz/move/issues/403