C# Class Mono.CSharp.TypeInfo

This is used by the flow analysis code to keep track of the type of local variables and variables. The flow code uses a BitVector to keep track of whether a variable has been assigned or not. This is easy for fundamental types (int, char etc.) or reference types since you can only assign the whole variable as such. For structs, we also need to keep track of all its fields. To do this, we allocate one bit for the struct itself (it's used if you assign/access the whole struct) followed by one bit for each of its fields. This class computes this `layout' for each type.
Afficher le fichier Open project: vargaz/mono Class Usage Examples

Méthodes publiques

Свойство Type Description
IsStruct bool
Length int
Offset int
SubStructInfo TypeInfo[]
TotalLength int

Méthodes publiques

Méthode Description
GetFieldIndex ( string name ) : int
GetStructField ( string name ) : TypeInfo
GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool

A struct's constructor must always assign all fields. This method checks whether it actually does so.

Reset ( ) : void
ToString ( ) : string

Private Methods

Méthode Description
TypeInfo ( ) : System
TypeInfo ( StructInfo struct_info, int offset ) : System
TypeInfo ( int totalLength ) : System

Method Details

GetFieldIndex() public méthode

public GetFieldIndex ( string name ) : int
name string
Résultat int

GetStructField() public méthode

public GetStructField ( string name ) : TypeInfo
name string
Résultat TypeInfo

GetTypeInfo() public static méthode

public static GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
type System.TypeSpec
context IMemberContext
Résultat TypeInfo

IsFullyInitialized() public méthode

A struct's constructor must always assign all fields. This method checks whether it actually does so.
public IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool
fc Mono.CSharp.FlowAnalysisContext
vi VariableInfo
loc Mono.CSharp.Location
Résultat bool

Reset() public static méthode

public static Reset ( ) : void
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

Property Details

IsStruct public_oe property

If this is a struct.
public bool IsStruct
Résultat bool

Length public_oe property

Number of bits the simple fields of a variable of this type consume in the flow vector.
public int Length
Résultat int

Offset public_oe property

This is only used by sub-structs.
public int Offset
Résultat int

SubStructInfo public_oe property

If this is a struct, all fields which are structs theirselves.
public TypeInfo[] SubStructInfo
Résultat TypeInfo[]

TotalLength public_oe property

Total number of bits a variable of this type consumes in the flow vector.
public int TotalLength
Résultat int