C# Class Pchp.CodeAnalysis.Emit.PEModuleBuilder

Inheritance: CommonPEModuleBuilder, Microsoft.Cci.IModule, ITokenDeferral
Show file Open project: iolevel/peachpie Class Usage Examples

Protected Properties

Property Type Description
AssemblyOrModuleSymbolToModuleRefMap Cci.IModuleReference>.ConcurrentDictionary

Private Properties

Property Type Description
AddTopLevelType void
Cci Microsoft.Cci.IAssemblyReference
CompilationFinished void
CreateConstant Microsoft.CodeAnalysis.CodeGen.MetadataConstant
CreateEntryPoint void
CreateEnumerateConstantsSymbol void
CreateEnumerateReferencedFunctions void
CreateEnumerateScriptsSymbol void
CreateMainMethodWrapper void
EncTranslateType Microsoft.Cci.ITypeReference
GetAnonymousTypes ImmutableArray
GetCorLibraryReferencesToEmit IEnumerable
GetMethodBody Microsoft.Cci.IMethodBody
GetOrAddDebugDocument Microsoft.Cci.DebugSourceDocument
GetPrivateImplClass Microsoft.CodeAnalysis.CodeGen.PrivateImplementationDetails
GetSpecialType Microsoft.Cci.INamedTypeReference
GetSynthesizedMembers ImmutableArray>.ImmutableDictionary
GetTopLevelTypesCore IEnumerable
IsSourceDefinition bool
NormalizeDebugDocumentPath string
SetDebugEntryPoint void
SetPEEntryPoint void
Translate Microsoft.Cci.IArrayTypeReference
Translate Microsoft.Cci.IAssemblyReference
Translate Microsoft.Cci.IGenericParameterReference
Translate Microsoft.Cci.IMethodReference
Translate Microsoft.Cci.IMethodReference
Translate Microsoft.Cci.ITypeReference
Translate Microsoft.Cci.ITypeReference
Translate ImmutableArray
TranslateOverriddenMethodReference Microsoft.Cci.IMethodReference
ValidateReferencedAssembly void
VisitTopLevelType void

Public Methods

Method Description
AsDefinition ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IDefinition
Dispatch ( Microsoft.Cci visitor ) : void
GetAssemblyReferenceAliases ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : ImmutableArray
GetAssemblyReferences ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
GetAttributes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
GetContainingAssembly ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IAssembly
GetCorLibrary ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IAssemblyReference
GetExportedTypes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
GetFakeStringTokenForIL ( string value ) : uint
GetFakeSymbolTokenForIL ( Microsoft.Cci symbol, Microsoft.CodeAnalysis.SyntaxNode syntaxNode, DiagnosticBag diagnostics ) : uint
GetFieldForData ( ImmutableArray data, Microsoft.CodeAnalysis.SyntaxNode syntaxNode, DiagnosticBag diagnostics ) : Microsoft.Cci.IFieldReference
GetImports ( ) : ImmutableArray
GetInitArrayHelper ( ) : Microsoft.Cci.IMethodReference
GetPlatformType ( Microsoft.Cci t, Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.ITypeReference
GetReferenceFromToken ( uint token ) : Microsoft.Cci.IReference
GetResources ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
GetStaticCtorBuilder ( NamedTypeSymbol container ) : ILBuilder

Gets IL builder for lazy static constructor.

GetStringFromToken ( uint token ) : string
GetStrings ( ) : IEnumerable
GetSymbolToLocationMap ( ) : Cci.DefinitionWithLocation>.MultiDictionary
GetSynthesizedFields ( TypeSymbol container ) : IEnumerable

Gets enumeration of synthesized fields for container.

GetSynthesizedMethods ( TypeSymbol container ) : IEnumerable

Gets enumeration of synthesized methods for container.

GetSynthesizedTypes ( TypeSymbol container ) : IEnumerable

Gets enumeration of synthesized nested types for container.

GetTopLevelTypes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
IsGenericType ( INamedTypeSymbol toCheck ) : bool
IsPlatformType ( Microsoft.Cci typeRef, Microsoft.Cci platformType ) : bool
MemberVisibility ( Symbol symbol ) : Microsoft.Cci.TypeMemberVisibility
RealizeStaticCtors ( ) : void

Any lazily emitted static constructor will be realized and its body saved to method map.

ReferencesInIL ( int &count ) : IEnumerable
SetMethodBody ( IMethodSymbol methodSymbol, Microsoft.Cci body ) : void

Protected Methods

Method Description
AddEmbeddedResourcesFromAddedModules ( ArrayBuilder builder, DiagnosticBag diagnostics ) : void
GetAssemblyReferencesFromAddedModules ( DiagnosticBag diagnostics ) : IEnumerable
PEModuleBuilder ( PhpCompilation compilation, SourceModuleSymbol sourceModule, Microsoft.Cci serializationProperties, IEnumerable manifestResources, OutputKind outputKind, EmitOptions emitOptions ) : System

Private Methods

Method Description
AddTopLevelType ( HashSet names, Microsoft.Cci type ) : void
Cci ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IAssemblyReference
CompilationFinished ( ) : void
CreateConstant ( ITypeSymbol type, object value, Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics ) : Microsoft.CodeAnalysis.CodeGen.MetadataConstant
CreateEntryPoint ( MethodSymbol method, DiagnosticBag diagnostic ) : void

Create real CIL entry point, where it calls given method.

CreateEnumerateConstantsSymbol ( DiagnosticBag diagnostic ) : void

Emit body of enumeration of app-wide global constants.

CreateEnumerateReferencedFunctions ( DiagnosticBag diagnostic ) : void

Emit body of enumeration of referenced functions.

CreateEnumerateScriptsSymbol ( DiagnosticBag diagnostic ) : void

Emit body of enumeration of scripts Main function.

CreateMainMethodWrapper ( MethodSymbol wrapper, MethodSymbol main, DiagnosticBag diagnostic ) : void

Emits body of scripts main wrapper converting main result to PhpValue.

EncTranslateType ( ITypeSymbol type, DiagnosticBag diagnostics ) : Microsoft.Cci.ITypeReference
GetAnonymousTypes ( ) : ImmutableArray
GetCorLibraryReferencesToEmit ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
GetMethodBody ( IMethodSymbol methodSymbol ) : Microsoft.Cci.IMethodBody
GetOrAddDebugDocument ( string path, string basePath, Cci.DebugSourceDocument>.Func factory ) : Microsoft.Cci.DebugSourceDocument
GetPrivateImplClass ( Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics ) : Microsoft.CodeAnalysis.CodeGen.PrivateImplementationDetails
GetSpecialType ( SpecialType specialType, Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics ) : Microsoft.Cci.INamedTypeReference
GetSynthesizedMembers ( ) : ImmutableArray>.ImmutableDictionary
GetTopLevelTypesCore ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
IsSourceDefinition ( IMethodSymbol method ) : bool
NormalizeDebugDocumentPath ( string path, string basePath ) : string
SetDebugEntryPoint ( IMethodSymbol method, DiagnosticBag diagnostics ) : void
SetPEEntryPoint ( IMethodSymbol method, DiagnosticBag diagnostics ) : void
Translate ( ArrayTypeSymbol symbol ) : Microsoft.Cci.IArrayTypeReference
Translate ( IAssemblySymbol iassembly, DiagnosticBag diagnostics ) : Microsoft.Cci.IAssemblyReference
Translate ( TypeParameterSymbol param ) : Microsoft.Cci.IGenericParameterReference
Translate ( IMethodSymbol symbol, DiagnosticBag diagnostics, bool needDeclaration ) : Microsoft.Cci.IMethodReference
Translate ( MethodSymbol methodSymbol, Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics, bool needDeclaration ) : Microsoft.Cci.IMethodReference
Translate ( ITypeSymbol typeSymbol, Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics ) : Microsoft.Cci.ITypeReference
Translate ( NamedTypeSymbol namedTypeSymbol, Microsoft.CodeAnalysis.SyntaxNode syntaxOpt, DiagnosticBag diagnostics, bool fromImplements = false, bool needDeclaration = false ) : Microsoft.Cci.ITypeReference
Translate ( ImmutableArray @params ) : ImmutableArray
TranslateOverriddenMethodReference ( MethodSymbol methodSymbol, Microsoft.CodeAnalysis.SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics ) : Microsoft.Cci.IMethodReference
ValidateReferencedAssembly ( AssemblySymbol assembly, AssemblyReference asmRef, DiagnosticBag diagnostics ) : void
VisitTopLevelType ( Microsoft.Cci noPiaIndexer, Microsoft.Cci type ) : void

Method Details

AddEmbeddedResourcesFromAddedModules() protected method

protected AddEmbeddedResourcesFromAddedModules ( ArrayBuilder builder, DiagnosticBag diagnostics ) : void
builder ArrayBuilder
diagnostics DiagnosticBag
return void

AsDefinition() public method

public AsDefinition ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IDefinition
context Microsoft.CodeAnalysis.Emit.EmitContext
return Microsoft.Cci.IDefinition

Dispatch() public method

public Dispatch ( Microsoft.Cci visitor ) : void
visitor Microsoft.Cci
return void

GetAssemblyReferenceAliases() public method

public GetAssemblyReferenceAliases ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : ImmutableArray
context Microsoft.CodeAnalysis.Emit.EmitContext
return ImmutableArray

GetAssemblyReferences() public method

public GetAssemblyReferences ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
context Microsoft.CodeAnalysis.Emit.EmitContext
return IEnumerable

GetAssemblyReferencesFromAddedModules() protected method

protected GetAssemblyReferencesFromAddedModules ( DiagnosticBag diagnostics ) : IEnumerable
diagnostics DiagnosticBag
return IEnumerable

GetAttributes() public method

public GetAttributes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
context Microsoft.CodeAnalysis.Emit.EmitContext
return IEnumerable

GetContainingAssembly() public method

public GetContainingAssembly ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IAssembly
context Microsoft.CodeAnalysis.Emit.EmitContext
return Microsoft.Cci.IAssembly

GetCorLibrary() public method

public GetCorLibrary ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.IAssemblyReference
context Microsoft.CodeAnalysis.Emit.EmitContext
return Microsoft.Cci.IAssemblyReference

GetExportedTypes() public method

public GetExportedTypes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
context Microsoft.CodeAnalysis.Emit.EmitContext
return IEnumerable

GetFakeStringTokenForIL() public method

public GetFakeStringTokenForIL ( string value ) : uint
value string
return uint

GetFakeSymbolTokenForIL() public method

public GetFakeSymbolTokenForIL ( Microsoft.Cci symbol, Microsoft.CodeAnalysis.SyntaxNode syntaxNode, DiagnosticBag diagnostics ) : uint
symbol Microsoft.Cci
syntaxNode Microsoft.CodeAnalysis.SyntaxNode
diagnostics DiagnosticBag
return uint

GetFieldForData() public method

public GetFieldForData ( ImmutableArray data, Microsoft.CodeAnalysis.SyntaxNode syntaxNode, DiagnosticBag diagnostics ) : Microsoft.Cci.IFieldReference
data ImmutableArray
syntaxNode Microsoft.CodeAnalysis.SyntaxNode
diagnostics DiagnosticBag
return Microsoft.Cci.IFieldReference

GetImports() public method

public GetImports ( ) : ImmutableArray
return ImmutableArray

GetInitArrayHelper() public method

public GetInitArrayHelper ( ) : Microsoft.Cci.IMethodReference
return Microsoft.Cci.IMethodReference

GetPlatformType() public method

public GetPlatformType ( Microsoft.Cci t, Microsoft.CodeAnalysis.Emit.EmitContext context ) : Microsoft.Cci.ITypeReference
t Microsoft.Cci
context Microsoft.CodeAnalysis.Emit.EmitContext
return Microsoft.Cci.ITypeReference

GetReferenceFromToken() public method

public GetReferenceFromToken ( uint token ) : Microsoft.Cci.IReference
token uint
return Microsoft.Cci.IReference

GetResources() public method

public GetResources ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
context Microsoft.CodeAnalysis.Emit.EmitContext
return IEnumerable

GetStaticCtorBuilder() public method

Gets IL builder for lazy static constructor.
public GetStaticCtorBuilder ( NamedTypeSymbol container ) : ILBuilder
container Pchp.CodeAnalysis.Symbols.NamedTypeSymbol
return Microsoft.CodeAnalysis.CodeGen.ILBuilder

GetStringFromToken() public method

public GetStringFromToken ( uint token ) : string
token uint
return string

GetStrings() public method

public GetStrings ( ) : IEnumerable
return IEnumerable

GetSymbolToLocationMap() public method

public GetSymbolToLocationMap ( ) : Cci.DefinitionWithLocation>.MultiDictionary
return Cci.DefinitionWithLocation>.MultiDictionary

GetSynthesizedFields() public method

Gets enumeration of synthesized fields for container.
public GetSynthesizedFields ( TypeSymbol container ) : IEnumerable
container TypeSymbol Containing type symbol.
return IEnumerable

GetSynthesizedMethods() public method

Gets enumeration of synthesized methods for container.
public GetSynthesizedMethods ( TypeSymbol container ) : IEnumerable
container TypeSymbol Containing type symbol.
return IEnumerable

GetSynthesizedTypes() public method

Gets enumeration of synthesized nested types for container.
public GetSynthesizedTypes ( TypeSymbol container ) : IEnumerable
container TypeSymbol Containing type symbol.
return IEnumerable

GetTopLevelTypes() public method

public GetTopLevelTypes ( Microsoft.CodeAnalysis.Emit.EmitContext context ) : IEnumerable
context Microsoft.CodeAnalysis.Emit.EmitContext
return IEnumerable

IsGenericType() public static method

public static IsGenericType ( INamedTypeSymbol toCheck ) : bool
toCheck INamedTypeSymbol
return bool

IsPlatformType() public method

public IsPlatformType ( Microsoft.Cci typeRef, Microsoft.Cci platformType ) : bool
typeRef Microsoft.Cci
platformType Microsoft.Cci
return bool

MemberVisibility() public static method

public static MemberVisibility ( Symbol symbol ) : Microsoft.Cci.TypeMemberVisibility
symbol Symbol
return Microsoft.Cci.TypeMemberVisibility

PEModuleBuilder() protected method

protected PEModuleBuilder ( PhpCompilation compilation, SourceModuleSymbol sourceModule, Microsoft.Cci serializationProperties, IEnumerable manifestResources, OutputKind outputKind, EmitOptions emitOptions ) : System
compilation PhpCompilation
sourceModule Pchp.CodeAnalysis.Symbols.SourceModuleSymbol
serializationProperties Microsoft.Cci
manifestResources IEnumerable
outputKind OutputKind
emitOptions EmitOptions
return System

RealizeStaticCtors() public method

Any lazily emitted static constructor will be realized and its body saved to method map.
public RealizeStaticCtors ( ) : void
return void

ReferencesInIL() public method

public ReferencesInIL ( int &count ) : IEnumerable
count int
return IEnumerable

SetMethodBody() public method

public SetMethodBody ( IMethodSymbol methodSymbol, Microsoft.Cci body ) : void
methodSymbol IMethodSymbol
body Microsoft.Cci
return void

Property Details

AssemblyOrModuleSymbolToModuleRefMap protected property

protected ConcurrentDictionary AssemblyOrModuleSymbolToModuleRefMap
return Cci.IModuleReference>.ConcurrentDictionary