public EmitContext(CommonPEModuleBuilder module, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics, bool metadataOnly, bool includePrivateMembers) { Debug.Assert(module != null); Debug.Assert(diagnostics != null); Debug.Assert(includePrivateMembers || metadataOnly); Module = module; SyntaxNodeOpt = syntaxNodeOpt; Diagnostics = diagnostics; Flags flags = Flags.None; if (metadataOnly) { flags |= Flags.MetadataOnly; } if (includePrivateMembers) { flags |= Flags.IncludePrivateMembers; } _flags = flags; }
public EmitBaseline MapBaselineToCompilation( EmitBaseline baseline, Compilation targetCompilation, CommonPEModuleBuilder targetModuleBuilder, ImmutableDictionary <Cci.ITypeDefinition, ImmutableArray <Cci.ITypeDefinitionMember> > mappedSynthesizedMembers) { // Map all definitions to this compilation. var typesAdded = MapDefinitions(baseline.TypesAdded); var eventsAdded = MapDefinitions(baseline.EventsAdded); var fieldsAdded = MapDefinitions(baseline.FieldsAdded); var methodsAdded = MapDefinitions(baseline.MethodsAdded); var propertiesAdded = MapDefinitions(baseline.PropertiesAdded); return(baseline.With( targetCompilation, targetModuleBuilder, baseline.Ordinal, baseline.EncId, typesAdded, eventsAdded, fieldsAdded, methodsAdded, propertiesAdded, eventMapAdded: baseline.EventMapAdded, propertyMapAdded: baseline.PropertyMapAdded, methodImplsAdded: baseline.MethodImplsAdded, tableEntriesAdded: baseline.TableEntriesAdded, blobStreamLengthAdded: baseline.BlobStreamLengthAdded, stringStreamLengthAdded: baseline.StringStreamLengthAdded, userStringStreamLengthAdded: baseline.UserStringStreamLengthAdded, guidStreamLengthAdded: baseline.GuidStreamLengthAdded, anonymousTypeMap: MapAnonymousTypes(baseline.AnonymousTypeMap), synthesizedMembers: mappedSynthesizedMembers, addedOrChangedMethods: MapAddedOrChangedMethods(baseline.AddedOrChangedMethods), debugInformationProvider: baseline.DebugInformationProvider, localSignatureProvider: baseline.LocalSignatureProvider)); }