@@ -150,7 +150,7 @@ class Node extends TIRDataFlowNode {
150150 /**
151151 * INTERNAL: Do not use.
152152 */
153- Declaration getEnclosingCallable ( ) { none ( ) } // overridden in subclasses
153+ DataFlowCallable getEnclosingCallable ( ) { none ( ) } // overridden in subclasses
154154
155155 /** Gets the function to which this node belongs, if any. */
156156 Declaration getFunction ( ) { none ( ) } // overridden in subclasses
@@ -503,7 +503,7 @@ private class Node0 extends Node, TNode0 {
503503
504504 Node0 ( ) { this = TNode0 ( node ) }
505505
506- override Declaration getEnclosingCallable ( ) { result = node .getEnclosingCallable ( ) }
506+ override DataFlowCallable getEnclosingCallable ( ) { result = node .getEnclosingCallable ( ) }
507507
508508 override Declaration getFunction ( ) { result = node .getFunction ( ) }
509509
@@ -568,7 +568,7 @@ class PostUpdateNodeImpl extends PartialDefinitionNode, TPostUpdateNodeImpl {
568568
569569 override Declaration getFunction ( ) { result = operand .getUse ( ) .getEnclosingFunction ( ) }
570570
571- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
571+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
572572
573573 /** Gets the operand associated with this node. */
574574 Operand getOperand ( ) { result = operand }
@@ -621,7 +621,7 @@ class SsaPhiNode extends Node, TSsaPhiNode {
621621 /** Gets the phi node associated with this node. */
622622 Ssa:: PhiNode getPhiNode ( ) { result = phi }
623623
624- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
624+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
625625
626626 override Declaration getFunction ( ) { result = phi .getBasicBlock ( ) .getEnclosingFunction ( ) }
627627
@@ -690,7 +690,7 @@ class SideEffectOperandNode extends Node instanceof IndirectOperand {
690690
691691 int getArgumentIndex ( ) { result = argumentIndex }
692692
693- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
693+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
694694
695695 override Declaration getFunction ( ) { result = call .getEnclosingFunction ( ) }
696696
@@ -711,7 +711,7 @@ class FinalGlobalValue extends Node, TFinalGlobalValue {
711711 /** Gets the underlying SSA use. */
712712 Ssa:: GlobalUse getGlobalUse ( ) { result = globalUse }
713713
714- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
714+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
715715
716716 override Declaration getFunction ( ) { result = globalUse .getIRFunction ( ) .getFunction ( ) }
717717
@@ -741,7 +741,7 @@ class InitialGlobalValue extends Node, TInitialGlobalValue {
741741 /** Gets the underlying SSA definition. */
742742 Ssa:: GlobalDef getGlobalDef ( ) { result = globalDef }
743743
744- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
744+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
745745
746746 override Declaration getFunction ( ) { result = globalDef .getIRFunction ( ) .getFunction ( ) }
747747
@@ -778,7 +778,7 @@ class FlowSummaryNode extends Node, TFlowSummaryNode {
778778 * TODO: QLDoc.
779779 */
780780 override DataFlowCallable getEnclosingCallable ( ) {
781- none ( ) // result.asSummarizedCallable() = this.getSummarizedCallable() TODO
781+ result = TSummarizedCallable ( this .getSummarizedCallable ( ) )
782782 }
783783
784784 override Location getLocationImpl ( ) { result = this .getSummarizedCallable ( ) .getLocation ( ) }
@@ -801,7 +801,7 @@ class IndirectParameterNode extends Node instanceof IndirectInstruction {
801801 /** Gets the parameter whose indirection is initialized. */
802802 Parameter getParameter ( ) { result = init .getParameter ( ) }
803803
804- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
804+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
805805
806806 override Declaration getFunction ( ) { result = init .getEnclosingFunction ( ) }
807807
@@ -836,7 +836,7 @@ class IndirectReturnNode extends Node {
836836 .hasOperandAndIndirectionIndex ( any ( ReturnValueInstruction ret ) .getReturnAddressOperand ( ) , _)
837837 }
838838
839- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
839+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
840840
841841 /**
842842 * Holds if this node represents the value that is returned to the caller
@@ -1031,7 +1031,7 @@ private module RawIndirectNodes {
10311031 result = this .getOperand ( ) .getDef ( ) .getEnclosingFunction ( )
10321032 }
10331033
1034- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
1034+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
10351035
10361036 override DataFlowType getType ( ) {
10371037 exists ( int sub , DataFlowType type , boolean isGLValue |
@@ -1073,7 +1073,7 @@ private module RawIndirectNodes {
10731073
10741074 override Declaration getFunction ( ) { result = this .getInstruction ( ) .getEnclosingFunction ( ) }
10751075
1076- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
1076+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
10771077
10781078 override DataFlowType getType ( ) {
10791079 exists ( int sub , DataFlowType type , boolean isGLValue |
@@ -1171,7 +1171,7 @@ class FinalParameterNode extends Node, TFinalParameterNode {
11711171
11721172 override Declaration getFunction ( ) { result = p .getFunction ( ) }
11731173
1174- override Declaration getEnclosingCallable ( ) { result = this .getFunction ( ) }
1174+ override DataFlowCallable getEnclosingCallable ( ) { result = TSourceCallable ( this .getFunction ( ) ) }
11751175
11761176 override DataFlowType getType ( ) { result = getTypeImpl ( p .getUnspecifiedType ( ) , indirectionIndex ) }
11771177
@@ -1704,7 +1704,7 @@ private predicate indirectParameterNodeHasArgumentIndexAndIndex(
17041704/** A synthetic parameter to model the pointed-to object of a pointer parameter. */
17051705class ParameterIndirectionNode extends ParameterNode instanceof IndirectParameterNode {
17061706 override predicate isParameterOf ( Function f , ParameterPosition pos ) {
1707- IndirectParameterNode .super .getEnclosingCallable ( ) = f and
1707+ IndirectParameterNode .super .getEnclosingCallable ( ) . asSourceCallable ( ) = f and
17081708 exists ( int argumentIndex , int indirectionIndex |
17091709 indirectPositionHasArgumentIndexAndIndex ( pos , argumentIndex , indirectionIndex ) and
17101710 indirectParameterNodeHasArgumentIndexAndIndex ( this , argumentIndex , indirectionIndex )
@@ -1795,13 +1795,13 @@ class VariableNode extends Node, TVariableNode {
17951795
17961796 override Declaration getFunction ( ) { none ( ) }
17971797
1798- override Declaration getEnclosingCallable ( ) {
1798+ override DataFlowCallable getEnclosingCallable ( ) {
17991799 // When flow crosses from one _enclosing callable_ to another, the
18001800 // interprocedural data-flow library discards call contexts and inserts a
18011801 // node in the big-step relation used for human-readable path explanations.
18021802 // Therefore we want a distinct enclosing callable for each `VariableNode`,
18031803 // and that can be the `Variable` itself.
1804- result = v
1804+ result = TSourceCallable ( v )
18051805 }
18061806
18071807 override DataFlowType getType ( ) {
0 commit comments