/// <summary> /// A rewriter for method bodies that inlines calls to methods identified by the rewriter client via a call back. /// </summary> /// <param name="host">An object representing the application that is hosting this mutator. It is used to obtain access to some global /// objects and services such as the shared name table and the table for interning references.</param> /// <param name="inlineSelector"> /// Returns zero or more method definitions that should be inlined at a given call site. Zero methods means no inlining. For non virtual calls, one method means that the call /// should be inlined. For virtual calls, one or methods means that the call site should do call site type tests to avoid virtual calls for the returned methods. /// A subsequent call to ShouldInline, using one of the method definitions as the methodBeingCalled parameter can be used to determine if the call following the type test /// should be inline or not. /// </param> /// <param name="sourceLocationProvider">An object that can map some kinds of ILocation objects to IPrimarySourceLocation objects. May be null.</param> /// <param name="localScopeProvider">An object that can provide information about the local scopes of a method. May be null.</param> public Inliner(IMetadataHost host, ShouldInline inlineSelector, ILocalScopeProvider/*?*/ localScopeProvider, ISourceLocationProvider/*?*/ sourceLocationProvider) : base(host, localScopeProvider, sourceLocationProvider) { Contract.Requires(host != null); Contract.Requires(inlineSelector != null); this.inlineSelector = inlineSelector; this.method = Dummy.MethodDefinition; }
/// <summary> /// A rewriter for method bodies that inlines calls to methods identified by the rewriter client via a call back. /// </summary> /// <param name="host">An object representing the application that is hosting this mutator. It is used to obtain access to some global /// objects and services such as the shared name table and the table for interning references.</param> /// <param name="inlineSelector"> /// Returns zero or more method definitions that should be inlined at a given call site. Zero methods means no inlining. For non virtual calls, one method means that the call /// should be inlined. For virtual calls, one or methods means that the call site should do call site type tests to avoid virtual calls for the returned methods. /// A subsequent call to ShouldInline, using one of the method definitions as the methodBeingCalled parameter can be used to determine if the call following the type test /// should be inline or not. /// </param> /// <param name="sourceLocationProvider">An object that can map some kinds of ILocation objects to IPrimarySourceLocation objects. May be null.</param> /// <param name="localScopeProvider">An object that can provide information about the local scopes of a method. May be null.</param> public Inliner(IMetadataHost host, ShouldInline inlineSelector, ILocalScopeProvider /*?*/ localScopeProvider, ISourceLocationProvider /*?*/ sourceLocationProvider) : base(host, localScopeProvider, sourceLocationProvider) { Contract.Requires(host != null); Contract.Requires(inlineSelector != null); this.inlineSelector = inlineSelector; this.method = Dummy.MethodDefinition; }