.. java:import:: fr.inria.tapenade.analysis ADActivityAnalyzer .. java:import:: fr.inria.tapenade.analysis ActivityPattern .. java:import:: fr.inria.tapenade.analysis ReqExplicit .. java:import:: fr.inria.tapenade.utils ILLang .. java:import:: fr.inria.tapenade.utils ILLangOps .. java:import:: fr.inria.tapenade.utils Operator .. java:import:: fr.inria.tapenade.utils TapIntList .. java:import:: fr.inria.tapenade.utils TapPair .. java:import:: fr.inria.tapenade.utils ToBool .. java:import:: fr.inria.tapenade.utils ToInt .. java:import:: fr.inria.tapenade.utils TopDownTreeWalk .. java:import:: fr.inria.tapenade.utils Tree .. java:import:: fr.inria.tapenade.differentiation ExpressionDifferentiator .. java:import:: java.util Enumeration ILUtils ======= .. java:package:: fr.inria.tapenade.representation :noindex: .. java:type:: public final class ILUtils IL Trees basic utility methods. Methods ------- acceptsMultiDirDimension ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean acceptsMultiDirDimension(Tree typeTree) :outertype: ILUtils Same as TypeSpec.acceptMultiDirDimension(), but on the Tree that designates the type. addAddressOf ^^^^^^^^^^^^ .. java:method:: public static Tree addAddressOf(Tree tree) :outertype: ILUtils Places an op_address around "tree", which must be a reference expression. Simplifies op_address(op_pointerAccess(tree, null)). addAddressOfAtBase ^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree addAddressOfAtBase(Tree tree) :outertype: ILUtils Inserts an op_address around the base op_ident of "tree", which must be a reference expression. addExpressionsNumConstants ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree addExpressionsNumConstants(Tree left, Tree right) :outertype: ILUtils :return: the constant Tree sum of the two given constant Trees. addListTreeInList ^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList addListTreeInList(TapList listTree, TapList list) :outertype: ILUtils addNumericalStrings ^^^^^^^^^^^^^^^^^^^ .. java:method:: protected static String addNumericalStrings(String str1, boolean isStr1Opposed, String str2, boolean isStr2Opposed) :outertype: ILUtils addPointerAccess ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree addPointerAccess(Tree tree) :outertype: ILUtils Places an op_pointerAccess around "tree", which must be a pointer expression. Simplifies op_pointerAccess(op_address(tree), null). addPointerAccessAtBase ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree addPointerAccessAtBase(Tree tree) :outertype: ILUtils Inserts an op_pointerAccess around the base op_ident of "tree", which must be a reference expression. addProtectedExprs ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree addProtectedExprs(Tree factor1, Tree factor2) :outertype: ILUtils Adds two factors, taking care of the case where any of them is protected (i.e. an ifExpression). A few examples: .. parsed-literal:: Exp1 + Exp2 → Exp1+Exp2 Exp1 + (T2?():Exp2) → (T2?Exp1:Exp1+Exp2) Exp1 + (T2?SExp2:Exp2) → (T2?Exp1+SExp2:Exp1+Exp2) addSchedule ^^^^^^^^^^^ .. java:method:: public static void addSchedule(Tree schedule, Tree ompPragma) :outertype: ILUtils Adds the given "schedule" clause to the (head of the) clauses of the given "ompPragma". addTree ^^^^^^^ .. java:method:: public static Tree addTree(Tree tree1, Tree tree2) :outertype: ILUtils addTreeInList ^^^^^^^^^^^^^ .. java:method:: public static TapList addTreeInList(Tree tree, TapList list) :outertype: ILUtils addVarIntoFuturePrivates ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void addVarIntoFuturePrivates(NewSymbolHolder privateNSH, Tree pragma, boolean inFwd, boolean diff) :outertype: ILUtils Assumes pragma is an OpenMP pragma. Adds privateNSH into the list of variables that must be added as "private". :param privateNSH: the symbol holder of the future variable to declare private. :param pragma: the OpenMP pragma source tree. :param inFwd: when true, the private clause goes to the fwd differentiated pragma :param diff: when true, the private clause will be about the variable's derivative addVarIntoFutureShareds ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void addVarIntoFutureShareds(NewSymbolHolder sharedNSH, Tree pragma, boolean inFwd, boolean diff) :outertype: ILUtils Same as addVarIntoFuturePrivates, but will create "omp shared" clauses addVarIntoFutureSumReductions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void addVarIntoFutureSumReductions(NewSymbolHolder sumReductionNSH, Tree pragma) :outertype: ILUtils Same as addVarIntoFuturePrivates, but will cause a REDUCTION(+:...) adoptOrAppendComments ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void adoptOrAppendComments(Tree commentsTree, String commentsString, Tree commentedTree) :outertype: ILUtils appendComments ^^^^^^^^^^^^^^ .. java:method:: public static Tree appendComments(Tree comments1, Tree comments2) :outertype: ILUtils appendComments ^^^^^^^^^^^^^^ .. java:method:: public static Tree appendComments(Tree oldComments, TapList newComments, int operatorCode) :outertype: ILUtils appendCommentsBlock ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void appendCommentsBlock(Tree comments1, Tree comments2) :outertype: ILUtils arrayTripletsInside ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList arrayTripletsInside(Tree tree) :outertype: ILUtils arrayTypeToArrayDeclarator ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree arrayTypeToArrayDeclarator(Tree tree) :outertype: ILUtils Transforms a varDeclaration with arrayType into a varDeclaration with declarators with arrayDeclarator (fortran77 style). :return: the modified varDeclaration. assignedLabel ^^^^^^^^^^^^^ .. java:method:: public static String assignedLabel(Tree tree) :outertype: ILUtils :return: the label value assigned to the label var if "tree" is a "assignLabelVar" Tree. assignedLabelVar ^^^^^^^^^^^^^^^^ .. java:method:: public static String assignedLabelVar(Tree tree) :outertype: ILUtils :return: the String of the label variable that is being assigned if "tree" is a "assignLabelVar" Tree. assignedName ^^^^^^^^^^^^ .. java:method:: public static String assignedName(Tree tree) :outertype: ILUtils :return: the name of the variable that is being written if "tree" is an ILLang.op_assign Tree. baseName ^^^^^^^^ .. java:method:: public static String baseName(Tree tree) :outertype: ILUtils If "tree" is an expression ultimately referencing a variable name. :return: this name. baseTree ^^^^^^^^ .. java:method:: public static Tree baseTree(Tree tree) :outertype: ILUtils :return: the op_ident Tree which is the root of expression "tree". baseTypeTree ^^^^^^^^^^^^ .. java:method:: public static Tree baseTypeTree(Tree tree) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, int value) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, String value) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3, Tree son4) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3, Tree son4, Tree son5) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3, Tree son4, Tree son5, Tree son6) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3, Tree son4, Tree son5, Tree son6, Tree son7) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree son1, Tree son2, Tree son3, Tree son4, Tree son5, Tree son6, Tree son7, Tree son8) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, TapList trees) :outertype: ILUtils build ^^^^^ .. java:method:: public static Tree build(int opRank, Tree[] trees) :outertype: ILUtils buildArrayDeclarator ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildArrayDeclarator(int language, Tree declTree, Tree typeTree) :outertype: ILUtils buildArrayTripletAccess ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildArrayTripletAccess(Tree array, Tree from, Tree to, int startIndex) :outertype: ILUtils :return: in general a new Tree array[from:to], *except* when array is itself an array section, in which case returns a copy of array, modified/combined with from:to at the right place. buildCLoc ^^^^^^^^^ .. java:method:: public static Tree buildCLoc(Tree expr, String cLoc) :outertype: ILUtils buildCall ^^^^^^^^^ .. java:method:: public static Tree buildCall(Tree object, Tree funcName, Tree arguments) :outertype: ILUtils buildCall ^^^^^^^^^ .. java:method:: public static Tree buildCall(Tree funcName, Tree arguments) :outertype: ILUtils buildDimColon ^^^^^^^^^^^^^ .. java:method:: public static Tree buildDimColon(int minIndex, Tree dimSize) :outertype: ILUtils :return: a dimColon given its size and index of first element. buildExpressionOpposite ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildExpressionOpposite(Tree tree) :outertype: ILUtils :return: the Tree opposite of a numerical expression. buildInitAssign ^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildInitAssign(Tree doTree) :outertype: ILUtils Given do header, build assignment. :param doTree: do header \ ``i=a,b,c"``\ :return: assignment statement \ ``i:=a"``\ . buildIterativeLength ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static int buildIterativeLength(Tree tree, SymbolTable symbolTable) :outertype: ILUtils :return: the number of successive individual atomic values in the list of expressions "tree". If this length cannot be statically determined, return -1. buildListIdents ^^^^^^^^^^^^^^^ .. java:method:: public static TapList buildListIdents(TapList identNames) :outertype: ILUtils :return: a list of op_ident Tree's, with the given identNames, and keeping the order. buildNameInIdent ^^^^^^^^^^^^^^^^ .. java:method:: public static String buildNameInIdent(Tree tree) :outertype: ILUtils :return: a string that can be used in an identifier to represent the given reference Tree. buildNameInText ^^^^^^^^^^^^^^^ .. java:method:: public static String buildNameInText(Tree tree) :outertype: ILUtils :return: a printable string to represent the given reference Tree. buildNumericalOpposite ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildNumericalOpposite(Tree tree) :outertype: ILUtils :return: the Tree opposite of a numerical expression if it is easy, e.g. in particular when isNegativeExpression(tree) is true, null otherwise. buildSingleStatement ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildSingleStatement(TapList statements) :outertype: ILUtils When possible, turns the given ordered list of statements into a single statement. Reciprocal of getListOfStatements(). Should be refined if necessary. buildSizeArgument1 ^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildSizeArgument1(Tree tree, SymbolTable symbolTable) :outertype: ILUtils used in size(...). buildSizeTree ^^^^^^^^^^^^^ .. java:method:: public static Tree buildSizeTree(Tree from, Tree to, Tree stride) :outertype: ILUtils :return: an expression Tree that evaluates to the size of this dimension (i.e. (to - from + stride)/stride or equivalently (to - from)/stride + 1 ). buildSmartAddSub ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildSmartAddSub(Tree leftTree, int factor, Tree rightTree) :outertype: ILUtils :return: a Tree that adds or substracts the two operands, with simplifications. buildSmartMulDiv ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree buildSmartMulDiv(Tree leftTree, int power, Tree rightTree) :outertype: ILUtils :return: a Tree that multiplies (power==1) or divides (power==-1) the two operands, with simplifications. buildStringCst ^^^^^^^^^^^^^^ .. java:method:: public static Tree buildStringCst(String str, boolean fromFortran) :outertype: ILUtils buildTypeName ^^^^^^^^^^^^^ .. java:method:: public static String buildTypeName(Tree tree) :outertype: ILUtils checkFunctionName ^^^^^^^^^^^^^^^^^ .. java:method:: public static void checkFunctionName(FunctionDecl functionDecl, SymbolTable symbolTable) :outertype: ILUtils cleanBoolCopy ^^^^^^^^^^^^^ .. java:method:: public static Tree cleanBoolCopy(Tree boolTree, Unit diffUnit) :outertype: ILUtils collectCommentStrings ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList collectCommentStrings(Tree commentsTree) :outertype: ILUtils Because all the "appendComment*" methods are erratic on the tree nesting..., this method does a final flattening to make comments canonic. collectCommentStrings ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList collectCommentStrings(TapList commentsTrees) :outertype: ILUtils collectIndexes ^^^^^^^^^^^^^^ .. java:method:: public static TapList collectIndexes(Tree tree, TapList indexes) :outertype: ILUtils commentsToListReversed ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList commentsToListReversed(Tree commentsTree) :outertype: ILUtils concatWithNull ^^^^^^^^^^^^^^ .. java:method:: public static Tree concatWithNull(Tree strTree) :outertype: ILUtils contains ^^^^^^^^ .. java:method:: public static Tree contains(Tree tree, int operator, String value) :outertype: ILUtils contains ^^^^^^^^ .. java:method:: public static boolean contains(Tree listTree, String value, boolean caseSensitive) :outertype: ILUtils :param listTree: is a list-arity Tree of atomic subtrees. :param caseSensitive: when true, the string equality is case sensitive. containsArrayDeclarator ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean containsArrayDeclarator(SymbolDecl varDecl, Tree tree) :outertype: ILUtils containsFunctionDeclarator ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean containsFunctionDeclarator(Tree trees, String value) :outertype: ILUtils :param trees: is a tree-list of functionDeclarator subtrees. containsModifier ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean containsModifier(String value, Tree tree, boolean stopOnPointer) :outertype: ILUtils Look if a modifier named "value" appears in this declaration Tree. :param value: The searched modifier. Belongs to {in, out, inout, constant, const, optional} :return: true if the modifier is found. containsUnknownDimension ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean containsUnknownDimension(Tree expr) :outertype: ILUtils :return: true if expression "expr" refers to an array without specifying its dimension. This means we don't have enough information to e.g. traverse it or initialize it etc... copiedSonsList ^^^^^^^^^^^^^^ .. java:method:: public static TapList copiedSonsList(Tree tree) :outertype: ILUtils copy ^^^^ .. java:method:: public static Tree copy(Tree tree) :outertype: ILUtils :return: a copy of the given "tree". The original Tree and the copied Tree share their set of annotations. Each subtree annotated with a "NewSymbolHolder", (i.e. the subtree might change later) is copied into a new subtree with the same "NewSymbolHolder", and registered by this "NewSymbolHolder". This way, when the "NewSymbolHolder" eventually decides on the final form of the subtree, the copied subtree will receive the final form too. copyWatchingEqualsSubtrees ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree copyWatchingEqualsSubtrees(Tree origTree, TapList> subTreeCopies) :outertype: ILUtils Same as copyWatchingSubtrees, but tree equality tests are made with ".equals". :return: the copied tree. copyWatchingSubtrees ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapPair>> copyWatchingSubtrees(Tree origTree, TapList> subTreeCopies) :outertype: ILUtils Builds a recursive copy of origTree, observing separately copied sub-trees given by "subTreeCopies". The TapList "subTreeCopies" is a key-list of TapPair's (Tree . Tree). For each sub-tree of origTree that appears as a key in subTreeCopies, this sub-tree is not copied, and instead the corresponding "value" tree is inserted into the copied tree. In the special case where the "value" Tree is null, a copy of the key-tree is inserted into the copied tree. This function builds also a new key-list, where the keys are the copies of the original key Trees. These copies are those who appear in the copied Tree. The values in this new key-list are null. :return: the TapPair of the copied Tree and the new key-list. declaresVariable ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean declaresVariable(Tree tree, String varName) :outertype: ILUtils :return: true if given "tree" is a varDeclaration that declares variable "varName" disjointPath ^^^^^^^^^^^^ .. java:method:: public static boolean disjointPath(Tree exp1, Tree exp2) :outertype: ILUtils Suppose that expressions exp1 and exp2 start from the same root variable. :return: true if the access path of exp1 and the access path of exp2 certainly lead to different memory locations. divProtectedExprs ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree divProtectedExprs(Tree factor1, Tree factor2) :outertype: ILUtils Same as mulProtectedExprs, but makes a division. dump ^^^^ .. java:method:: public static void dump(Tree tree, int indent) throws java.io.IOException :outertype: ILUtils Prints in detail the contents of the given IL tree, onto TapEnv.curOutputStream(). This printing may go on several lines, with indentation. This printing calls toStringRec() for single-line pieces of the tree. :param indent: the amount of indentation to be used for this printing. eqOrDisjointRef ^^^^^^^^^^^^^^^ .. java:method:: public static int eqOrDisjointRef(Tree tree1, Tree tree2, Instruction instr1, Instruction instr2) :outertype: ILUtils :return: DIFFERENT = -1 if the two trees certainly always refer to different memory cells, SAME = 1 if the two trees certainly always refer to the same memory cell, DOUBT = 0 otherwise, i.e. in case of doubt. equalValues ^^^^^^^^^^^ .. java:method:: public static boolean equalValues(Tree tree1, Tree tree2, Instruction instr1, Instruction instr2) :outertype: ILUtils equalsInclude ^^^^^^^^^^^^^ .. java:method:: public static boolean equalsInclude(String include, Tree tree) :outertype: ILUtils evalsToGEZero ^^^^^^^^^^^^^ .. java:method:: public static boolean evalsToGEZero(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to a value strictly positive. evalsToGTZero ^^^^^^^^^^^^^ .. java:method:: public static boolean evalsToGTZero(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to a value strictly positive. evalsToLTZero ^^^^^^^^^^^^^ .. java:method:: public static boolean evalsToLTZero(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to a value strictly negative. evalsToMinusOne ^^^^^^^^^^^^^^^ .. java:method:: public static boolean evalsToMinusOne(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to -1. evalsToOne ^^^^^^^^^^ .. java:method:: public static boolean evalsToOne(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to 1. evalsToZero ^^^^^^^^^^^ .. java:method:: public static boolean evalsToZero(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression with no variables, that evaluates (statically) to 0. ATTENTION CONVENTION: null Tree evaluates to zero !. extractPrivateTrees ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList extractPrivateTrees(Tree pragma, SymbolTable usageST, boolean inFwd, boolean diff) :outertype: ILUtils Assumes pragma is an OpenMP pragma. :param pragma: the OpenMP pragma source tree. :param usageST: the scope of the place where the pragma is. :param inFwd: when true, returns the trees for the fwd differentiated pragma :param diff: when true, returns the trees that are meant to be differentiated :return: the list of Tree's coming from the variables stored for private declaration. The stored list of variables stored to be private is then cleared. Since this list has been accumulated with the latest first, we can reverse it again upon rebuild. extractSharedTrees ^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList extractSharedTrees(Tree pragma, SymbolTable usageST, boolean inFwd, boolean diff) :outertype: ILUtils Same as extractPrivateTrees, but extracts the future SHARED variables extractSumReductionTrees ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList extractSumReductionTrees(Tree pragma, SymbolTable usageST) :outertype: ILUtils Same as extractPrivateTrees, but extracts the future REDUCTION(+:...) diff variables findArrayTriplet ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree findArrayTriplet(Tree expr) :outertype: ILUtils When the given expression "expr" is of array type and this type comes from that of an arrayTriplet inside "expr", returns this arrayTriplet access (normalized?) Otherwise returns null findDimColons ^^^^^^^^^^^^^ .. java:method:: public static Tree findDimColons(Tree tree) :outertype: ILUtils :param tree: is a varDeclaration Tree. findRankOfDeclarator ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static int findRankOfDeclarator(Tree tree, String symbol) :outertype: ILUtils :param tree: is a declarators Tree or a varDimDeclaration. findSizeofCall ^^^^^^^^^^^^^^ .. java:method:: public static Tree findSizeofCall(Tree expression) :outertype: ILUtils getAllocatedRef ^^^^^^^^^^^^^^^ .. java:method:: public static Tree getAllocatedRef(Tree accessTree) :outertype: ILUtils getArguments ^^^^^^^^^^^^ .. java:method:: public static Tree getArguments(Tree callTree) :outertype: ILUtils :return: the actual arguments of this method or function call. getBindCValue ^^^^^^^^^^^^^ .. java:method:: public static String getBindCValue(Tree tree, int rank) :outertype: ILUtils :param tree: is an accessDecl Tree :param rank: of declared variable :return: FORTRAN_NAME if tree== accessDecl(accessDecl(ident:bind, expressions[ident:c]), expressions[ident:FORTRAN_NAME]) or return C_NAME if tree == accessDecl(accessDecl(ident:bind, expressions[ident:c, nameEq(ident:name, C_NAME)]), expressions[ident:FORTRAN_NAME]). [llh 12Dec2022] TODO: make this method cleaner and more general, or remove if not used any more. getCall ^^^^^^^ .. java:method:: public static Tree getCall(Tree tree) :outertype: ILUtils :return: tree if tree is a call, tree.down(2) if tree is a call to a function with a return value assignment, and null otherwise. getCallFunctionNameString ^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static String getCallFunctionNameString(Tree callTree) :outertype: ILUtils :return: the name of the called function when "callTree" is a procedure, function, method or constructor call. getCalledName ^^^^^^^^^^^^^ .. java:method:: public static Tree getCalledName(Tree callTree) :outertype: ILUtils :return: the name Tree of the called method or function. getCalledNameString ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static String getCalledNameString(Tree callTree) :outertype: ILUtils :return: the name String of the called method or function. getClassNameString ^^^^^^^^^^^^^^^^^^ .. java:method:: public static String getClassNameString(Tree constructorCallTree) :outertype: ILUtils getFieldRank ^^^^^^^^^^^^ .. java:method:: public static int getFieldRank(Tree field) :outertype: ILUtils Assuming that "field" is the ident tree that designates a record field, :return: the conventional rank of this field, that has been stored here during type-checking. This rank starts at 0 for the first field. In case this rank is not defined, returns -1. getIdentString ^^^^^^^^^^^^^^ .. java:method:: public static String getIdentString(Tree tree) :outertype: ILUtils if "tree" is an op_ident, returns its string. :return: the String, otherwise returns null. getLineNumber ^^^^^^^^^^^^^ .. java:method:: public static int getLineNumber(Tree tree) :outertype: ILUtils :return: the line number or 0 if there is no line number accessible. getListOfStatements ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList getListOfStatements(Tree tree) :outertype: ILUtils When possible, extracts a list of ordered atomic statements from tree. Reciprocal of buildSingleStatement(). Should be refined if necessary. getModulesFromInterfaceDecl ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList getModulesFromInterfaceDecl(Tree tree) :outertype: ILUtils :return: a TapList of module names used by the op_interfaceDecl Tree. getNamedElement ^^^^^^^^^^^^^^^ .. java:method:: public static Tree getNamedElement(Tree listOfElements, String name) :outertype: ILUtils If the given listOfElements contains a child of the form nameEq("name","value"), returns this "value". Otherwise returns null. getObject ^^^^^^^^^ .. java:method:: public static Tree getObject(Tree callTree) :outertype: ILUtils :return: the object on which this method is called. getOptionalDim ^^^^^^^^^^^^^^ .. java:method:: public static Tree getOptionalDim(Tree[] srcParamExprs, SymbolTable symbolTable) :outertype: ILUtils :return: the optional "dim" argument of a F90 SUM. Returns null when no dim is present. getOptionalMask ^^^^^^^^^^^^^^^ .. java:method:: public static Tree getOptionalMask(Tree[] srcParamExprs, SymbolTable symbolTable) :outertype: ILUtils :return: the optional "mask" argument of a F90 SUM. Returns null when no mask is present. getPosition ^^^^^^^^^^^ .. java:method:: public static int getPosition(Tree tree) :outertype: ILUtils getRemoveSchedule ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree getRemoveSchedule(Tree ompPragma) :outertype: ILUtils If "ompPragma" contains a "schedule" clause. :return: the "schedule" clause and removes it from "ompPragma". getUnitName ^^^^^^^^^^^ .. java:method:: public static String getUnitName(Tree tree) :outertype: ILUtils gotoLabelVar ^^^^^^^^^^^^ .. java:method:: public static String gotoLabelVar(Tree tree) :outertype: ILUtils :return: the String of the label variable that is used if "tree" is a "gotoLabelVar" Tree. hasATypeOperator ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean hasATypeOperator(Tree tree) :outertype: ILUtils hasDuplicableLastIndex ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree hasDuplicableLastIndex(Tree doLoopControl, boolean exit) :outertype: ILUtils :return: the expression tree that computes the last (if "exit" is false) or the exit value (if "exit" is true) of the index of a do-loop. @return null when this expression contains side-effets and therefore cannot be executed twice without risk. hasFortran90Modifiers ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean hasFortran90Modifiers(Tree tree) :outertype: ILUtils hasInitializations ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean hasInitializations(Tree tree) :outertype: ILUtils hasTwoLevelIndex ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean hasTwoLevelIndex(Tree indices, SymbolTable symbolTable) :outertype: ILUtils Detects that some index in indices is itself an array of arbitrary indices inInclude ^^^^^^^^^ .. java:method:: public static boolean inInclude(Tree tree, String beginOrEnd) :outertype: ILUtils incorporateAnnotations ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void incorporateAnnotations(Tree destTree, Tree origTree) :outertype: ILUtils Reads the annotations at the root of origTree and tries to merge them with the annotations at the root of destTree. This depends on the "meaning" of the annotations created by Tapenade. You may develop this method further if other annotations get lost... incrementByProtectedExpr ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree incrementByProtectedExpr(int language, Tree lhs, Tree factor, boolean needAtomic) :outertype: ILUtils instrHasSideEffect ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean instrHasSideEffect(Tree expr) :outertype: ILUtils intConstantValue ^^^^^^^^^^^^^^^^ .. java:method:: public static int intConstantValue(Tree tree) :outertype: ILUtils :return: value when it is an integer constant. isACIOSymbol ^^^^^^^^^^^^ .. java:method:: public static boolean isACIOSymbol(Tree tree) :outertype: ILUtils isAConstModified ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAConstModified(Tree decl) :outertype: ILUtils :return: True when given "decl" is modifiedDeclarator(modifiers[ident:const], "subDecl"). isADeclMayAppearFirst ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isADeclMayAppearFirst(Tree tree) :outertype: ILUtils isADeclaration ^^^^^^^^^^^^^^ .. java:method:: public static boolean isADeclaration(Tree tree) :outertype: ILUtils isAFortranOverloadedOperator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAFortranOverloadedOperator(Tree tree) :outertype: ILUtils isAStringManipulation ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAStringManipulation(Tree tree) :outertype: ILUtils isAUnitPlaceHolder ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAUnitPlaceHolder(Tree tree) :outertype: ILUtils isAVarRef ^^^^^^^^^ .. java:method:: public static boolean isAVarRef(Tree tree, SymbolTable symbolTable) :outertype: ILUtils :return: true when "tree" is a reference to a variable writable at the present location. This means that "tree" can be overwritten, modified, passed as a "write" argument of a function or put on the left side of an assignment. WARNING: differs from isAWritableVarRef(): if this variable was declared as a "const" argument of a C procedure, this method considers this tree is *not* writeable. isAVarRefOrConstant ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAVarRefOrConstant(Tree tree) :outertype: ILUtils :return: true when "tree" either is a reference to a variable or is a constant immediate value, i.e. in other words when "tree" does not need a computation to obtain its value. isAVariableOnlyDeclaration ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAVariableOnlyDeclaration(Tree tree) :outertype: ILUtils isAWritableIdentVarRef ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAWritableIdentVarRef(Tree tree, SymbolTable symbolTable) :outertype: ILUtils Same as isAWritableVarRef() but rejects op_fieldAccess and op_substringAccess. isAWritableVarRef ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAWritableVarRef(Tree tree, SymbolTable symbolTable) :outertype: ILUtils :return: true when "tree" is a reference to a variable intrinsically writable. This means that "tree" can be overwritten, modified, passed as a "write" argument of a function or put on the left side of an assignment. WARNING: this is not exactly the same as isAVarRef(): a FORTRAN CONSTANT is considered *not* writable whereas a C "const" argument is considered writable because "const" only means that this procedure promises it will not write in the variable (but it would be possible). This is important because the diff of tree will be writeable because we will not make it "const". isAccessDeclValue ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAccessDeclValue(Tree tree, String value) :outertype: ILUtils isAccessedThroughPointer ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAccessedThroughPointer(Tree expr) :outertype: ILUtils :return: true if expression "expr" dereferences at least one pointer. isAccessibleDirectlyFromVariable ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isAccessibleDirectlyFromVariable(Tree tree) :outertype: ILUtils :return: True if this tree is a direct access to a visible variable name, followed by array or field references, without going through a pointer. isAllocate ^^^^^^^^^^ .. java:method:: public static boolean isAllocate(Tree tree) :outertype: ILUtils isCall ^^^^^^ .. java:method:: public static boolean isCall(Tree tree) :outertype: ILUtils isCallingString ^^^^^^^^^^^^^^^ .. java:method:: public static boolean isCallingString(Tree callTree, String calledName, boolean caseSensitive) :outertype: ILUtils :param caseSensitive: when true, the String equality is case sensitive. :return: true when "callTree" is a call of a function called "calledName". isCudaController ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isCudaController(Tree tree) :outertype: ILUtils :return: true if "tree" is the controller of a CUDA call. isExpressionConstant ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isExpressionConstant(Tree tree) :outertype: ILUtils :return: true when expression is constant or made with constants. isExpressionIntConstant ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isExpressionIntConstant(Tree tree) :outertype: ILUtils :return: true when it is an integer constant. isExpressionNumConstant ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isExpressionNumConstant(Tree tree) :outertype: ILUtils :return: true when it is a numerical constant. isIORead ^^^^^^^^ .. java:method:: public static boolean isIORead(Tree tree) :outertype: ILUtils :return: true if the "tree" is a call to an IO that reads data into its arguments. isIOWrite ^^^^^^^^^ .. java:method:: public static boolean isIOWrite(Tree tree) :outertype: ILUtils :return: true if the "tree" is a call to an IO that writes data from its arguments. isIdent ^^^^^^^ .. java:method:: public static boolean isIdent(Tree tree, String name, boolean caseSensitive) :outertype: ILUtils :param caseSensitive: when true, the string equality is case sensitive. :return: True iff "tree" is op_ident:"name". isIdentOf ^^^^^^^^^ .. java:method:: public static boolean isIdentOf(Tree tree, String[] names, boolean caseSensitive) :outertype: ILUtils :param caseSensitive: when true, the string equality is case sensitive. :return: True iff "tree" is op_ident:"name" with "name" belonging to the given array "names". isIfExpression ^^^^^^^^^^^^^^ .. java:method:: public static boolean isIfExpression(Tree expr) :outertype: ILUtils isImplicitCompleteDimension ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isImplicitCompleteDimension(Tree indexTree) :outertype: ILUtils isIntCst ^^^^^^^^ .. java:method:: public static boolean isIntCst(Tree tree, int value) :outertype: ILUtils :return: True iff "tree" is op_intCst:"value". isNegativeExpression ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNegativeExpression(Tree tree) :outertype: ILUtils :return: true if "tree" is an expression that starts by a "-". isNotNone ^^^^^^^^^ .. java:method:: public static boolean isNotNone(Tree tree) :outertype: ILUtils isNotNoneNorEmpty ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNotNoneNorEmpty(Tree tree) :outertype: ILUtils isNotNoneNorVoid ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNotNoneNorVoid(Tree tree) :outertype: ILUtils isNotVoid ^^^^^^^^^ .. java:method:: public static boolean isNotVoid(Tree tree) :outertype: ILUtils isNullOrEmptyAtom ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrEmptyAtom(Tree tree) :outertype: ILUtils isNullOrEmptyList ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrEmptyList(Tree tree) :outertype: ILUtils isNullOrNone ^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrNone(Tree tree) :outertype: ILUtils isNullOrNoneOrEmptyList ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrNoneOrEmptyList(Tree tree) :outertype: ILUtils isNullOrNoneOrStar ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrNoneOrStar(Tree tree) :outertype: ILUtils isNullOrNoneOrVoid ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isNullOrNoneOrVoid(Tree tree) :outertype: ILUtils isOptPointersIdent ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isOptPointersIdent(Tree tree) :outertype: ILUtils :return: True iff this tree is op_ident nested in 0 or more op_pointerDeclarator. isOverloadedAssign ^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isOverloadedAssign(Tree callAssign) :outertype: ILUtils :return: true when the given Tree is an overloaded assignment, i.e. a call to "assign" with a sourcetree annotation which is an op_binary "assign" isParallelController ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isParallelController(Tree tree) :outertype: ILUtils :return: true if "tree" is the controller of an OpenMP parallel region or loop. isStar ^^^^^^ .. java:method:: public static boolean isStar(Tree tree) :outertype: ILUtils isStaticSchedule ^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isStaticSchedule(Tree schedule) :outertype: ILUtils :return: True if the given "schedule" clause actually specifies "static". isStringOf ^^^^^^^^^^ .. java:method:: public static boolean isStringOf(String name, String[] names) :outertype: ILUtils :return: True iff String "name" belongs to the given array "names". isZero ^^^^^^ .. java:method:: public static boolean isZero(Tree tree) :outertype: ILUtils keepArrayTriplet ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree keepArrayTriplet(Tree tree) :outertype: ILUtils listReversedToComments ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree listReversedToComments(TapList commentsListReversed) :outertype: ILUtils matches ^^^^^^^ .. java:method:: public static boolean matches(Tree tree, Tree patternTree, TapList> keyTreeList) :outertype: ILUtils :return: true iff "tree" matches "patternTree". As a side-effect, places inside "keyTreeList", in front of each metavariable Tree from "patternTree", the matched Tree from "tree". However, even if finally there is no matching, tree traversal goes on and keeps associating trees when reasonably possible. mayBeTransformed2Do ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean mayBeTransformed2Do(Tree tree) :outertype: ILUtils :return: true if this for loop may be transformed into a do loop mergeUseDeclTrees ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree mergeUseDeclTrees(Tree newRestrict, Tree oldRestrict) :outertype: ILUtils Combines two successive use-restriction trees, that are of form either "onlyVisibles" or "renamesVisibles". These restriction trees apply in order, i.e. this method returns the use-restriction tree that results from applying "newRestrict" over "oldRestrict". .. parsed-literal:: [any] + renamedVisibles[] → [any] onlyVisibles[ident1] + onlyVisibles[ident2] → onlyVisibles[ident1] renamedVisibles[r1] + renamedVisibles[r2] → renamedVisibles[r1 + r2] (TODO) onlyVisibles[ident1] + renamedVisibles[r2] → onlyVisibles[ident1, renamedVisibles[r2]] (TODO) minusProtectedExpr ^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree minusProtectedExpr(Tree factor) :outertype: ILUtils Same as mulProtectedExprs, but just takes the opposite. minusTree ^^^^^^^^^ .. java:method:: public static Tree minusTree(Tree tree) :outertype: ILUtils modifyRootName ^^^^^^^^^^^^^^ .. java:method:: public static Tree modifyRootName(Tree model, String oldName, String newName) :outertype: ILUtils mulProtectedExprs ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree mulProtectedExprs(Tree factor1, TypeSpec type1, Tree factor2, TypeSpec type2) :outertype: ILUtils Multiplies two factors, taking care of the case where any of them is protected. In this case, builds a new protected factor, where the test is the OR of both tests and the factor is the mulTree of the two factors. In either branch "then" and "else", a null or a none "()" means zero. Works only in the following cases (symmetric cases work just as well): .. parsed-literal:: () * () → () Exp1 * Exp2 → Exp1*Exp2 Exp1 * (T2?SExp2:Exp2) → (T2?Exp1*SExp2:Exp1*Exp2) (T1?():Exp1) * (T2?():Exp2) → (T1orT2?():Exp1*Exp2) mulTree ^^^^^^^ .. java:method:: public static Tree mulTree(Tree tree1, Tree tree2) :outertype: ILUtils normalizePath ^^^^^^^^^^^^^ .. java:method:: public static String normalizePath(String path) :outertype: ILUtils When stringAtomTree is an atomic Tree with a String value, assuming this string is a file path, normalizes this path by removing "dirname/.." sequences. oneIsArrayTriplet ^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean oneIsArrayTriplet(Tree indices) :outertype: ILUtils operator ^^^^^^^^ .. java:method:: public static Operator operator(String name) :outertype: ILUtils Gets an IL operator from its name. :param name: The name of the operator. :return: The operator if it exists otherwise null. pathFromPointerAccess ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree pathFromPointerAccess(Tree expr) :outertype: ILUtils \ ``*(*(*p.f1).f2).f3.f4 ==> *_.f3.f4``\ peelConstModifier ^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree peelConstModifier(Tree type) :outertype: ILUtils peelInOutConstValueModifier ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree peelInOutConstValueModifier(Tree type) :outertype: ILUtils peelModifier ^^^^^^^^^^^^ .. java:method:: public static void peelModifier(Tree tree, String modifier) :outertype: ILUtils position ^^^^^^^^ .. java:method:: public static int position(Tree tree) :outertype: ILUtils :return: the "position" of "tree". To do that, go up until a tree annotated with its "position" is found, then depth-first sweep this above tree, incrementing the position, until "tree" is found again. powerTree ^^^^^^^^^ .. java:method:: public static Tree powerTree(Tree tree1, Tree tree2) :outertype: ILUtils pullProtectedArg ^^^^^^^^^^^^^^^^ .. java:method:: public static Tree pullProtectedArg(Tree callTree, int argRank) :outertype: ILUtils Looks at argument argRank of the given callTree. If this argument is "protected", i.e. it is an ifExpression, and we are targetting Fortran, then returns a new tree which has the protection outside and the call inside. Otherwise returns the unmodified callTree. putBackNamedArguments ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void putBackNamedArguments(Tree tree) :outertype: ILUtils If the given tree contains call arguments, and those have been "normalized" by inserting none() arguments and removing the nameEq's, puts the argument list back in the fortran-style form with no none() and named arguments when needed. reBuildNameEqArgs ^^^^^^^^^^^^^^^^^ .. java:method:: public static void reBuildNameEqArgs(Tree callTree, Tree resultTree) :outertype: ILUtils realIsInt ^^^^^^^^^ .. java:method:: protected static boolean realIsInt(String str, TapIntList toIntVal) :outertype: ILUtils Tests that the current String (found in a op_realCst) actually represents an integer. If so, returns true, and if "toIntVal" is non-null, also sets its head to the corresponding integer value if in [-maxint;+maxint]. reducSumProtectedExpr ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree reducSumProtectedExpr(Tree factor, Tree maskTree) :outertype: ILUtils removeSizeModifiers ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree[] removeSizeModifiers(Tree[] modifiers) :outertype: ILUtils removeSourceCodeAnnot ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree removeSourceCodeAnnot(Tree tree) :outertype: ILUtils removeTreeDeclOf ^^^^^^^^^^^^^^^^ .. java:method:: public static void removeTreeDeclOf(String symbol, Tree varDeclTree) :outertype: ILUtils removeUsedModuleFromInterfaceDecl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void removeUsedModuleFromInterfaceDecl(Tree tree, String moduleName) :outertype: ILUtils replaceAllCallName ^^^^^^^^^^^^^^^^^^ .. java:method:: public static void replaceAllCallName(Tree tree, String oldUnitName, String newUnitName, Tree newUnitNameTree, SymbolTable symbolTable) :outertype: ILUtils replaceAllIdentsNamed ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void replaceAllIdentsNamed(Tree tree, String oldName, String newName) :outertype: ILUtils replaceIdentStringOccurences ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree replaceIdentStringOccurences(Tree tree, String identString, Tree newTree) :outertype: ILUtils Replaces all occurrences of op_ident(identString) with "newTree" in the given "tree". Modifies "tree" in place. :return: the modified tree. replaceRootWithNewRoot ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree replaceRootWithNewRoot(Tree ref, Tree oldRoot, Tree newRoot) :outertype: ILUtils Builds a new Tree, copy of given ref-expression "ref", but in which root ref-expression "oldRoot" is replaced with "newRoot" replaceUsedModule ^^^^^^^^^^^^^^^^^ .. java:method:: public static void replaceUsedModule(Tree tree, String oldUnitName, Tree newUnitNameTree) :outertype: ILUtils resetAssignFromInitDecl ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void resetAssignFromInitDecl(Tree assignmentTree) :outertype: ILUtils Restoration. cf turnAssignFromInitDecl(). resetReturnFromAssign ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void resetReturnFromAssign(Tree returnTree, Tree assignTree) :outertype: ILUtils Restoration. cf turnReturnIntoAssign(). reverseArrayComponentOrder ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree reverseArrayComponentOrder(Tree tree) :outertype: ILUtils :param tree: is a list Tree :return: the reversed list Tree reversedExprAccess ^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList reversedExprAccess(Tree expr) :outertype: ILUtils :return: the reversed list of all nested levels in "expr". For example \ ``A[2,1:n]%x[:]``\ produces \ ``{A, A[2,1:n], A[2,1:n]%x, A[2,1:n]%x[:]}``\ . reversedExprAccessFromPointerAccess ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList reversedExprAccessFromPointerAccess(Tree expr, boolean peelAllocate) :outertype: ILUtils seemsInteger ^^^^^^^^^^^^ .. java:method:: public static boolean seemsInteger(Tree exp) :outertype: ILUtils :return: true when the given Tree seems to be an expression with a numerical INTEGER value, that can be computed. setArguments ^^^^^^^^^^^^ .. java:method:: public static void setArguments(Tree callTree, Tree arguments) :outertype: ILUtils setFieldRank ^^^^^^^^^^^^ .. java:method:: public static void setFieldRank(Tree field, int fieldRank) :outertype: ILUtils setOrigTree ^^^^^^^^^^^ .. java:method:: public static void setOrigTree(Tree tree, Tree origTree) :outertype: ILUtils setPosition ^^^^^^^^^^^ .. java:method:: public static void setPosition(Tree tree, int position) :outertype: ILUtils setToProtectedExpr ^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree setToProtectedExpr(int language, Tree lhs, Tree rhs, TypeSpec assignedType) :outertype: ILUtils skipAllocate ^^^^^^^^^^^^ .. java:method:: public static Tree skipAllocate(Tree tree) :outertype: ILUtils Copy "tree" skipping its op_allocate level splitDeclInit ^^^^^^^^^^^^^ .. java:method:: public static TapPair splitDeclInit(Tree tree, boolean addSaveModifier, Unit curUnit) :outertype: ILUtils splitLongDeclaration ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList splitLongDeclaration(Tree tree) :outertype: ILUtils If tree is a varDeclaration with too many declared variables, splits it into a list of varDeclaration, each of acceptable length. Otherwise returns null stopInclude ^^^^^^^^^^^ .. java:method:: public static boolean stopInclude(Tree tree, String stopValue) :outertype: ILUtils stripArrayAccesses ^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree stripArrayAccesses(Tree expr) :outertype: ILUtils Returns a copy of ref-expression "expr" in which array accesses are removed. Example: *(A(2,:).field(j+1)).field2 gives *(A.field).field2 stripSpecialization ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static String stripSpecialization(String name) :outertype: ILUtils Removes the specialization suffix added to C++ specialized templated objects. subTree ^^^^^^^ .. java:method:: public static Tree subTree(Tree tree1, Tree tree2) :outertype: ILUtils tapenadeUtilityFunctionName ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree tapenadeUtilityFunctionName(Unit diffUnit, String funcName) :outertype: ILUtils toString ^^^^^^^^ .. java:method:: public static String toString(Tree tree) :outertype: ILUtils toString ^^^^^^^^ .. java:method:: public static String toString(Tree tree, int language) :outertype: ILUtils toString ^^^^^^^^ .. java:method:: public static String toString(Tree tree, int language, boolean withIndices) :outertype: ILUtils toString ^^^^^^^^ .. java:method:: public static String toString(Tree tree, int language, ActivityPattern pattern) :outertype: ILUtils toString ^^^^^^^^ .. java:method:: public static String toString(Tree tree, ActivityPattern pattern) :outertype: ILUtils transformFor2Do ^^^^^^^^^^^^^^^ .. java:method:: public static Tree transformFor2Do(Tree tree) :outertype: ILUtils Transforms a for-loop into a do-loop. :return: a do-loop. turnAssignFromInitDecl ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void turnAssignFromInitDecl(Tree assignmentTree) :outertype: ILUtils Modifies assigmentTree to represent the corresponding "true" assignment. For instance, given \ ``(*x) = y+1``\ which is the 2nd child of \ ``float *x = y+1``\ , turns it temporarily into \ ``x = y+1``\ . This damages the original assignment. WARNING: IMMEDIATELY after usage of the modified assignment tree, it MUST be repaired into its original form with resetAssignFromInitDecl(returnedTree). :param assignmentTree: Tree present in a declaration with initialization. turnReturnIntoAssign ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree turnReturnIntoAssign(Tree returnTree, String returnVarName) :outertype: ILUtils Given "returnTree" (a C-style "return " tree), creates "assignTree" (a tree of shape "returnVarName := ") that shares the tree instead of copying it. This damages the original returnTree. WARNING: IMMEDIATELY after usage of the created assignTree, the returnTree MUST be repaired into its original form with resetReturnFromAssign(returnTree, assignTree). typeName ^^^^^^^^ .. java:method:: public static String typeName(Tree tree) :outertype: ILUtils usedVarsInDiffExp ^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList usedVarsInDiffExp(Tree expression, TapList refsR, TapList toDiffRefsR, boolean keepTop) :outertype: ILUtils Augment the list of Trees "refsR" with all the expressions whose primal is recursively needed to evaluate the diff of "expression". Augment the (hatted) list of Trees "toDiffRefsR" with all the expressions whose diff is recursively needed to evaluate the diff of "expression". New expressions are added only if they are not already present. Example: for *(p[i+j]), i , j go to refsR, and p, p[i], (and if keepTop *(p[i])) go to toDiffRefsR :param toDiffRefsR: the hatted list that accumulates the expressions whose diff is used. :param keepTop: if false, the top "expression" itself is not added. :return: the augmented "refsR" list. usedVarsInExp ^^^^^^^^^^^^^ .. java:method:: public static TapList usedVarsInExp(Tree expression, TapList refsR, boolean keepTop) :outertype: ILUtils Augment the list of Trees "refsR" with all the expressions recursively needed to evaluate "expression". New expressions are added only if they are not already present. :param keepTop: if false, the top "expression" itself is not added. :return: the augmented "refsR" list. usedVarsInTreeOfExps ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static TapList usedVarsInTreeOfExps(TapList treeOfExps, TapList refsR, boolean keepTop) :outertype: ILUtils :return: the list of Trees "refsR", augmented with all the expressions recursively needed to evaluate expressions in "treeOfExps". New expressions are added only if they are not already present. If "keepTop" is false, top-level expressions in "treeOfExps" are not returned. variableDeclaratorToVariableRef ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree variableDeclaratorToVariableRef(Tree varDecl) :outertype: ILUtils