bug fixes and cleanup of TypeBasedPointerAnalysis

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1959 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-10-26 14:53:39 +00:00
parent 9915d91b5f
commit 098ab6e07d
3 changed files with 9 additions and 6 deletions

View File

@ -471,6 +471,6 @@ public abstract class AbstractRTABuilder extends PropagationCallGraphBuilder {
*/
@Override
public PointerAnalysis getPointerAnalysis() {
return new TypeBasedPointerAnalysis(getOptions(), allocatedClasses, getCallGraph());
return TypeBasedPointerAnalysis.make(getOptions(), allocatedClasses, getCallGraph());
}
}

View File

@ -195,13 +195,11 @@ public class TypeBasedHeapModel implements HeapModel {
}
public InstanceKey getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation) throws UnimplementedError {
Assertions.UNREACHABLE();
return null;
return iKeyFactory.getInstanceKeyForAllocation(node, allocation);
}
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) throws UnimplementedError {
Assertions.UNREACHABLE();
return null;
return iKeyFactory.getInstanceKeyForMultiNewArray(node, allocation, dim);
}
public InstanceKey getInstanceKeyForConstant(TypeReference type, Object S) {

View File

@ -59,7 +59,7 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
* Collection<IClass>
* @throws AssertionError if klasses is null
*/
public TypeBasedPointerAnalysis(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg) throws AssertionError {
private TypeBasedPointerAnalysis(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg) throws AssertionError {
super(cg, makeInstanceKeys(klasses));
this.klasses = klasses;
heapModel = new TypeBasedHeapModel(options, klasses, cg);
@ -81,6 +81,11 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
return result;
}
public static TypeBasedPointerAnalysis make(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg)
throws AssertionError {
return new TypeBasedPointerAnalysis(options, klasses, cg);
}
public OrdinalSet<InstanceKey> getPointsToSet(PointerKey key) throws IllegalArgumentException {
if (key == null) {
throw new IllegalArgumentException("key == null");