coins.alias
インタフェース AliasAnal

既知の実装クラスの一覧:
AliasAnalHir1

public interface AliasAnal

Interface for HIR alias analysis. All future alias analysis classes will implement this interface.

The query interfaces mayAlias, mustAlais, and getAliasGroupFor all deal with lvalues. An lvalue is an HIR node that is associated with an object, and its operator code (see {Link coins.ir.hir.HIR#getOperator}) is one of HIR.OP_VAR, HIR.OP_SUBS, HIR.OP_QUAL, HIR.OP_ARROW, HIR.OP_CONTENTS, and HIR.OP_UNDECAY. HIR nodes with the operator code HIR.OP_SUBS or HIR.OP_QUAL, however, are lvalue only when their first child (specified by {Link coins.ir.hir.SubscriptedExp#getArrayExp} and {Link coins.ir.hir.Exp#getQualifierExp}, respectively) is lvalue. To see if an Exp node is lvalue, the isLvalue method may be used.


フィールドの概要
static java.lang.String CATEGORY_NAME
          The category name of the alias analysis package.
 
メソッドの概要
 AliasGroup getAliasGroupFor(Exp pExp)
          Returns the set of lvalue nodes that are possibly aliased (mayAlias) to the specified argument.
 boolean isLvalue(Exp pExp)
          Returns true if the specified argument is considered lvalue in this alias analysis.
 boolean mayAlias(Exp pExp, Exp pExp0)
          Returns true if the two arguments may refer to an overlapping area in memory.
 boolean mustAlias(Exp pExp, Exp pExp0)
          Returns true if the two arguments definitely refer to an overlapping area in memory.
 void prepareForAliasAnalHir(SubpDefinition pSubpDef)
          Performs alias analysis for the given argument.
 void printAliasPairs(SubpDefinition pSubpDef)
          Prints out alias pairs in IoRoot.printOut object.
 

フィールドの詳細

CATEGORY_NAME

public static final java.lang.String CATEGORY_NAME
The category name of the alias analysis package. It is "Alias". Used in debug-tracing.

関連項目:
定数フィールド値
メソッドの詳細

prepareForAliasAnalHir

public void prepareForAliasAnalHir(SubpDefinition pSubpDef)

Performs alias analysis for the given argument. After calling this method, the alias analysis object (object that implements this interface) is ready to accept the queries (mayAlias etc.) for the specified argument.

For intraprocedural analyses only (so far).

パラメータ:
pSubpDef - the SubpDefinition instance nodes belonging to which are to be analyzed for aliasing.

isLvalue

public boolean isLvalue(Exp pExp)
Returns true if the specified argument is considered lvalue in this alias analysis.

戻り値:
true if the specified argument is lvalue.

mayAlias

public boolean mayAlias(Exp pExp,
                        Exp pExp0)
Returns true if the two arguments may refer to an overlapping area in memory. The two arguments both must be contained in the SubpDefinition which was analyzed most recently by this analysis instance.

パラメータ:
pExp - lvalue node to check for aliasing.
pExp0 - lvalue node to check for aliasing.
戻り値:
true if the two arguments may refer to an overlapping area in memory.
例外:
java.lang.IllegalArgumentException - if either of the arguments is not lvalue.

mustAlias

public boolean mustAlias(Exp pExp,
                         Exp pExp0)
Returns true if the two arguments definitely refer to an overlapping area in memory. The two arguments both must be contained in the SubpDefinition which was analyzed most recently by this analysis instance.

パラメータ:
pExp - lvalue node to check for aliasing.
pExp0 - lvalue node to check for aliasing.
戻り値:
true if the two arguments definitely refer to an overlapping area in memory.
例外:
java.lang.IllegalArgumentException - if either of the arguments is not lvalue.

getAliasGroupFor

public AliasGroup getAliasGroupFor(Exp pExp)
Returns the set of lvalue nodes that are possibly aliased (mayAlias) to the specified argument. The argument must be contained in the SubpDefinition which was analyzed most recently by this analysis instance.

パラメータ:
pExp - lvalue node to check for aliasing.
戻り値:
the set of lvalue nodes that mayAlias to the specified argument.
例外:
java.lang.IllegalArgumentException - if the argument is not lvalue. See #mayAlias

printAliasPairs

public void printAliasPairs(SubpDefinition pSubpDef)
Prints out alias pairs in IoRoot.printOut object. For debugging.

パラメータ:
pSubpDef - the SubpDefinition object for which alias pairs will be printed.