harpoon.Analysis
Class ReachingDefsImpl<HCE extends HCodeElement>

java.lang.Object
  extended by harpoon.Analysis.ReachingDefs<HCE>
      extended by harpoon.Analysis.ReachingDefsImpl<HCE>

public class ReachingDefsImpl<HCE extends HCodeElement>
extends ReachingDefs<HCE>

ReachingDefsImpl defines an implementation for analyzing reaching definitions. Since results are cached, a new ReachingDefsImpl should be created if the code has been modified.

Version:
$Id: ReachingDefsImpl.java,v 1.6 2004/02/08 03:19:12 cananian Exp $
Author:
Karen K. Zee <kkz@alum.mit.edu>

Field Summary
protected  BasicBlock.Factory<HCE> bbf
           
protected  Map<BasicBlock<HCE>,Map<Temp,List<Set<HCE>>>> cache
           
protected  boolean check_typecast
           
protected  Map<Temp,BitSetFactory<HCE>> Temp_to_BitSetFactories
           
protected  UseDefer<HCE> ud
           
 
Fields inherited from class harpoon.Analysis.ReachingDefs
hc, TIME
 
Constructor Summary
ReachingDefsImpl(HCode<HCE> hc)
          Creates a ReachingDefsImpl object for the provided HCode using CFGrapher.DEFAULT.
ReachingDefsImpl(HCode<HCE> hc, CFGrapher<HCE> cfger)
          Creates a ReachingDefsImpl object for the provided HCode for an IR implementing UseDefable using the provided CFGrapher.
ReachingDefsImpl(HCode<HCE> hc, CFGrapher<HCE> cfger, UseDefer<HCE> ud)
          Creates a ReachingDefsImpl object for the provided HCode using the provided CFGrapher and UseDefer.
 
Method Summary
 Set<HCE> reachingDefs(HCE hce, Temp t)
          Returns the Set of HCodeElements providing definitions of Temp t which reach HCodeElement hce.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bbf

protected final BasicBlock.Factory<HCE extends HCodeElement> bbf

Temp_to_BitSetFactories

protected final Map<Temp,BitSetFactory<HCE extends HCodeElement>> Temp_to_BitSetFactories

cache

protected final Map<BasicBlock<HCE extends HCodeElement>,Map<Temp,List<Set<HCE extends HCodeElement>>>> cache

check_typecast

protected final boolean check_typecast

ud

protected final UseDefer<HCE extends HCodeElement> ud
Constructor Detail

ReachingDefsImpl

public ReachingDefsImpl(HCode<HCE> hc,
                        CFGrapher<HCE> cfger)
Creates a ReachingDefsImpl object for the provided HCode for an IR implementing UseDefable using the provided CFGrapher. This may take a while since the analysis is done at this time.


ReachingDefsImpl

public ReachingDefsImpl(HCode<HCE> hc,
                        CFGrapher<HCE> cfger,
                        UseDefer<HCE> ud)
Creates a ReachingDefsImpl object for the provided HCode using the provided CFGrapher and UseDefer. This may take a while since the analysis is done at this time.


ReachingDefsImpl

public ReachingDefsImpl(HCode<HCE> hc)
Creates a ReachingDefsImpl object for the provided HCode using CFGrapher.DEFAULT. This may take a while since the analysis is done at this time.

Method Detail

reachingDefs

public Set<HCE> reachingDefs(HCE hce,
                             Temp t)
Returns the Set of HCodeElements providing definitions of Temp t which reach HCodeElement hce. Returns the empty Set if the given HCodeElement is unreachable.

Specified by:
reachingDefs in class ReachingDefs<HCE extends HCodeElement>