コード例 #1
0
        private UncommonFields CreateUncommonFields()
        {
            var retVal = new UncommonFields();

            if (!_packedFlags.IsObsoleteAttributePopulated)
            {
                retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized;
            }

            if (!_packedFlags.IsUseSiteDiagnosticPopulated)
            {
                retVal._lazyUseSiteDiagnostic = CSDiagnosticInfo.EmptyErrorInfo; // Indicates unknown state.
            }

            if (_packedFlags.IsCustomAttributesPopulated)
            {
                retVal._lazyCustomAttributes = ImmutableArray <CSharpAttributeData> .Empty;
            }

            if (_packedFlags.IsConditionalPopulated)
            {
                retVal._lazyConditionalAttributeSymbols = ImmutableArray <string> .Empty;
            }

            if (_packedFlags.IsOverriddenOrHiddenMembersPopulated)
            {
                retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty;
            }

            return(retVal);
        }
コード例 #2
0
ファイル: PEMethodSymbol.cs プロジェクト: linuxemb/roslyn
        private UncommonFields CreateUncommonFields()
        {
            var retVal = new UncommonFields();

            if (!_packedFlags.IsObsoleteAttributePopulated)
            {
                retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized;
            }

            //
            // Do not set _lazyUseSiteDiagnostic !!!!
            //
            // "null" Indicates "no errors" or "unknown state",
            // and we know which one of the states we have from IsUseSiteDiagnosticPopulated
            //
            // Setting _lazyUseSiteDiagnostic to a sentinel value here would introduce
            // a number of extra states for various permutations of IsUseSiteDiagnosticPopulated, UncommonFields and _lazyUseSiteDiagnostic
            // Some of them, in tight races, may lead to returning the sentinel as the diagnostics.
            //

            if (_packedFlags.IsCustomAttributesPopulated)
            {
                retVal._lazyCustomAttributes = ImmutableArray <CSharpAttributeData> .Empty;
            }

            if (_packedFlags.IsConditionalPopulated)
            {
                retVal._lazyConditionalAttributeSymbols = ImmutableArray <string> .Empty;
            }

            if (_packedFlags.IsOverriddenOrHiddenMembersPopulated)
            {
                retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty;
            }

            return(retVal);
        }
コード例 #3
0
ファイル: PEMethodSymbol.cs プロジェクト: GuilhermeSa/roslyn
        private UncommonFields CreateUncommonFields()
        {
            var retVal = new UncommonFields();
            if (!_packedFlags.IsObsoleteAttributePopulated)
            {
                retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized;
            }

            if (!_packedFlags.IsUseSiteDiagnosticPopulated)
            {
                retVal._lazyUseSiteDiagnostic = CSDiagnosticInfo.EmptyErrorInfo; // Indicates unknown state.
            }

            if (_packedFlags.IsCustomAttributesPopulated)
            {
                retVal._lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty;
            }

            if (_packedFlags.IsConditionalPopulated)
            {
                retVal._lazyConditionalAttributeSymbols = ImmutableArray<string>.Empty;
            }

            if (_packedFlags.IsOverriddenOrHiddenMembersPopulated)
            {
                retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty;
            }

            return retVal;
        }