coins.alias
クラス Tag

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

class Tag
extends java.lang.Object

A Tag corresponds to some area in memory. It is assciated with the set of lvalue expressions that have the same form. So this could have extended ExpId, but instead has a field that links to the ExpId (MyExpId) it represents.

Tags form a tree structure in which parent nodes represent areas in memory that includes the areas child nodes represent. This relationship is used to assign bits to each Tag. It also makes it possible, via promote() method, to accurately handle the situation where some area obsuring operations, such as pointer arithmetic, hss been performed.


フィールドの概要
(パッケージプライベート) static int ANCHORED
          Flag number for anchoredness.
(パッケージプライベート)  int fBitPos
          Bit position this Tag correponds to in the TagVectors to be created.
(パッケージプライベート)  java.util.List fChildren
          List of child Tags of this Tag.
(パッケージプライベート)  boolean fIsUnique
          Specifies if this Tag represents a unique area in memory.
(パッケージプライベート)  int fKind
          Kind of this Tag.
(パッケージプライベート)  MyExpId fMyExpId
          MyExpId object this Tag is associated with.
(パッケージプライベート)  Tag fParent
          Parent Tag of this Tag.
(パッケージプライベート)  int fStorageClass
          Storage class of this Tag.
(パッケージプライベート)  TagVector fTagVect
          TagVector object that represents all the objects this Tag may represnt.
(パッケージプライベート)  Type fType
          Type of the object this Tag represents.
(パッケージプライベート)  Tag fUnionAncestor
           
(パッケージプライベート) static int HAS_UNION_ANCESTOR
          Flag number for whether being a union descendant.
(パッケージプライベート) static int KIND_ATOMIC
          The kind for the Tags that represent atomic (scalar) type objects.
(パッケージプライベート) static int KIND_STRUCT
          The kind for the Tags that represent struct type objects.
(パッケージプライベート) static int KIND_UNION
          The kind for the Tags that represent union type objects.
(パッケージプライベート) static int KIND_UNKNOWN
          The kind for the Tag whose type is unknown,
(パッケージプライベート) static int KIND_VECTOR
          The kind for the Tags represent vector type objects.
(パッケージプライベート) static int STO_CUR_FRAME
          Current frmae storage class, the storage class that corresponds to automatic variables declared within the current subprogram.
(パッケージプライベート) static int STO_HEAP
          Heap storage class, the storage class that corresponds to areas allocated by the current subprogram.
(パッケージプライベート) static int STO_OTHER
          Other storage class, the storage class that does not fall into current frame or static or heap.
(パッケージプライベート) static int STO_ROOT
          Root storage class, the storage class that corresponds to the whole memory space.
(パッケージプライベート) static int STO_STATIC
          Static storage class, the storage class that corresponds to static Vars.
 
コンストラクタの概要
(パッケージプライベート) Tag(HIR pmallocInvocationNode)
          Creates a new instance of Tag that is associated with an area allocated by a single malloc invocation.
(パッケージプライベート) Tag(int pKind)
          Creates a new instance of Tag that corresponds to the STO_OTHER storage class.
(パッケージプライベート) Tag(MyExpId pMyExpId, boolean pIsAnchored, int pKind, int pStorageClass)
          Creates a new instance of Tag that is associated with a MyExpId object.
 
メソッドの概要
(パッケージプライベート)  boolean getFlag(int pFlag)
           
(パッケージプライベート)  void inheritAttributes()
          Inherits attributes from the parent Tag.
(パッケージプライベート)  boolean isAnchored()
          Returns true if this Tag has a corresponding anchor.
(パッケージプライベート)  Tag promote()
          Returns the Tag that covers the area that the result of the pointer operation that has a pointer expression that points to one of the areas that this Tag represents as one of its operands can point to.
(パッケージプライベート)  void setFlag(int pFlag, boolean pYesNo)
           
 java.lang.String toString()
          Returns the String representation of this Tag.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

fMyExpId

MyExpId fMyExpId
MyExpId object this Tag is associated with.


fKind

int fKind
Kind of this Tag. See the static fields of the names KIND_**** of this class.


fStorageClass

int fStorageClass
Storage class of this Tag.


fType

Type fType
Type of the object this Tag represents. Tags that represent


fBitPos

int fBitPos
Bit position this Tag correponds to in the TagVectors to be created. -1 if there is no such corresponding bit.


fIsUnique

boolean fIsUnique
Specifies if this Tag represents a unique area in memory. A Tag associated with a Var or constant-subscript element of an array Var or malloced area is unique.


fParent

Tag fParent
Parent Tag of this Tag. The parent Tag of a Tag corresponds to the area in memory that directly encloses the area the original Tag represents. As such, the original Tag must represent a relatively limited area in memory (isAnchored), or fAnchored is null. See #fChildren See #isAnchored


fChildren

java.util.List fChildren
List of child Tags of this Tag. A child Tag of a Tag corresponds to an area in memory that is directly enclosed by the area the original Tag represnts. As such, the original Tag must represent a relatively limited area in memory (isAnchored), or fChildren is empyt. See #fParent See #isAnchored


fUnionAncestor

Tag fUnionAncestor

KIND_VECTOR

static final int KIND_VECTOR
The kind for the Tags represent vector type objects.

関連項目:
定数フィールド値

KIND_STRUCT

static final int KIND_STRUCT
The kind for the Tags that represent struct type objects.

関連項目:
定数フィールド値

KIND_UNION

static final int KIND_UNION
The kind for the Tags that represent union type objects.

関連項目:
定数フィールド値

KIND_ATOMIC

static final int KIND_ATOMIC
The kind for the Tags that represent atomic (scalar) type objects.

関連項目:
定数フィールド値

KIND_UNKNOWN

static final int KIND_UNKNOWN
The kind for the Tag whose type is unknown,

関連項目:
定数フィールド値

STO_ROOT

static final int STO_ROOT
Root storage class, the storage class that corresponds to the whole memory space.

関連項目:
定数フィールド値

STO_CUR_FRAME

static final int STO_CUR_FRAME
Current frmae storage class, the storage class that corresponds to automatic variables declared within the current subprogram.

関連項目:
定数フィールド値

STO_STATIC

static final int STO_STATIC
Static storage class, the storage class that corresponds to static Vars.

関連項目:
定数フィールド値

STO_HEAP

static final int STO_HEAP
Heap storage class, the storage class that corresponds to areas allocated by the current subprogram.

関連項目:
定数フィールド値

STO_OTHER

static final int STO_OTHER
Other storage class, the storage class that does not fall into current frame or static or heap. It covers automatic Vars from subprograms calling the current subprogram, global Vars that do not appear in the current subprogram, and areas allocated by the subprograms calling the current subprogram.

関連項目:
定数フィールド値

fTagVect

TagVector fTagVect
TagVector object that represents all the objects this Tag may represnt. This will change as the analysis goes on.


ANCHORED

static final int ANCHORED
Flag number for anchoredness. See getFlag See setFlag

関連項目:
定数フィールド値

HAS_UNION_ANCESTOR

static final int HAS_UNION_ANCESTOR
Flag number for whether being a union descendant. See getFlag See setFlag

関連項目:
定数フィールド値
コンストラクタの詳細

Tag

Tag(MyExpId pMyExpId,
    boolean pIsAnchored,
    int pKind,
    int pStorageClass)
Creates a new instance of Tag that is associated with a MyExpId object.

パラメータ:
pMyExpId - MyExpId object this Tag is associated with.
pIsAnchored - Is this Tag associated with a single named Var?
pKind - kind of this Tag.
pStorageClass - storage class of this Tag.

Tag

Tag(HIR pmallocInvocationNode)
Creates a new instance of Tag that is associated with an area allocated by a single malloc invocation. malloc invocation within loops are not considered distinct (there are considered a single invocation).

パラメータ:
pmallocInvocationNode - FunctionExp node that is an malloc invocation node.

Tag

Tag(int pKind)
Creates a new instance of Tag that corresponds to the STO_OTHER storage class.

パラメータ:
pKind - the kind of Tag to be created.
メソッドの詳細

inheritAttributes

void inheritAttributes()
Inherits attributes from the parent Tag. Attributes to be inherited are anchoredness (specified by isAnchored) and HAS_UNION_ANCESTOR flag. Additionally, if this Tag is of kind UNION, sets the HAS_UNION_ANCESTOR flag. See #isAnchored See HAS_UNION_ANCESTOR See KIND_UNION


isAnchored

boolean isAnchored()
Returns true if this Tag has a corresponding anchor. A Tag represents an area in memory, but which area it represents may not be accurately determined at compile time. Tags which are anchored can only represent areas in memory that are inside the area the anchor Tag represents.

戻り値:
true if this Tag has a corresponding anchor.

promote

Tag promote()
Returns the Tag that covers the area that the result of the pointer operation that has a pointer expression that points to one of the areas that this Tag represents as one of its operands can point to. It is either fAnchor or this Tag itself.

戻り値:
the Tag the area which it represents the result of the pointer operations involving pointers to the area this Tag represents may point to.

getFlag

boolean getFlag(int pFlag)

setFlag

void setFlag(int pFlag,
             boolean pYesNo)

toString

public java.lang.String toString()
Returns the String representation of this Tag.

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
the String representation of this Tag.