Ejemplo n.º 1
0
        public PrivateImplementationDetails GetPrivateImplClass(TGreenNode syntaxNodeOpt, DiagnosticBag diagnostics)
        {
            var result = _privateImplementationDetails;

            if ((result == null) && this.SupportsPrivateImplClass)
            {
                result = new PrivateImplementationDetails(
                    this,
                    this.SourceModule.Name,
                    /*Compilation.GetSubmissionSlotIndex()*/ -1,
                    this.GetSpecialType(SpecialType.System_Object, syntaxNodeOpt, diagnostics),
                    this.GetSpecialType(SpecialType.System_ValueType, syntaxNodeOpt, diagnostics),
                    this.GetSpecialType(SpecialType.System_Byte, syntaxNodeOpt, diagnostics),
                    this.GetSpecialType(SpecialType.System_Int16, syntaxNodeOpt, diagnostics),
                    this.GetSpecialType(SpecialType.System_Int32, syntaxNodeOpt, diagnostics),
                    this.GetSpecialType(SpecialType.System_Int64, syntaxNodeOpt, diagnostics),
                    SynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));

                if (Interlocked.CompareExchange(ref _privateImplementationDetails, result, null) != null)
                {
                    result = _privateImplementationDetails;
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
 private void EnsurePrivateImplementationDetailsStaticConstructor(PrivateImplementationDetails details, TGreenNode syntaxOpt, DiagnosticBag diagnostics)
 {
     if (details.GetMethod(WellKnownMemberNames.StaticConstructorName) == null)
     {
         details.TryAddSynthesizedMethod(CreatePrivateImplementationDetailsStaticConstructor(details, syntaxOpt, diagnostics));
     }
 }
Ejemplo n.º 3
0
        public IFieldReference GetInstrumentationPayloadRoot(int analysisKind, ITypeReference payloadType, TGreenNode syntaxOpt, DiagnosticBag diagnostics)
        {
            PrivateImplementationDetails details = GetPrivateImplClass(syntaxOpt, diagnostics);

            EnsurePrivateImplementationDetailsStaticConstructor(details, syntaxOpt, diagnostics);

            return(details.GetOrAddInstrumentationPayloadRoot(analysisKind, payloadType));
        }
Ejemplo n.º 4
0
        public IFieldReference GetModuleVersionId(ITypeReference mvidType, TGreenNode syntaxOpt, DiagnosticBag diagnostics)
        {
            PrivateImplementationDetails details = GetPrivateImplClass(syntaxOpt, diagnostics);

            EnsurePrivateImplementationDetailsStaticConstructor(details, syntaxOpt, diagnostics);

            return(details.GetModuleVersionId(mvidType));
        }
Ejemplo n.º 5
0
 protected abstract IMethodDefinition CreatePrivateImplementationDetailsStaticConstructor(PrivateImplementationDetails details, TGreenNode syntaxOpt, DiagnosticBag diagnostics);
Ejemplo n.º 6
0
 internal ExplicitSizeStruct(uint size, PrivateImplementationDetails containingType, ITypeReference sysValueType)
 {
     _size           = size;
     _containingType = containingType;
     _sysValueType   = sysValueType;
 }