- private void addOrderingConstraintFromCompLocParamToArg(MethodDescriptor mdCaller,
- MethodInvokeNode min) {
- System.out.println("-addOrderingConstraintFromCompLocParamToArg=" + min.printNode(0));
-
- GlobalFlowGraph globalGraph = getSubGlobalFlowGraph(ssjava.getMethodContainingSSJavaLoop());
-
- Set<NTuple<Location>> pcLocTupleSet = getPCLocTupleSet(min);
-
- MethodDescriptor mdCallee = min.getMethod();
-
- FlowGraph calleeFlowGraph = getFlowGraph(mdCallee);
- for (int idx = 0; idx < calleeFlowGraph.getNumParameters(); idx++) {
- FlowNode paramNode = calleeFlowGraph.getParamFlowNode(idx);
- NTuple<Location> globalParamLocTuple =
- translateToLocTuple(mdCallee, paramNode.getDescTuple());
- translateToLocTuple(mdCallee, paramNode.getDescTuple());
- CompositeLocation compLoc = paramNode.getCompositeLocation();
- System.out.println("---paramNode=" + paramNode + " compLoc=" + compLoc);
- if (compLoc != null) {
- NTuple<Descriptor> argTuple = getNodeTupleByArgIdx(min, idx);
- NTuple<Location> globalArgLocTuple = translateToLocTuple(mdCaller, argTuple);
-
- if (!isLiteralValueLocTuple(globalArgLocTuple)
- && !isLiteralValueLocTuple(globalParamLocTuple)) {
- if (!globalGraph.hasValueFlowEdge(globalArgLocTuple, globalParamLocTuple)) {
- System.out.println("----- add global flow globalArgLocTuple=" + globalArgLocTuple
- + "-> globalParamLocTuple=" + globalParamLocTuple);
- hasChanges = true;
- globalGraph.addValueFlowEdge(globalArgLocTuple, globalParamLocTuple);
- }
- }
-
- for (Iterator iterator = pcLocTupleSet.iterator(); iterator.hasNext();) {
- NTuple<Location> pcLocTuple = (NTuple<Location>) iterator.next();
-
- if (!isLiteralValueLocTuple(pcLocTuple) && !isLiteralValueLocTuple(globalParamLocTuple)) {
- if (!globalGraph.hasValueFlowEdge(pcLocTuple, globalParamLocTuple)) {
- System.out
- .println("----- add global flow PCLOC="
- + pcLocTuple
- + "-> globalParamLocTu!globalArgLocTuple.get(0).getLocDescriptor().equals(LITERALDESC)ple="
- + globalParamLocTuple);
- hasChanges = true;
-
- globalGraph.addValueFlowEdge(pcLocTuple, globalParamLocTuple);
- }
- }
-
- }
- }
- }
- }
-
- private boolean isLiteralValueLocTuple(NTuple<Location> locTuple) {
- return locTuple.get(0).getLocDescriptor().equals(LITERALDESC);
- }
-