@@ -918,11 +918,12 @@ IRBlock getBasicBlock(Node node) {
918
918
*/
919
919
pragma [ nomagic]
920
920
int getAdditionalFlowIntoCallNodeTerm ( ArgumentNode arg , ParameterNode p ) {
921
- exists ( ParameterNode switchee , ConditionOperand op , DataFlowCall call |
921
+ exists ( ParameterNode switchee , SwitchInstruction switch , ConditionOperand op , DataFlowCall call |
922
922
viableParamArg ( call , p , arg ) and
923
923
viableParamArg ( call , switchee , _) and
924
+ switch .getExpressionOperand ( ) = op and
924
925
valueNumber ( switchee .asInstruction ( ) ) .getAUse ( ) = op and
925
- result = countNumberOfBranchesUsingParameter ( op , p )
926
+ result = countNumberOfBranchesUsingParameter ( switch , p )
926
927
)
927
928
}
928
929
@@ -954,9 +955,8 @@ private EdgeKind caseOrDefaultEdge() {
954
955
/**
955
956
* Gets the number of switch branches that that read from (or write to) the parameter `p`.
956
957
*/
957
- int countNumberOfBranchesUsingParameter ( ConditionOperand op , ParameterNode p ) {
958
- exists ( SwitchInstruction switch , Ssa:: SourceVariable sv |
959
- switch .getExpressionOperand ( ) = op and
958
+ int countNumberOfBranchesUsingParameter ( SwitchInstruction switch , ParameterNode p ) {
959
+ exists ( Ssa:: SourceVariable sv |
960
960
parameterNodeHasSourceVariable ( p , sv ) and
961
961
// Count the number of cases that use the parameter. We do this by finding the phi node
962
962
// that merges the uses/defs of the parameter. There might be multiple such phi nodes, so
0 commit comments