private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection<IClass> c) { BimodalMutableIntSet s = new BimodalMutableIntSet(); for (IClass klass : c) { int index = getInstanceKeyMapping().add(new ConcreteTypeKey(klass)); s.add(index); } return new OrdinalSet<>(s, getInstanceKeyMapping()); }
private OrdinalSet<InstanceKey> toOrdinalInstanceKeySet(Collection<IClass> c) { BimodalMutableIntSet s = new BimodalMutableIntSet(); for (IClass klass : c) { int index = getInstanceKeyMapping().add(new ConcreteTypeKey(klass)); s.add(index); } return new OrdinalSet<>(s, getInstanceKeyMapping()); }
/** * Record that we've discovered a call edge <c,d1> -> <s_p, d2> * * @param c global number identifying the call site node * @param d1 source fact at the call edge * @param d2 result fact (result of the call flow function) */ @SuppressWarnings("unused") public void addCallEdge(int c, int d1, int d2) { if (TabulationSolver.DEBUG_LEVEL > 0) { System.err.println("addCallEdge " + c + ' ' + d1 + ' ' + d2); } if (d1 == d2) { BimodalMutableIntSet s = (BimodalMutableIntSet) identityEdges.get(d1); if (s == null) { s = new BimodalMutableIntSet(); identityEdges.set(d1, s); } s.add(c); } else { IBinaryNaturalRelation R = edges.get(d2); if (R == null) { // we expect the first dimension of R to be dense, the second sparse R = new BasicNaturalRelation(new byte[] { BasicNaturalRelation.TWO_LEVEL }, BasicNaturalRelation.TWO_LEVEL); edges.set(d2, R); } R.add(c, d1); } }
/** * Record that we've discovered a call edge <c,d1> -> <s_p, d2> * * @param c global number identifying the call site node * @param d1 source fact at the call edge * @param d2 result fact (result of the call flow function) */ @SuppressWarnings("unused") public void addCallEdge(int c, int d1, int d2) { if (TabulationSolver.DEBUG_LEVEL > 0) { System.err.println("addCallEdge " + c + ' ' + d1 + ' ' + d2); } if (d1 == d2) { BimodalMutableIntSet s = (BimodalMutableIntSet) identityEdges.get(d1); if (s == null) { s = new BimodalMutableIntSet(); identityEdges.set(d1, s); } s.add(c); } else { IBinaryNaturalRelation R = edges.get(d2); if (R == null) { // we expect the first dimension of R to be dense, the second sparse R = new BasicNaturalRelation(new byte[] { BasicNaturalRelation.TWO_LEVEL }, BasicNaturalRelation.TWO_LEVEL); edges.set(d2, R); } R.add(c, d1); } }