CallGraph¶
-
public final class
CallGraph
¶ Top of internal representation, holding the call graph for a given program or library.
Fields¶
allGlobalsForExternals¶
backAssociations¶
globalCMaps¶
-
public TapList<TapList<ZoneInfoAccessElements>>
globalCMaps
¶ The “maps” built for C global vars that are visible across files (Translation Units).
globalFortranMaps¶
-
public MemoryMaps
globalFortranMaps
¶ The memory maps built for all COMMON, SAVE, and BIND(C) variables (Fortran-specific)
globalZonesNumber4¶
-
public int[]
globalZonesNumber4
¶ The number of global zones in this CallGraph (together with the 3 kind-specific numbers)
globalsForExternalsNumber4¶
-
public int[]
globalsForExternalsNumber4
¶ The number of global zones in allGlobalsForExternals (together with the 3 kind-specific numbers)
numberOfDummyRootZones¶
-
public int
numberOfDummyRootZones
¶ The number of dummy zones of the root SymbolTable, i.e. the destinations of NULL, Undef, the IO stream(s), and the MPI channels.
toSharingTypes¶
topPostCommentsBlock¶
topPreCommentsBlock¶
zoneNbOfAllIOStreams¶
-
public int
zoneNbOfAllIOStreams
¶ index of the special memory zone that represents all I-O files.
Methods¶
addAllocationPoint¶
-
protected void
addAllocationPoint
(Tree allocateTree, Tree recipientTree, TypeSpec allocatedType, SymbolTable symbolTable)¶
addBindFortranCFunction¶
-
public void
addBindFortranCFunction
(String unitFortranName, String unitCName, FunctionDecl funcDecl)¶
addCallArrow¶
-
public static CallArrow
addCallArrow
(Unit origin, int kind, Unit destination)¶ Adds a new CallArrow into the CallGraph, from “origin” to “destination”. If such an arrow already exists, no arrow is created. “kind” is the kind of arrow, belongs to {CALLS, IMPORTS, CONTAINS, -1}. If this arrow CALLS, the number of calls is incremented.
addIntrinsicUnit¶
addTranslationUnitSymbolTable¶
-
public void
addTranslationUnitSymbolTable
(SymbolTable symbolTable)¶
bindFortranCFunctions¶
-
public TapList<TapTriplet<String, String, FunctionDecl>>
bindFortranCFunctions
()¶ - Returns
the unordered list of all Fortran2003 Units with bind(c) in this CallGraph.
buildSortedUnitsList¶
-
public TapList<Unit>
buildSortedUnitsList
(int callsDir, int importsDir, int containsDir)¶ - Returns
a sorted list of all the units found in the “units” field of this CallGraph, following the sorting criteria defined by “callsDir”, “importsDir”, and “containsDir”. When a CallArrow from A to B says that “A xxxx’es B”, then: if xxxxsDir is 1 then A will be before B; if xxxxsDir is -1 then B will be before A; if xxxxsDir is 0, this doensn’t constrain A B order. When order is free, places the Units by increasing original “positions”. Beware of code duplication with sortUnits() !!
cPlusPlusRootSymbolTable¶
-
public SymbolTable
cPlusPlusRootSymbolTable
()¶
cRootSymbolTable¶
-
public SymbolTable
cRootSymbolTable
()¶
checkBindFortranCType¶
-
public boolean
checkBindFortranCType
(WrapperTypeSpec fortranTypeSpec, WrapperTypeSpec cTypeSpec)¶
createNewIntrinsicUnit¶
createNewUnit¶
cudaRootSymbolTable¶
-
public SymbolTable
cudaRootSymbolTable
()¶
deleteUnit¶
deleteUnitFromSymbolTable¶
detachFromUpperUnit¶
dump¶
-
public void
dump
(int indent)¶ Prints in detail the contents of this CallGraph, onto TapEnv.curOutputStream().
- Parameters
indent – the amount of indentation to be used for this printing.
dumpAllDataFlows¶
dumpAllFlowGraphs¶
dumpAllSymbolTables¶
dumpCompactCallGraph¶
fortranRootSymbolTable¶
-
public SymbolTable
fortranRootSymbolTable
()¶
getAllMessagePassingChannelZones¶
-
public TapIntList
getAllMessagePassingChannelZones
()¶ - Returns
the list of all the zones representing a message-passing channel.
getAllMessagePassingChannels¶
-
public TapList<TapPair<MPIcallInfo, TapIntList>>
getAllMessagePassingChannels
()¶ - Returns
the list of all Message-Passing channels.
getAnyIntrinsicUnit¶
getAnyNonVarUnit¶
-
public Unit
getAnyNonVarUnit
(String name, Unit inUnit)¶ - Returns
one Unit with name ‘name’ from the CallGraph, provided it is not a VarFunctionUnit. This method is dirty and should be used only for debugging, because it does not use the scoping mechanism and therefore several Unit’s can have the same name.
getAnyUnit¶
getCallArrow¶
-
public static CallArrow
getCallArrow
(Unit callerUnit, Unit calleeUnit)¶ - Returns
the CallArrow from “callerUnit” to “calleeUnit”. In the special case where “calleeUnit” is an intrinsic, there is no CallArrow coming from each routine that uses it. Therefore, we return a “generic” arrow with its origin set to “callerUnit”.
getCglobalMap¶
-
public TapList<ZoneInfoAccessElements>
getCglobalMap
(SymbolDecl sharedDecl)¶
getFileUnit¶
getMainUnit¶
getMixedLanguageFunctionName¶
-
public TapPair<String, FunctionDecl>
getMixedLanguageFunctionName
(String functionName, int callerLanguage, int calleeLanguage)¶ - Parameters
functionName – name of function in a call
callerLanguage – TapEnv.C, TapEnv.FORTRAN, …
calleeLanguage – TapEnv.C, TapEnv.FORTRAN, …
- Returns
the corresponding Unit.name, i.e.
if callerLanguage == TapEnv.C, the Fortran name FOO if callerLanguage == TapEnv.FORTRAN, the C name BAR or bind's result + FunctionDecl
getOtherBindType¶
-
public TypeDecl
getOtherBindType
(WrapperTypeSpec typeSpec)¶
getOtherLangFunctionDeclFromBindC¶
-
public TapTriplet<String, String, FunctionDecl>
getOtherLangFunctionDeclFromBindC
(String funcName, int calleeLang)¶
getOtherLanguageName¶
getPreviousFunctionDeclAndNewUnit¶
-
public TapTriplet<FunctionDecl, Unit, TapPair<FunctionDecl, SymbolTable>>
getPreviousFunctionDeclAndNewUnit
(String name)¶
getTranslationUnitSymbolTables¶
-
public TapList<SymbolTable>
getTranslationUnitSymbolTables
()¶
getUnit¶
getUnit¶
getUnit¶
-
public Unit
getUnit
(String name, FunctionTypeSpec functionTypeSpec)¶ - Returns
‘null’ if not found or if it finds an interface.
getUnits¶
-
public TapList<Unit>
getUnits
(TapList<String> unitNames)¶ Returns the list of all Units that match one name or one unit rank in “unitNames”. Returns null if unitNames is null or no Unit is found. If the given list “unitNames” starts with special String “%all%, then this returns a one-element list containing null, which must be understood as “all Units”.
globalRootSymbolTable¶
-
public SymbolTable
globalRootSymbolTable
()¶
interfaceUnits¶
intrinsicUnits¶
isAMessagePassingChannelZone¶
-
public boolean
isAMessagePassingChannelZone
(int zoneNb)¶ - Returns
true if “zoneNb” represents a message-passing channel.
languageRootSymbolTable¶
-
public SymbolTable
languageRootSymbolTable
(int language)¶
naturalBindFortranCType¶
-
public boolean
naturalBindFortranCType
(WrapperTypeSpec fType, WrapperTypeSpec cType)¶ Returns true if fType and cType are based on primitive types and naturally match, without any need for BIND declaration.
nbUnits¶
-
public int
nbUnits
()¶ - Returns
Number of Units present in this CallGraph Includes procedures, classes, externals, interfaces, but not intrinsics.
numberSymbolTables¶
-
public void
numberSymbolTables
()¶ Assigns a unique number to each SymbolTable. This number is used mostly to identify SymbolTable’s in debug and trace
orderedFiles¶
prepareAnalyses¶
replaceInAllocationPoints¶
setAllMessagePassingChannels¶
-
public void
setAllMessagePassingChannels
(TapList<TapPair<MPIcallInfo, TapIntList>> allChannels)¶ Sets the list of all Message-Passing channels.
setBindCFortranCFunctions¶
-
public void
setBindCFortranCFunctions
(TapList<TapTriplet<String, String, FunctionDecl>> origBindC)¶
setBindFortranCType¶
setCPlusPlusRootSymbolTable¶
-
public void
setCPlusPlusRootSymbolTable
(SymbolTable cPlusPlusRootSymbolTable)¶
setCRootSymbolTable¶
-
public void
setCRootSymbolTable
(SymbolTable cRootSymbolTable)¶
setCudaRootSymbolTable¶
-
public void
setCudaRootSymbolTable
(SymbolTable cudaRootSymbolTable)¶
setFortranRootSymbolTable¶
-
public void
setFortranRootSymbolTable
(SymbolTable fortranRootSymbolTable)¶
setGlobalRootSymbolTable¶
-
public void
setGlobalRootSymbolTable
(SymbolTable globalRootSymbolTable)¶
setInputStream¶
-
public void
setInputStream
(TreeProtocol stream)¶ Sets the inputStream to “stream”.
setInterfaceUnits¶
setPreviousFunctionDeclAndNewUnit¶
-
public void
setPreviousFunctionDeclAndNewUnit
(FunctionDecl oldFunctionDecl, Unit newUnit)¶
sortUnits¶
-
public void
sortUnits
(boolean keepAllUnits, int callsDir, int importsDir, int containsDir)¶ Sorts into field “sortedUnits” all Unit’s of this CallGraph, following the sorting criteria defined by “callsDir”, “importsDir”, and “containsDir”. When a CallArrow from A to B says that “A xxxx’es B”, then: if xxxxsDir is 1 then A will be before B; if xxxxsDir is -1 then B will be before A; if xxxxsDir is 0, this doesn’t constrain A B order. When order is free, places the Units by increasing original “positions”. Re-assigns the ranks of the Units according to this order.
sortedComputationalUnits¶
sortedUnit¶
sortedUnits¶
terminateTypesAndZones¶
-
public void
terminateTypesAndZones
()¶ Final preparation of the CallGraph. Prepare the types. Set all the remaining CallArrows. Prepare the zones, zone numbering, zone translations. Must be done after all parsing and before all analyses.
topUnits¶
units¶
zoneRksOfChannelOrIO¶
-
public TapIntList
zoneRksOfChannelOrIO
()¶
zoneRksOfIO¶
-
public TapIntList
zoneRksOfIO
()¶