harpoon.Analysis
Class UseDefChecker

java.lang.Object
  extended by harpoon.Analysis.UseDefChecker
All Implemented Interfaces:
HCodeFactory

public class UseDefChecker
extends Object
implements HCodeFactory

UseDefChecker verifies that all variables are defined before they are used. It aids in debugging code transformations.

Version:
$Id: UseDefChecker.java,v 1.3 2004/02/08 03:19:12 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Nested Class Summary
static class UseDefChecker.ReachingDefsFactory
          The UseDefChecker constructor takes a ReachingDefsFactory argument to specify which ReachingDefs implementation it should use.
 
Constructor Summary
UseDefChecker(HCodeFactory parent, String reachingdefsClassName)
          Creates a UseDefChecker using the named class as the ReachingDefs implementation.
UseDefChecker(HCodeFactory parent, UseDefChecker.ReachingDefsFactory rdf)
          Creates a UseDefChecker from a ReachingDefsFactory.
 
Method Summary
 void clear(HMethod m)
          Removes representation of method m from all caches in this factory and its parents.
 HCode convert(HMethod m)
          Make an HCode from an HMethod.
 String getCodeName()
          Returns a string naming the type of the HCode that this factory produces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UseDefChecker

public UseDefChecker(HCodeFactory parent,
                     UseDefChecker.ReachingDefsFactory rdf)
Creates a UseDefChecker from a ReachingDefsFactory.


UseDefChecker

public UseDefChecker(HCodeFactory parent,
                     String reachingdefsClassName)
Creates a UseDefChecker using the named class as the ReachingDefs implementation.

Method Detail

getCodeName

public String getCodeName()
Description copied from interface: HCodeFactory
Returns a string naming the type of the HCode that this factory produces.

this.getCodeName() should equal this.convert(m).getName() for every HMethod m.

Specified by:
getCodeName in interface HCodeFactory

clear

public void clear(HMethod m)
Description copied from interface: HCodeFactory
Removes representation of method m from all caches in this factory and its parents.

Specified by:
clear in interface HCodeFactory

convert

public HCode convert(HMethod m)
Description copied from interface: HCodeFactory
Make an HCode from an HMethod.

convert is allowed to return null if the requested conversion is impossible; typically this is because it's attempt to convert a source representation failed -- for example, because m is a native method.

Specified by:
convert in interface HCodeFactory