C# Class Microsoft.Cci.MutableContracts.IteratorContracts

This entire class (file) should go away when iterators are always decompiled. But if they aren't then this class finds the MoveNext method and gets any contracts that the original iterator method had, but which the compiler put into the first state of the MoveNext state machine.
Show file Open project: visualmutator/visualmutator

Public Methods

Method Description
FindClosureGetEnumerator ( IMetadataHost host, INestedTypeDefinition closureClass ) : ISourceMethodBody

FindClosureMoveNext ( IMetadataHost host, ISourceMethodBody possibleIterator ) : IMethodBody

For an iterator method, find the closure class' MoveNext method and return its body.

GetMethodContractFromMoveNext ( IContractAwareHost host, ContractExtractor extractor, ISourceMethodBody iteratorMethodBody, ISourceMethodBody moveNextBody, PdbReader pdbReader ) : MethodContract

Private Methods

Method Description
FirstStatementIsIteratorCreation ( IMetadataHost host, ISourceMethodBody possibleIterator, INameTable nameTable, IStatement statement ) : IMethodBody
GetICreateObjectInstance ( IStatement statement ) : ICreateObjectInstance

Method Details

FindClosureGetEnumerator() public static method

public static FindClosureGetEnumerator ( IMetadataHost host, INestedTypeDefinition closureClass ) : ISourceMethodBody
host IMetadataHost
closureClass INestedTypeDefinition
return ISourceMethodBody

FindClosureMoveNext() public static method

For an iterator method, find the closure class' MoveNext method and return its body.
public static FindClosureMoveNext ( IMetadataHost host, ISourceMethodBody possibleIterator ) : IMethodBody
host IMetadataHost
possibleIterator ISourceMethodBody The (potential) iterator method.
return IMethodBody

GetMethodContractFromMoveNext() public static method

public static GetMethodContractFromMoveNext ( IContractAwareHost host, ContractExtractor extractor, ISourceMethodBody iteratorMethodBody, ISourceMethodBody moveNextBody, PdbReader pdbReader ) : MethodContract
host IContractAwareHost
extractor ContractExtractor
iteratorMethodBody ISourceMethodBody
moveNextBody ISourceMethodBody
pdbReader PdbReader
return MethodContract