View Javadoc

1   // PointerAnalysisResults.java, created Mon Sep 22 17:38:25 2003 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Compiler.Analysis.IPA;
5   
6   import java.util.Set;
7   import joeq.Class.jq_Method;
8   import joeq.Compiler.Analysis.IPA.ProgramLocation.QuadProgramLocation;
9   import joeq.Compiler.Analysis.IPSSA.ContextSet;
10  import joeq.Compiler.Analysis.IPSSA.SSALocation;
11  import joeq.Compiler.Quad.BasicBlock;
12  import joeq.Compiler.Quad.CallGraph;
13  
14  /***
15   * This interface summarizes all the relevant results of the 
16   * external pointer analysis in one convenient place.
17   * 
18   * @author Vladimir Livshits
19   * @author John Whaley
20   * @version $Id: PointerAnalysisResults.java 1931 2004-09-22 22:17:47Z joewhaley $
21   */
22  public interface PointerAnalysisResults {
23      
24      /*
25       * This interface summarizes all the relevant results of the 
26       * external pointer analysis in one convenient place.
27       * 
28       * The following things are necessary:
29       */
30       
31      //-------------- 1. Transitive MOD and REF sets for each call       --------------//
32      
33      /*** Returns the set of potentially-modified locations of the
34       * given call (and transitively any calls the target may make).  Each
35       * location is represented by an SSALocation.
36       * 
37       * a.f = b;  everything that 'a.f' can point to
38       * 
39       * loc must be in the basic block
40       */
41      Set/*<SSALocation>*/ mod(QuadProgramLocation loc, BasicBlock bb);
42      
43      /***
44       *  Returns the set of potentially-referenced locations of the
45       * given call (and transitively any calls the target may make).  Each
46       * location is represented by an SSALocation.
47       * 
48       * a = b.f;  everything that 'b.f' can point to
49       * 
50       * loc must be in the basic block
51       */
52      Set/*<SSALocation>*/ ref(QuadProgramLocation loc, BasicBlock block);
53      
54      
55      //-------------- 2. Aliasing of parameters                          --------------//
56      
57      /***
58       * Returns a set of location/contextset pairs of locations that may be
59       * aliased with the given location, along with the set of contexts under
60       * which each alias can occur.
61       */
62      Set/*<ContextSet.ContextLocationPair>*/ getAliases(jq_Method method, SSALocation loc);
63      
64      /***
65       * Returns whether the given location may have aliases in the given set of
66       * contexts.
67       */
68      boolean hasAliases(jq_Method method, SSALocation loc, ContextSet contextSet);
69      
70      /***
71       * Returns whether the given location may have aliases in any context.
72       */
73      boolean hasAliases(jq_Method method, SSALocation loc);
74      
75      PA getPAResults();
76  
77      Set/*jq_Method*/ getCallTargets(QuadProgramLocation loc);
78  
79      CallGraph getCallGraph();
80  }