|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.common.Root
scale.callGraph.Suite
public class Suite
This class is meant to facilitate separate compilations by being a repository for multiple CallGraph instances.
$Id: Suite.java,v 1.66 2007-10-04 19:53:35 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
In Scale, each source file is converted to a Clef abstract syntax
tree (AST). The ASTs are processed into call graphs. This class is a holder for
multiple call graphs and has
methods that perform similar to the methods on a single call graph. In addition, this class
maintains a mapping from a name to a set of top level declarations and from these
declarations to the call graphs
in which they are defined.
CallGraph| Field Summary | |
|---|---|
static boolean |
classTrace
True if traces are to be performed. |
| Constructor Summary | |
|---|---|
Suite(boolean noStaticDecls)
Create a holder for related call
graphs that acts like a single call graph. |
|
| Method Summary | |
|---|---|
void |
addCallGraph(CallGraph cg)
Add a call graph to the Suite. |
void |
addProfiling(Vector<java.lang.String> moduleNames,
int profileOptions)
Add the profiling instrumentation to every call graph in the suite. |
java.util.Iterator<RoutineDecl> |
allDefRoutines()
Return an enumeration of all the routines with bodies. |
java.util.Iterator<RoutineDecl> |
allExternRoutines()
Return an enumeration of all the external routines. |
java.util.Iterator<RoutineDecl> |
allRoutines()
Return an enumeration of all the routines. |
java.util.Enumeration<Declaration> |
externDecls(Declaration d)
Return an enumeration of the external (referencing) declarations for
a given defining declaration. |
CallGraph |
getCallGraph(Declaration decl)
Return the CallGraph in which the declaration is defined. |
java.util.Enumeration<CallGraph> |
getCallGraphs()
Return an enumeration of all the call graphs. |
RoutineDecl |
getMain()
Return the main routine if
any. |
java.util.Enumeration<java.lang.String> |
getNames()
Return an enumeration of all the call graph names. |
java.util.Enumeration<Declaration> |
otherDecls(Declaration decl)
Return all the other top level declarations with the same name
(including routine declarations). |
java.util.Enumeration<Declaration> |
otherDecls(java.lang.String name)
Return all the other top level declarations with the same name
(including routine
declarations) |
void |
printAllRoutines()
Print to out the routines
in this call graph. |
void |
printXRef()
Print a listing of all symbols and the call graphs in which they are
referenced. |
void |
readProfInfo(Vector<java.lang.String> profilePaths,
int profileOptions)
Read in profiling informationforo every call graph in the suite. |
java.util.Iterator<Declaration> |
topLevelDecls()
Return an enumeration of all the top level declarations except routines. |
java.util.Iterator<Declaration> |
topLevelDefDecls()
Return an enumeration of all the top level defining declarations. |
java.util.Iterator<Declaration> |
topLevelExternDecls()
Return an enumeration of all the top level external declarations. |
| Methods inherited from class scale.common.Root |
|---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayColorHint, getDisplayLabel, getDisplayName, getDisplayShapeHint, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toString, toStringAnnotations, toStringClass, toStringSpecial, trace, trace, trace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean classTrace
| Constructor Detail |
|---|
public Suite(boolean noStaticDecls)
call
graphs that acts like a single call graph.
noStaticDecls - is true if static functions and variable
should be made global for inliningCallGraph| Method Detail |
|---|
public java.util.Enumeration<CallGraph> getCallGraphs()
call graphs.
public java.util.Enumeration<java.lang.String> getNames()
call graph names.
public void addProfiling(Vector<java.lang.String> moduleNames,
int profileOptions)
call graph in the suite.
moduleNames - is the list of all source modules in the program
and must include the module containing "main"profileOptions - specifies which profiling instrumentation to insert
public void readProfInfo(Vector<java.lang.String> profilePaths,
int profileOptions)
call graph in the suite.
profilePaths - is the list of directories to search for
profile information and must include the module containing "main"profileOptions - specifies which profiling instrumentation to insertpublic void addCallGraph(CallGraph cg)
call graph to the Suite.
cg - is the call graphCallGraphpublic java.util.Enumeration<Declaration> otherDecls(java.lang.String name)
declarations with the same name
(including routine
declarations)
name - is the name of a Declarationpublic java.util.Enumeration<Declaration> otherDecls(Declaration decl)
declarations with the same name
(including routine declarations).
decl - is a Declarationpublic CallGraph getCallGraph(Declaration decl)
declaration is defined.
decl - is a Declaration (may be routine declaration)public void printXRef()
call graphs in which they are
referenced.
public void printAllRoutines()
routines
in this call graph.
public RoutineDecl getMain()
routine if
any.
public java.util.Iterator<RoutineDecl> allRoutines()
routines.
public java.util.Iterator<Declaration> topLevelDecls()
declarations except routines.
public java.util.Iterator<RoutineDecl> allDefRoutines()
routines with bodies. That is, the
routines that aren't defined external.
public java.util.Iterator<Declaration> topLevelDefDecls()
declarations. We don't return
routines or declarations declared with the extern
keyword (a referencing declaration).
public java.util.Iterator<RoutineDecl> allExternRoutines()
routines.
public java.util.Iterator<Declaration> topLevelExternDecls()
declarations.
We don't return routines.
public java.util.Enumeration<Declaration> externDecls(Declaration d)
declarations for
a given defining declaration.
d - the defining declaration.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||