at.dms.kjc.rstream
Class Util

java.lang.Object
  extended by at.dms.util.Utils
      extended by at.dms.kjc.rstream.Util
All Implemented Interfaces:
DeepCloneable, Serializable

public class Util
extends Utils

This class contains various function used by multiple passes

See Also:
Serialized Form

Field Summary
static String CSTIFPVAR
           
static String CSTIINTVAR
           
static String CSTOFPVAR
           
static String CSTOINTVAR
           
 
Fields inherited from class at.dms.util.Utils
EMPTY_LIST, getForLoopCallers
 
Constructor Summary
Util()
           
 
Method Summary
static boolean countMe(SIRFilter filter)
           
static CType getBaseType(CType type)
          get the base type of a type, so for array's return the element type
static int getItemsPushed(FlatNode from, FlatNode to)
          return the number of items pushed from *from* to *to* on each iteration of *from*.
static int getTypeSize(CType type)
           
static JExpression getVar(JArrayAccessExpression expr)
          get the variable access in an array access expression
static boolean isIntOne(JExpression exp)
          return true if this exp is a JIntLiteral and the int value is 1
static boolean isIntZero(JExpression exp)
          return true if this exp is a JIntLiteral and the int value is 0
static String JPhylumToC(JPhylum top)
          convert an IR tree to a string of C code
static int[] makeInt(JExpression[] dims)
          turn an array of JIntLiterals into an array of ints, fail if not JIntLiterals
static String[] makeString(JExpression[] dims)
          turn an array of expressions to any array of strings using FlatIRToRS
static JExpression newIntAddExpr(JExpression left, JExpression right)
          construct a new JAddExpression, *left* + *right* where both are of type int.
static JExpression newIntMultExpr(JExpression left, JExpression right)
          construct a new JMultExpression, *left* * *right* where both are of type int.
static JExpression newIntSubExpr(JExpression left, JExpression right)
          construct a new JMinusExpression, *left* - *right* where both are of type int.
static int nextPow2(int i)
           
 
Methods inherited from class at.dms.util.Utils
asPercent, cellMathEquivalent, cMathEquivalent, cppMathEquivalent, deepClone, deepCloneInto, equalArrays, fail, getEnvironmentVariable, getExpression, hasPeeks, initArray, initArray, initLiteralArray, intArrayToList, isMathMethod, isUniform, kopi_assert, kopi_assert, makeCountdownForLoop, makeDotFileName, makeForLoop, makeForLoop, makeForLoop, makeForLoopFieldIndex, makeForLoopLocalIndex, passThruParens, peelMarkers, popBeforePeek, readFile, removeUnusedPops, replaceAll, setupDotFileName, simplifyMathMethod, splitQualifiedName, splitQualifiedName, toArray, toIntArray, toVector, voidToInt, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSTOINTVAR

public static String CSTOINTVAR

CSTOFPVAR

public static String CSTOFPVAR

CSTIFPVAR

public static String CSTIFPVAR

CSTIINTVAR

public static String CSTIINTVAR
Constructor Detail

Util

public Util()
Method Detail

countMe

public static boolean countMe(SIRFilter filter)

nextPow2

public static int nextPow2(int i)

getTypeSize

public static int getTypeSize(CType type)

getBaseType

public static CType getBaseType(CType type)
get the base type of a type, so for array's return the element type


getVar

public static JExpression getVar(JArrayAccessExpression expr)
get the variable access in an array access expression


makeString

public static String[] makeString(JExpression[] dims)
turn an array of expressions to any array of strings using FlatIRToRS


makeInt

public static int[] makeInt(JExpression[] dims)
turn an array of JIntLiterals into an array of ints, fail if not JIntLiterals


getItemsPushed

public static int getItemsPushed(FlatNode from,
                                 FlatNode to)
return the number of items pushed from *from* to *to* on each iteration of *from*. If from is a splitter take this into account


JPhylumToC

public static String JPhylumToC(JPhylum top)
convert an IR tree to a string of C code


newIntAddExpr

public static JExpression newIntAddExpr(JExpression left,
                                        JExpression right)
construct a new JAddExpression, *left* + *right* where both are of type int. Try to fold constants


newIntMultExpr

public static JExpression newIntMultExpr(JExpression left,
                                         JExpression right)
construct a new JMultExpression, *left* * *right* where both are of type int. Try to fold constants


newIntSubExpr

public static JExpression newIntSubExpr(JExpression left,
                                        JExpression right)
construct a new JMinusExpression, *left* - *right* where both are of type int. Try to fold constants


isIntZero

public static boolean isIntZero(JExpression exp)
return true if this exp is a JIntLiteral and the int value is 0


isIntOne

public static boolean isIntOne(JExpression exp)
return true if this exp is a JIntLiteral and the int value is 1