knownLiterals.put(null, new LiteralLabel(null, "java.lang.Object"));
}
public PointsToAliasContext createEntryValue(MethodDeclaration method) {
PointsToAliasContext entry = ops.bottom();
Variable thisVar = this.getAnalysisContext().getThisVariable();
if (thisVar != null) {
Set<ObjectLabel> thisAliases = retriever.getStartingAliases(thisVar);
if (thisAliases.isEmpty()) {
ObjectLabel fresh = new DefaultObjectLabel(thisVar.resolveType(), false);
entry.addPointsTo(getAnalysisContext().getSuperVariable(), fresh);
entry.addPointsTo(thisVar, fresh);
entry.addLabel(fresh);
}
else {
entry.addPointsTo(thisVar, thisAliases);
entry.addPointsTo(getAnalysisContext().getSuperVariable(), thisAliases);
}
}
entry.addLabel(voidLabel);
entry.addLabels(retriever.getAllLabels());
//first, create fresh variables for all the parameters
Iterator itr = method.parameters().iterator();
while (itr.hasNext()) {
SingleVariableDeclaration param = (SingleVariableDeclaration) itr.next();
Variable paramVar = getAnalysisContext().getSourceVariable(param.resolveBinding());
ObjectLabel fresh = new DefaultObjectLabel(param.getType().resolveBinding(), false);
entry.addPointsTo(paramVar, fresh);
entry.addLabel(fresh);
}
//once we have all starting variables, figure out who might point to who
itr = method.parameters().iterator();
while (itr.hasNext()) {
SingleVariableDeclaration param = (SingleVariableDeclaration) itr.next();
Variable paramVar = getAnalysisContext().getSourceVariable(param.resolveBinding());
entry.addPointsToAnySubtype(paramVar, param.getType().resolveBinding());
}
return entry;
}