Python: Remove pointless LocalSourceNodes

This gets rid of a large number of nodes that seemingly have no impact.
This commit is contained in:
Taus
2021-07-01 15:02:31 +00:00
committed by GitHub
parent d325d2ae81
commit 336c0662ef

View File

@@ -40,7 +40,16 @@ class LocalSourceNode extends Node {
// Both of these preserve the identity of the underlying pointer, and hence we exclude these as
// local source nodes.
// We do, however, allow the post-update nodes that arise from object creation (which are non-synthetic).
not this instanceof SyntheticPostUpdateNode
not this instanceof SyntheticPostUpdateNode and
// With similar reasoning to the above, we also exclude the following synthesized nodes
not this instanceof SyntheticPreUpdateNode and
not this instanceof KwOverflowNode and
not this instanceof PosOverflowNode and
not this instanceof KwUnpackedNode and
not this instanceof IterableSequenceNode and
not this instanceof IterableElementNode and
// ESSA nodes are also superfluous
not this instanceof EssaNode
or
this = any(ModuleVariableNode mvn).getARead()
}