refactor: set default lineinfo on state/block#2344
Conversation
…2581) ## Description DaCe now comes with a configuration option whether or not to inspect the python stack in case debug information (e.g. line number) is missing. We previously used a fake `DebugInfo` object to prevent the call to `inspect()`. With the new configuration option, we can remove those fake objects again and just configure the desired behavior. A word of caution: until spcl/dace#2344 or something similar is merged, DaCe will output a ton of deprecation warnings caused by the addition of the new config option. ## Requirements - [ ] All fixes and/or new features come with corresponding tests. N/A - [ ] Important design decisions have been documented in the appropriate ADR inside the [docs/development/ADRs/](docs/development/ADRs/README.md) folder. N/A
tbennun
left a comment
There was a problem hiding this comment.
I think the current diff in newast is overkill and we can just wrap the parts that change pv.current_lineinfo with the with statement instead. Any reason not to?
|
I agree, it doesn't look pretty now. I don't have a mental picture of I guess one could automatically set I start to wonder why we changed the signature of |
## Description In PR spcl#2321 we introduced a way to turn of automatic stack inspection when adding a node to a state without explicitly stating debug info (such as file name, line info, ...). Since merging this PR, we get a ton of `DeprecationWarning`s from code added in `_get_debug_info()`. In a first attempt (see PR spcl#2344), we tried to work around the issue by setting `._default_line_info` on the state. This method proved to be very verbose and unnecessarily complicates parsing, where we have a legitimate use-case for explicitly passing along an explicit `DebugInfo`. This PR suggests to keep the API of `state.add_*()` functions as before, partially reverting changes from PR spcl#2321. Doing so, we can drop the deprecation warnings because nothing changes.
Description
Follow-up from PR #2321, we shouldn't set
debuginfoanymore to aDebugInfoobject when adding things to aState(or CFG Block). Instead, we set thedefault_lineinfoon thatState.