/** * */ public ParanoidHashSet() { super(); hcFreq = HashMapFactory.make(); }
public void addConstant(Integer vn, ConstantValue value) { if (constantValues == null) constantValues = HashMapFactory.make(5); constantValues.put(vn, value); }
private static Map<ContextKey, InstanceKey> makeMap(InstanceKey[] x) { Map<ContextKey, InstanceKey> result = HashMapFactory.make(); for(int i = 0; i < x.length; i++) { if (x[i] != null) { result.put(ContextKey.PARAMETERS[i], x[i]); } } return result; }
/** * Collect analysis result for each {@link CGNode} in a {@link Map}. */ public static <T> Map<CGNode, Collection<T>> collectNodeResults(CallGraph cg, Function<CGNode, Collection<T>> nodeResultComputer) { Map<CGNode, Collection<T>> result = HashMapFactory.make(); for (CGNode n : cg) { result.put(n, nodeResultComputer.apply(n)); } return result; } }
public XMLSummaryWriter() throws ParserConfigurationException { DocumentBuilderFactory docFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); doc = docBuilder.newDocument(); rootElement = doc.createElement(E_SUMMARY_SPEC); doc.appendChild(rootElement); classElts = HashMapFactory.make(); }
public static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException { if (scope == null) { throw new IllegalArgumentException("null scope"); } if (factory == null) { throw new IllegalArgumentException("null factory"); } return new ClassHierarchy(scope, factory, null, HashMapFactory.make(), ClassHierarchy.MissingSuperClassHandling.NONE); }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. TODO: nanny for testgen */ public static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, Language language, IProgressMonitor monitor) throws ClassHierarchyException { if (factory == null) { throw new IllegalArgumentException("null factory"); } return new ClassHierarchy(scope, factory, language, monitor, HashMapFactory.make(), ClassHierarchy.MissingSuperClassHandling.NONE); }
private static <T> Map<T, Integer> makeMap(NumberedGraph<T> G, int[] colors) { Map<T,Integer> colorMap = HashMapFactory.make(); for(int i = 0; i < colors.length; i++) { if (colors[i] != -1) { colorMap.put(G.getNode(i), colors[i]); } } return colorMap; }
/** * @throws NullPointerException if s is null */ public ParanoidHashSet(Collection<T> s) throws NullPointerException { super(s.size()); hcFreq = HashMapFactory.make(s.size()); this.addAll(s); }
public static Map<String,Object> collectConstants(CAstEntity function) { Map<String,Object> values = HashMapFactory.make(); collectConstants(function, values); return values; } }
/** * temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. */ public static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, IProgressMonitor monitor) throws ClassHierarchyException { return new ClassHierarchy(scope, factory, monitor, HashMapFactory.make(), ClassHierarchy.MissingSuperClassHandling.NONE); }
private void initPKeysForNode(CGNode node) { if (pKeys == null) { pKeys = HashMapFactory.make(); } if (!nodesHandled.contains(node)) { nodesHandled.add(node); pKeys.putAll(computePointerKeys(node)); } }
public static NodeDecorator<ISSABasicBlock> makeIRDecorator(IR ir) { if (ir == null) { throw new IllegalArgumentException("ir is null"); } final HashMap<ISSABasicBlock,String> labelMap = HashMapFactory.make(); for (ISSABasicBlock issaBasicBlock : ir.getControlFlowGraph()) { SSACFG.BasicBlock bb = (SSACFG.BasicBlock) issaBasicBlock; labelMap.put(bb, getNodeLabel(ir, bb)); } NodeDecorator<ISSABasicBlock> labels = labelMap::get; return labels; }
private void initAllPKeys() { if (pKeys == null) { pKeys = HashMapFactory.make(); } for (IClass klass : klasses) { pKeys.putAll(computePointerKeys(klass)); } for (CGNode node : cg) { initPKeysForNode(node); } }
public GenericDominators(Graph<T> G, T root) throws IllegalArgumentException { super(G, root); this.infoMap = HashMapFactory.make(G.getNumberOfNodes()); analyze(); }
public GenericDominators(Graph<T> G, T root) throws IllegalArgumentException { super(G, root); this.infoMap = HashMapFactory.make(G.getNumberOfNodes()); analyze(); }
public synchronized Map<String, T> row2Map(int row) { Map<String, T> result = HashMapFactory.make(); for (int j = 0; j < getNumberOfColumns(); j++) { result.put(getColumnHeading(j), getElement(row, j)); } return result; }
@Override public IR makeIR(Context C, SSAOptions options) { SSAInstruction[] instrs = getStatements(); Map<Integer, ConstantValue> constants = null; if (valueNumberForConstantOne > -1) { constants = HashMapFactory.make(1); constants.put(Integer.valueOf(valueNumberForConstantOne), new ConstantValue(Integer.valueOf(1))); } return new SyntheticIR(this, context, new InducedCFG(instrs, this, context), instrs, options, constants); } }
public static CrossLanguageClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException { Set<Language> languages = scope.getBaseLanguages(); Map<Atom, IClassHierarchy> hierarchies = HashMapFactory.make(); for (Language L : languages) { Set<Language> ll = HashSetFactory.make(L.getDerivedLanguages()); ll.add(L); hierarchies.put(L.getName(), ClassHierarchyFactory.make(scope, factory, ll)); } return new CrossLanguageClassHierarchy(scope, factory, hierarchies); }
public static CrossLanguageClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException { Set<Language> languages = scope.getBaseLanguages(); Map<Atom, IClassHierarchy> hierarchies = HashMapFactory.make(); for (Language L : languages) { Set<Language> ll = HashSetFactory.make(L.getDerivedLanguages()); ll.add(L); hierarchies.put(L.getName(), ClassHierarchyFactory.make(scope, factory, ll)); } return new CrossLanguageClassHierarchy(scope, factory, hierarchies); }