Add type mentions to control flow element handling

This commit is contained in:
copilot-swe-agent[bot]
2026-06-22 12:29:48 +00:00
committed by GitHub
parent 7197cc56dd
commit d7ec468e2e
3 changed files with 9 additions and 2 deletions

View File

@@ -121,6 +121,13 @@ private module Cached {
result = getAChildExpr(parent)
or
result = parent.getAChildStmt()
or
result =
any(TypeMention tm |
tm.getTarget() = parent
or
tm.getParent+().getTarget() = parent
)
}
private predicate parent(ControlFlowElement child, ExprOrStmtParent parent) {

View File

@@ -20,7 +20,7 @@ class ControlFlowElementOrCallable extends ExprOrStmtParent, TControlFlowElement
*/
class ControlFlowElement extends ControlFlowElementOrCallable, @control_flow_element {
/** Gets the enclosing callable of this element, if any. */
Callable getEnclosingCallable() { none() }
Callable getEnclosingCallable() { enclosingCallable(this, result) }
/** Gets the assembly that this element was compiled into. */
Assembly getAssembly() {

View File

@@ -1369,7 +1369,7 @@ compiler_generated(unique int id: @element ref);
/** CONTROL/DATA FLOW **/
@control_flow_element = @stmt | @expr | @parameter;
@control_flow_element = @stmt | @expr | @parameter | @type_mention;
/* XML Files */