coins.alias
クラス AliasUtil

java.lang.Object
  |
  +--coins.alias.AliasUtil

public class AliasUtil
extends java.lang.Object

A collection of utility methods. Most methods are static, but some methods need references to root objects such as HirRoot or SymRoot and so are instance methods.


フィールドの概要
 IoRoot io
           
 SymRoot symRoot
          The SymRoot object shared by every module in the program.
 
コンストラクタの概要
AliasUtil(SymRoot pSymRoot)
          Creates a new instance of AliasUtil.
 
メソッドの概要
 boolean areCompatible(Type pType, Type pType0)
           
static boolean areWeakCompatible(Type pType, Type pType0)
           
 void dbg(int pLevel, java.lang.String pHeader, java.lang.Object pBody)
          Prints out the String representation of the pBody object headed by pHeader if the debug level for this alias analysis category is greater than or equal to pLevel.
static java.util.Set getComponentScalarTypes(Type pType)
           
 Elem getFirstElem(StructType pStructType)
           
static boolean ismalloc(Subp pSubp)
          Creates a new instance of AliasUtil that is associated with a specified instance of alias analysis.
static boolean isPredefined(Subp pSubp, java.util.Set pPredefined)
          Returns true if the specified argument is known to be well behaved.
static boolean isScalar(Type pType)
           
 boolean mayAlias(Type pType, Type pType0)
          Type-based alias testing.
(パッケージプライベート) static boolean subscriptCheck(VectorType pType, int pSubscript)
          Checks if the specified constant subscript is within the bounds for the specified VectorType object.
 Type toBareAndSigned(Type pType)
           
(パッケージプライベート) static java.lang.String toString(HIR pHIR)
          Returns a String representation of the specified argument that is more representative than the one its toString method provides.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

symRoot

public final SymRoot symRoot
The SymRoot object shared by every module in the program.


io

public final IoRoot io
コンストラクタの詳細

AliasUtil

public AliasUtil(SymRoot pSymRoot)
Creates a new instance of AliasUtil.

パラメータ:
pSymRoot - SymRoot object shared by every module in the program.
メソッドの詳細

ismalloc

public static boolean ismalloc(Subp pSubp)
Creates a new instance of AliasUtil that is associated with a specified instance of alias analysis.

パラメータ:
pSubp - Subp Sym to test for.
戻り値:
true if the specified argument is the malloc C library function Sym.

isPredefined

public static boolean isPredefined(Subp pSubp,
                                   java.util.Set pPredefined)
Returns true if the specified argument is known to be well behaved. Well-behavedness of a subprogram here means it neither modifies objects (an area in the memory space) that may be accessed from the code outside of the subprogram nor stores the addresses of such objects in storage accessible outside of the subprogram nor it returns a pointer to such objects. I/O is irrelevant. Most library functions are well behaved.

パラメータ:
pSubp - Subp Sym to test for.
戻り値:
true if the specified argument is well behaved.

mayAlias

public boolean mayAlias(Type pType,
                        Type pType0)
Type-based alias testing. Source language (currently only C is implemented) rules may prohibit lvalues of certain types to alias. This method tests for such aliasing possiblity. Our aliasing rule dictates an aggregate-type object alias to its member object, so this method returns true for an aggregate type and its member type.

パラメータ:
pType - Type of an lvalue to test for aliasing.
pType0 - Type of an lvalue to test for aliasing.
戻り値:
true if lvalues of the specified Types can possibly alias.

toBareAndSigned

public Type toBareAndSigned(Type pType)

areCompatible

public boolean areCompatible(Type pType,
                             Type pType0)

toString

static java.lang.String toString(HIR pHIR)
Returns a String representation of the specified argument that is more representative than the one its toString method provides. The returned String contains representation for the children of the specified argument.

パラメータ:
pHIR - HIR node whose String representation is to be returned.
戻り値:
a more detailed String representation of the specified argument than the one its toString method provides.

subscriptCheck

static boolean subscriptCheck(VectorType pType,
                              int pSubscript)
Checks if the specified constant subscript is within the bounds for the specified VectorType object.

パラメータ:
pType - VectorType object to test against.
pSubscript - constant subscript that is tested to see if it is in the allowed range for the given VectorType object.
戻り値:
true if the specified subscript is within the allowed ranged for the specified VectorType.

isScalar

public static boolean isScalar(Type pType)

getComponentScalarTypes

public static java.util.Set getComponentScalarTypes(Type pType)

getFirstElem

public Elem getFirstElem(StructType pStructType)

areWeakCompatible

public static boolean areWeakCompatible(Type pType,
                                        Type pType0)

dbg

public void dbg(int pLevel,
                java.lang.String pHeader,
                java.lang.Object pBody)
Prints out the String representation of the pBody object headed by pHeader if the debug level for this alias analysis category is greater than or equal to pLevel.

パラメータ:
pLevel - the debug level required to actually print the debug information.
pHeader - header for the information
pBody - body of the information
関連項目:
Debug.printObject(int, String, Object)