Skip to content

Commit 8448489

Browse files
yoffCopilot
andcommitted
Python: introduce new-CFG facade
Adds 'Cfg.qll' alongside 'AstNodeImpl.qll' in the controlflow internal package. The facade re-exposes the same API surface as the legacy 'semmle/python/Flow.qll' (ControlFlowNode, BasicBlock, NameNode, CallNode, AttrNode, ImportExprNode, ImportMemberNode, ImportStarNode, SubscriptNode, CompareNode, IfExprNode, AssignmentExprNode, BinaryExprNode, BoolExprNode, UnaryExprNode, DefinitionNode, DeletionNode, ForNode, RaiseStmtNode, StarredNode, ExceptFlowNode, ExceptGroupFlowNode, TupleNode, ListNode, SetNode, DictNode, IterableNode, NameConstantNode), but is implemented on top of the new shared CFG via 'AstNodeImpl.qll'. The variable-identity predicates ('NameNode.defines', '.uses', '.deletes', '.isLocal', '.isNonLocal', ...) are one-line bridges to the underlying AST predicates ('Name.defines', '.uses', '.deletes'), mirroring the Java pattern. Re-exports 'EntryBasicBlock' and 'dominatingEdge/2' from the shared 'BB::CfgSig' produced by 'AstNodeImpl.qll', so downstream consumers (e.g. the SSA adapter) can wire the new CFG into other shared modules that expect a 'CfgSig' implementation. This facade is not yet consumed by the dataflow library — that is the next phase. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3c21bbf commit 8448489

1 file changed

Lines changed: 836 additions & 0 deletions

File tree

  • python/ql/lib/semmle/python/controlflow/internal

0 commit comments

Comments
 (0)