2 types derived from CSharpAttributeData
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Attributes\PEAttributeData.cs (1)
17internal sealed class PEAttributeData : CSharpAttributeData
Symbols\Attributes\SourceAttributeData.cs (1)
18internal class SourceAttributeData : CSharpAttributeData
603 references to CSharpAttributeData
Microsoft.CodeAnalysis.CSharp (400)
Binder\Binder_Attributes.cs (3)
76CSharpAttributeData?[] attributeDataArray, 127internal (CSharpAttributeData, BoundAttribute) GetAttribute( 273private CSharpAttributeData GetAttribute(BoundAttribute boundAttribute, BindingDiagnosticBag diagnostics)
Binder\EarlyWellKnownAttributeBinder.cs (2)
26internal (CSharpAttributeData, BoundAttribute) GetAttribute( 42internal new (CSharpAttributeData, BoundAttribute) GetAttribute(
Compiler\ClsComplianceChecker.cs (8)
137foreach (CSharpAttributeData assemblyLevelAttribute in peModule.GetAssemblyAttributes()) 335foreach (CSharpAttributeData attribute in symbol.GetAttributes()) 592private void CheckForAttributeWithArrayArgumentInternal(ImmutableArray<CSharpAttributeData> attributes) 594foreach (CSharpAttributeData attribute in attributes) 648private bool TryGetAttributeWarningLocation(CSharpAttributeData attribute, out Location location) 759private bool TryGetClsComplianceAttributeLocation(ImmutableArray<CSharpAttributeData> attributes, Symbol targetSymbol, out Location attributeLocation) 761foreach (CSharpAttributeData data in attributes) 1180foreach (CSharpAttributeData data in symbol.GetAttributes())
Emitter\Model\MethodSymbolAdapter.cs (1)
509ImmutableArray<CSharpAttributeData> userDefined = AdaptedMethodSymbol.GetReturnTypeAttributes();
Emitter\Model\SourceAssemblySymbolAdapter.cs (2)
16internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder, bool emittingRefAssembly, bool emittingAssemblyAttributesInNetModule) 20ImmutableArray<CSharpAttributeData> userDefined = this.GetAttributes();
Emitter\Model\SymbolAdapter.cs (9)
84internal virtual IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 92internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder, bool emittingAssemblyAttributesInNetModule) 97ImmutableArray<CSharpAttributeData> userDefined; 111internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit( 112ImmutableArray<CSharpAttributeData> userDefined, 122return SpecializedCollections.EmptyEnumerable<CSharpAttributeData>(); 128private IEnumerable<CSharpAttributeData> GetCustomAttributesToEmitIterator( 129ImmutableArray<CSharpAttributeData> userDefined, 150CSharpAttributeData attribute = userDefined[i];
Emitter\NoPia\EmbeddedEvent.cs (2)
23protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 78foreach (var attrData in underlyingContainingType.GetAttributes())
Emitter\NoPia\EmbeddedField.cs (1)
34protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Emitter\NoPia\EmbeddedMethod.cs (1)
35protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Emitter\NoPia\EmbeddedParameter.cs (1)
39protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Emitter\NoPia\EmbeddedProperty.cs (1)
25protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Emitter\NoPia\EmbeddedType.cs (2)
244protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 249protected override CSharpAttributeData CreateTypeIdentifierAttribute(bool hasGuid, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedTypesManager.cs (5)
33EmbeddedTypesManager<PEModuleBuilder, ModuleCompilationState, EmbeddedTypesManager, SyntaxNode, CSharpAttributeData, 119internal override int GetTargetAttributeSignatureIndex(SymbolAdapter underlyingSymbol, CSharpAttributeData attrData, AttributeDescription description) 124internal override CSharpAttributeData CreateSynthesizedAttribute(WellKnownMember constructor, CSharpAttributeData attrData, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 619protected override CSharpAttributeData CreateCompilerGeneratedAttribute()
FlowAnalysis\DefiniteAssignment.cs (1)
1780private void VisitAttributes(ImmutableArray<(CSharpAttributeData, BoundAttribute)> boundAttributes)
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
28foreach (var attrData in @interface.GetAttributes())
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (7)
18private ImmutableArray<CSharpAttributeData> _attributes; 53public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 59ArrayBuilder<CSharpAttributeData> builder = null; 63foreach (var attribute in kickoffType.GetAttributes()) 70builder = ArrayBuilder<CSharpAttributeData>.GetInstance(2); // only 2 different attributes are inherited at the moment 78builder == null ? ImmutableArray<CSharpAttributeData>.Empty : builder.ToImmutableAndFree(), 79default(ImmutableArray<CSharpAttributeData>));
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (7)
63private ImmutableArray<CSharpAttributeData> _attributes; 70public override ImmutableArray<CSharpAttributeData> GetAttributes() 76ArrayBuilder<CSharpAttributeData> builder = null; 80foreach (var attribute in kickoffMethod.GetAttributes()) 89builder = ArrayBuilder<CSharpAttributeData>.GetInstance(4); // only 4 different attributes are inherited at the moment 97builder == null ? ImmutableArray<CSharpAttributeData>.Empty : builder.ToImmutableAndFree(), 98default(ImmutableArray<CSharpAttributeData>));
Lowering\SynthesizedMethodBaseSymbol.cs (4)
161public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 166: ImmutableArray<CSharpAttributeData>.Empty; 169public sealed override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 172return InheritsBaseMethodAttributes ? BaseMethod.GetReturnTypeAttributes() : ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Attributes\AttributeData.cs (7)
235internal void DecodeSecurityAttribute<T>(Symbol targetSymbol, CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 261internal static void DecodeSkipLocalsInitAttribute<T>(CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 272internal static void DecodeMemberNotNullAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 308private static void ReportBadNotNullMemberIfNeeded(TypeSymbol type, DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, string memberName) 322internal static void DecodeMemberNotNullWhenAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 812internal static int IndexOfAttribute(this ImmutableArray<CSharpAttributeData> attributes, Symbol targetSymbol, AttributeDescription description) 831internal static string? DecodeNotNullIfNotNullAttribute(this CSharpAttributeData attribute)
Symbols\Attributes\SourceAttributeData.cs (1)
94/// If the <see cref="CSharpAttributeData.ConstructorArguments"/> contains any named constructor arguments or default value arguments,
Symbols\EventSymbol.cs (2)
115public ImmutableArray<CSharpAttributeData> GetFieldAttributes() 118ImmutableArray<CSharpAttributeData>.Empty :
Symbols\Metadata\PE\PEAssemblySymbol.cs (2)
65private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 132public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Metadata\PE\PEEventSymbol.cs (3)
33private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 360public override ImmutableArray<CSharpAttributeData> GetAttributes() 370internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Metadata\PE\PEFieldSymbol.cs (4)
120private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 578public override ImmutableArray<CSharpAttributeData> GetAttributes() 605internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 607foreach (CSharpAttributeData attribute in GetAttributes())
Symbols\Metadata\PE\PEMethodSymbol.cs (8)
281public ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 318retVal._lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; 948public override ImmutableArray<CSharpAttributeData> GetAttributes() 953var attributeData = default(ImmutableArray<CSharpAttributeData>); 1023return ImmutableArray<CSharpAttributeData>.Empty; 1029? InterlockedOperations.Initialize(ref uncommonFields._lazyCustomAttributes, ImmutableArray<CSharpAttributeData>.Empty) 1034internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) => GetAttributes(); 1036public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() => Signature.ReturnParam.GetAttributes();
Symbols\Metadata\PE\PEModuleSymbol.cs (19)
86private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 91private ImmutableArray<CSharpAttributeData> _lazyAssemblyAttributes; 240public override ImmutableArray<CSharpAttributeData> GetAttributes() 249internal ImmutableArray<CSharpAttributeData> GetAssemblyAttributes() 253ArrayBuilder<CSharpAttributeData> moduleAssemblyAttributesBuilder = null; 275moduleAssemblyAttributesBuilder = new ArrayBuilder<CSharpAttributeData>(); 288(moduleAssemblyAttributesBuilder != null) ? moduleAssemblyAttributesBuilder.ToImmutableAndFree() : ImmutableArray<CSharpAttributeData>.Empty, 289default(ImmutableArray<CSharpAttributeData>)); 294internal void LoadCustomAttributes(EntityHandle token, ref ImmutableArray<CSharpAttributeData> customAttributes) 301ref ImmutableArray<CSharpAttributeData> customAttributes) 307internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 314internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 327internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 347ArrayBuilder<CSharpAttributeData> customAttributesBuilder = null; 394customAttributesBuilder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 408return ImmutableArray<CSharpAttributeData>.Empty; 414internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token) 426internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 464private ImmutableArray<CSharpAttributeData> GetCustomAttributesFilterCompilerAttributes(EntityHandle token, out bool foundExtension, out bool foundReadOnly)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (4)
135internal ImmutableArray<CSharpAttributeData> lazyCustomAttributes; 682public override ImmutableArray<CSharpAttributeData> GetAttributes() 687return ImmutableArray<CSharpAttributeData>.Empty; 726internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Metadata\PE\PEParameterSymbol.cs (11)
159private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 175private ImmutableArray<CSharpAttributeData> _lazyHiddenAttributes; 259_lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; 260_lazyHiddenAttributes = ImmutableArray<CSharpAttributeData>.Empty; 1012public override ImmutableArray<CSharpAttributeData> GetAttributes() 1043ImmutableArray<CSharpAttributeData> attributes = 1061var builder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 1077ImmutableInterlocked.InterlockedInitialize(ref _lazyHiddenAttributes, ImmutableArray<CSharpAttributeData>.Empty); 1095internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 1097foreach (CSharpAttributeData attribute in GetAttributes()) 1103foreach (CSharpAttributeData attribute in _lazyHiddenAttributes)
Symbols\Metadata\PE\PEPropertySymbol.cs (4)
38private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 636public override ImmutableArray<CSharpAttributeData> GetAttributes() 642ImmutableArray<CSharpAttributeData> attributes = containingPEModuleSymbol.GetCustomAttributesForToken( 655internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (2)
44private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 631public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\MethodSymbol.cs (2)
385public virtual ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 392return ImmutableArray<CSharpAttributeData>.Empty;
Symbols\PublicModel\MethodSymbol.cs (1)
267return _underlying.GetReturnTypeAttributes().Cast<CSharpAttributeData, AttributeData>();
Symbols\ReducedExtensionMethodSymbol.cs (1)
449public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingAssemblySymbol.cs (2)
91private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 201public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingEventSymbol.cs (2)
156public override ImmutableArray<CSharpAttributeData> GetAttributes() 161internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingFieldSymbol.cs (3)
31private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 78public override ImmutableArray<CSharpAttributeData> GetAttributes() 83internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingMethodSymbol.cs (5)
45private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 50private ImmutableArray<CSharpAttributeData> _lazyReturnTypeCustomAttributes; 211public override ImmutableArray<CSharpAttributeData> GetAttributes() 216internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 222public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
Symbols\Retargeting\RetargetingModuleSymbol.cs (2)
69private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 276public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (3)
42private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 227public override ImmutableArray<CSharpAttributeData> GetAttributes() 232internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingParameterSymbol.cs (3)
24private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 61public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 66internal sealed override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingPropertySymbol.cs (3)
32private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 216public override ImmutableArray<CSharpAttributeData> GetAttributes() 221internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (13)
344foreach (var attrData in type.GetAttributes()) 1170private ImmutableArray<CSharpAttributeData> RetargetAttributes(ImmutableArray<CSharpAttributeData> oldAttributes) 1175internal IEnumerable<CSharpAttributeData> RetargetAttributes(IEnumerable<CSharpAttributeData> attributes) 1182foreach (var attributeData in attributes) 1188private CSharpAttributeData RetargetAttributeData(CSharpAttributeData oldAttributeData) 1339internal ImmutableArray<CSharpAttributeData> GetRetargetedAttributes( 1340ImmutableArray<CSharpAttributeData> underlyingAttributes, 1341ref ImmutableArray<CSharpAttributeData> lazyCustomAttributes) 1346ImmutableArray<CSharpAttributeData> retargetedAttributes = this.RetargetAttributes(underlyingAttributes); 1348ImmutableInterlocked.InterlockedCompareExchange(ref lazyCustomAttributes, retargetedAttributes, default(ImmutableArray<CSharpAttributeData>));
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (2)
36private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 63public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (10)
21private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 71public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 81private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 117internal sealed override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 119CSharpAttributeData? attributeData; 162protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 167var attribute = arguments.Attribute; 204MarshalAsAttributeDecoder<FieldWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Field, MessageProvider.Instance); 264private void VerifyConstantValueMatches(ConstantValue attrValue, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 312internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\ImplicitNamedTypeSymbol.cs (2)
34public override ImmutableArray<CSharpAttributeData> GetAttributes() 37return ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Source\SourceAssemblySymbol.cs (46)
67private CustomAttributesBag<CSharpAttributeData> _lazySourceAttributesBag; 72private CustomAttributesBag<CSharpAttributeData> _lazyNetModuleAttributesBag; 1139private bool IsKnownAssemblyAttribute(CSharpAttributeData attribute) 1182private HashSet<CSharpAttributeData> GetUniqueSourceAssemblyAttributes() 1184ImmutableArray<CSharpAttributeData> appliedSourceAttributes = this.GetSourceAttributesBag().Attributes; 1186HashSet<CSharpAttributeData> uniqueAttributes = null; 1190CSharpAttributeData attribute = appliedSourceAttributes[i]; 1203private static bool AddUniqueAssemblyAttribute(CSharpAttributeData attribute, ref HashSet<CSharpAttributeData> uniqueAttributes) 1209uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1215private bool ValidateAttributeUsageForNetModuleAttribute(CSharpAttributeData attribute, string netModuleName, BindingDiagnosticBag diagnostics, ref HashSet<CSharpAttributeData> uniqueAttributes) 1274private ImmutableArray<CSharpAttributeData> GetNetModuleAttributes(out ImmutableArray<string> netModuleNames) 1276ArrayBuilder<CSharpAttributeData> moduleAssemblyAttributesBuilder = null; 1283foreach (var attributeData in peModuleSymbol.GetAssemblyAttributes()) 1288moduleAssemblyAttributesBuilder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 1299return ImmutableArray<CSharpAttributeData>.Empty; 1307ImmutableArray<CSharpAttributeData> attributesFromNetModules, 1319HashSet<CSharpAttributeData> uniqueAttributes = GetUniqueSourceAssemblyAttributes(); 1321var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 1333CSharpAttributeData attribute = attributesFromNetModules[i]; 1353private void LoadAndValidateNetModuleAttributes(ref CustomAttributesBag<CSharpAttributeData> lazyNetModuleAttributesBag) 1357Interlocked.CompareExchange(ref lazyNetModuleAttributesBag, CustomAttributesBag<CSharpAttributeData>.Empty, null); 1364ImmutableArray<CSharpAttributeData> attributesFromNetModules = GetNetModuleAttributes(out netModuleNames); 1422CustomAttributesBag<CSharpAttributeData> netModuleAttributesBag; 1426netModuleAttributesBag = new CustomAttributesBag<CSharpAttributeData>(); 1431if (netModuleAttributesBag.IsEmpty) netModuleAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 1435netModuleAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 1461ImmutableArray<CSharpAttributeData> attributesFromNetModules = GetNetModuleAttributes(out netModuleNames); 1474WellKnownAttributeData limitedDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> attributesFromNetModules, 1483HashSet<CSharpAttributeData> uniqueAttributes = null; 1490CSharpAttributeData attribute = attributesFromNetModules[i]; 1502void limitedDecodeWellKnownAttribute(CSharpAttributeData attribute, QuickAttributes attributeMatches, ref CommonAssemblyWellKnownAttributeData result) 1525private CustomAttributesBag<CSharpAttributeData> GetNetModuleAttributesBag() 1572private CustomAttributesBag<CSharpAttributeData> GetSourceAttributesBag() 1586public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 1653CustomAttributesBag<CSharpAttributeData>? attributesBag = _lazySourceAttributesBag; 1701CustomAttributesBag<CSharpAttributeData> attributesBag = _lazySourceAttributesBag; 1770private static IEnumerable<Cci.SecurityAttribute> GetSecurityAttributes(CustomAttributesBag<CSharpAttributeData> attributesBag) 1780foreach (var securityAttribute in securityData.GetSecurityAttributes<CSharpAttributeData>(attributesBag.Attributes)) 2176private void DecodeTypeForwardedToAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2244CSharpAttributeData attrData, 2332protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2337private void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, int index, bool isFromNetModule) 2339var attribute = arguments.Attribute; 2549private static void ValidateIntegralAttributeNonNegativeArguments(CSharpAttributeData attribute, AttributeSyntax nodeOpt, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceClonedParameterSymbol.cs (1)
108public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceComplexParameterSymbol.cs (27)
36private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 571internal sealed override CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 605public ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindParameterAttributes() 616if (CSharpAttributeData.IsTargetEarlyAttribute(attributeType, attributeSyntax, AttributeDescription.OptionalAttribute)) 633internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 635if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DefaultParameterValueAttribute)) 639else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DecimalConstantAttribute)) 643else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DateTimeConstantAttribute)) 647else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.UnscopedRefAttribute)) 656if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerLineNumberAttribute)) 660else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerFilePathAttribute)) 664else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerMemberNameAttribute)) 668else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerArgumentExpressionAttribute)) 697private (CSharpAttributeData?, BoundAttribute?) EarlyDecodeAttributeForDefaultParameterValue(AttributeDescription description, ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 726protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 730var attribute = arguments.Attribute; 776MarshalAsAttributeDecoder<ParameterWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Parameter, MessageProvider.Instance); 872private static bool? DecodeMaybeNullWhenOrNotNullWhenOrDoesNotReturnIfAttribute(CSharpAttributeData attribute) 880private void DecodeDefaultParameterValueAttribute(AttributeDescription description, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 882var attribute = arguments.Attribute; 916private ConstantValue DecodeDefaultParameterValueAttribute(AttributeDescription description, CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 935private ConstantValue DecodeDefaultParameterValueAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 1147private void ValidateCallerArgumentExpressionAttribute(AttributeSyntax node, CSharpAttributeData attribute, BindingDiagnosticBag diagnostics) 1230private void DecodeInterpolatedStringHandlerArgumentAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, BindingDiagnosticBag diagnostics, int attributeIndex) 1315(int Ordinal, ParameterSymbol? Parameter)? decodeName(TypedConstant constant, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1372static void setInterpolatedStringHandlerAttributeError(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1379internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceConstructorSymbolBase.cs (2)
255internal sealed override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 259if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.SetsRequiredMembersAttribute))
Symbols\Source\SourceEventSymbol.cs (8)
34private CustomAttributesBag<CSharpAttributeData>? _lazyCustomAttributesBag; 183private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 205public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 245internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 247CSharpAttributeData? attributeData; 288protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 290var attribute = arguments.Attribute; 308CSharpAttributeData.DecodeSkipLocalsInitAttribute<CommonEventWellKnownAttributeData>(DeclaringCompilation, ref arguments);
Symbols\Source\SourceFieldSymbol.cs (2)
113protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 118var attribute = arguments.Attribute;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
131internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (31)
25private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 26private CustomAttributesBag<CSharpAttributeData> _lazyReturnTypeCustomAttributesBag; 238private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 255private CustomAttributesBag<CSharpAttributeData> GetReturnTypeAttributesBag() 266private CustomAttributesBag<CSharpAttributeData> GetAttributesBag(ref CustomAttributesBag<CSharpAttributeData> lazyCustomAttributesBag, bool forReturnType) 308public override ImmutableArray<CSharpAttributeData> GetAttributes() 317public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 323internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 331if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ConditionalAttribute)) 346else if (EarlyDecodeDeprecatedOrExperimentalOrObsoleteAttribute(ref arguments, out CSharpAttributeData? attributeData, out BoundAttribute? boundAttribute, out ObsoleteAttributeData? obsoleteData)) 355else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.UnmanagedCallersOnlyAttribute)) 371public ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindMethodAttributes() 479protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 494private void DecodeWellKnownAttributeAppliedToMethod(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 498var attribute = arguments.Attribute; 508AttributeData.DecodeMethodImplAttribute<MethodWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(ref arguments, MessageProvider.Instance); 558CSharpAttributeData.DecodeSkipLocalsInitAttribute<MethodWellKnownAttributeData>(DeclaringCompilation, ref arguments); 567CSharpAttributeData.DecodeMemberNotNullAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 572CSharpAttributeData.DecodeMemberNotNullWhenAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 627ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, 654private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 719private void DecodeWellKnownAttributeAppliedToReturnValue(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 723var attribute = arguments.Attribute; 730MarshalAsAttributeDecoder<ReturnTypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.ReturnValue, MessageProvider.Instance); 757private void DecodeDllImportAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 761var attribute = arguments.Attribute; 883private void DecodeModuleInitializerAttribute(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 932private void DecodeUnmanagedCallersOnlyAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 988static UnmanagedCallersOnlyAttributeData DecodeUnmanagedCallersOnlyAttributeData(SourceMethodSymbolWithAttributes @this, CSharpAttributeData attribute, Location location, BindingDiagnosticBag diagnostics) 1018internal sealed override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceModuleSymbol.cs (7)
43private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 309foreach (var attrData in a.GetAttributes()) 460private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 483public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 505protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 509var attribute = arguments.Attribute; 532CSharpAttributeData.DecodeSkipLocalsInitAttribute<ModuleWellKnownAttributeData>(DeclaringCompilation, ref arguments);
Symbols\Source\SourceNamedTypeSymbol.cs (19)
40private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 838private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 860public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 900internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 903CSharpAttributeData? attributeData; 906if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ComImportAttribute)) 921if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CodeAnalysisEmbeddedAttribute)) 936if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ConditionalAttribute)) 963if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.AttributeUsageAttribute)) 995if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.InterpolatedStringHandlerAttribute)) 1054protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1059var attribute = arguments.Attribute; 1097AttributeData.DecodeStructLayoutAttribute<TypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>( 1141CSharpAttributeData.DecodeSkipLocalsInitAttribute<TypeWellKnownAttributeData>(DeclaringCompilation, ref arguments); 1212private AttributeUsageInfo DecodeAttributeUsageAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt = null) 1250private void DecodeCoClassAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1252var attribute = arguments.Attribute; 1286private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 1463internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceParameterSymbol.cs (2)
193internal abstract CustomAttributesBag<CSharpAttributeData> GetAttributesBag(); 199public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourcePropertySymbolBase.cs (14)
64private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 396CustomAttributesBag<CSharpAttributeData>? temp = null; 1049private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 1078public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 1172internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1174CSharpAttributeData? attributeData; 1188if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.IndexerNameAttribute)) 1236protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1243var attribute = arguments.Attribute; 1262CSharpAttributeData.DecodeSkipLocalsInitAttribute<PropertyWellKnownAttributeData>(DeclaringCompilation, ref arguments); 1299CSharpAttributeData.DecodeMemberNotNullAttribute<PropertyWellKnownAttributeData>(ContainingType, ref arguments); 1304CSharpAttributeData.DecodeMemberNotNullWhenAttribute<PropertyWellKnownAttributeData>(ContainingType, ref arguments); 1394internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 1406private void ValidateIndexerNameAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
121internal override CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 124return CustomAttributesBag<CSharpAttributeData>.Empty;
Symbols\Source\SourceTypeParameterSymbol.cs (6)
30private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 165public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 176internal virtual CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 193CustomAttributesBag<CSharpAttributeData> attributesBag = typeParameter.GetAttributesBag(); 421protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 426var attribute = arguments.Attribute;
Symbols\SubstitutedEventSymbol.cs (1)
54public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedFieldSymbol.cs (1)
77public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\SubstitutedMethodSymbol.cs (2)
205public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 210public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
Symbols\SubstitutedNamedTypeSymbol.cs (2)
183public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 427internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\SubstitutedPropertySymbol.cs (1)
63public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Symbol.cs (5)
1302foreach (var attrData in this.GetAttributes()) 1384internal bool ReportExplicitUseOfReservedAttributes(in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, ReservedAttributes reserved) 1386var attribute = arguments.Attribute; 1458bool reportExplicitUseOfReservedAttribute(CSharpAttributeData attribute, in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, in AttributeDescription attributeDescription)
Symbols\Symbol_Attributes.cs (29)
28public virtual ImmutableArray<CSharpAttributeData> GetAttributes() 35return ImmutableArray<CSharpAttributeData>.Empty; 142internal virtual (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 149out CSharpAttributeData? attributeData, 157if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ObsoleteAttribute)) 161else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.DeprecatedAttribute)) 165else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ExperimentalAttribute)) 214protected void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 229protected virtual void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 251internal virtual void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 292ref CustomAttributesBag<CSharpAttributeData>? lazyCustomAttributesBag, 309ImmutableArray<CSharpAttributeData> boundAttributes; 320Interlocked.CompareExchange(ref lazyCustomAttributesBag, new CustomAttributesBag<CSharpAttributeData>(), null); 346var attributeDataArray = new CSharpAttributeData[totalAttributesCount]; 384boundAttributes = ImmutableArray<CSharpAttributeData>.Empty; 387Interlocked.CompareExchange(ref lazyCustomAttributesBag, CustomAttributesBag<CSharpAttributeData>.WithEmptyData(), null); 420if (lazyCustomAttributesBag.IsEmpty) lazyCustomAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 427void removeObsoleteDiagnosticsForForwardedTypes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> attributesToBind, ref BindingDiagnosticBag diagnostics) 459CSharpAttributeData boundAttribute = boundAttributes[i]; 525protected ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindAttributes(OneOrMany<SyntaxList<AttributeListSyntax>> attributeDeclarations, Binder? rootBinder) 527var boundAttributeArrayBuilder = ArrayBuilder<(CSharpAttributeData, BoundAttribute)>.GetInstance(); 547private void RecordPresenceOfBadAttributes(ImmutableArray<CSharpAttributeData> boundAttributes) 549foreach (var attribute in boundAttributes) 749CSharpAttributeData?[] attributeDataArray, 777(CSharpAttributeData? earlyAttributeDataOpt, BoundAttribute? boundAttributeOpt) = this.EarlyDecodeWellKnownAttribute(ref arguments); 819ImmutableArray<CSharpAttributeData> boundAttributes, 831var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 838CSharpAttributeData boundAttribute = boundAttributes[i]; 866CSharpAttributeData attribute,
Symbols\SymbolExtensions.cs (1)
828foreach (var attr in symbol.GetAttributes())
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (3)
122protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 127var attribute = arguments.Attribute; 148internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Synthesized\SynthesizedParameterSymbol.cs (2)
354public override ImmutableArray<CSharpAttributeData> GetAttributes() 356return _baseParameterForAttributes?.GetAttributes() ?? ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (2)
45public override ImmutableArray<CSharpAttributeData> GetAttributes() 52return ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Tuples\TupleFieldSymbol.cs (2)
133public override ImmutableArray<CSharpAttributeData> GetAttributes() 324public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
69public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
170public override ImmutableArray<CSharpAttributeData> GetAttributes()
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (25)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
857var attribute = method.GetAttributes().Single();
CodeGen\CodeGenFunctionPointersTests.cs (9)
11618var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11646var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11699var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11756var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11788var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12015var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12148var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12176var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12206var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A");
CodeGen\CodeGenLocalFunctionTests.cs (2)
5760var attrs1 = localFn1.GetAttributes().As<CSharpAttributeData>(); 5834var attrs1 = localFn1.GetAttributes().As<CSharpAttributeData>();
Emit\EmitMetadataTests.cs (1)
1303var attribute = backingField.GetAttributes().Single();
Emit\NoPiaEmbedTypes.cs (10)
1908var interfaceType = itest28.GetAttributes("System.Runtime.InteropServices", "CoClassAttribute").Single(); 1995var interfaceType = itest28.GetAttributes("System.Runtime.InteropServices", "CoClassAttribute").Single(); 2712var interfaceType = itest29.GetAttributes("System.Runtime.InteropServices", "InterfaceTypeAttribute").Single(); 2784var interfaceType = itest29.GetAttributes("System.Runtime.InteropServices", "BestFitMappingAttribute").Single(); 2848var interfaceType = test31.GetAttributes("System", "FlagsAttribute").Single(); 2909var interfaceType = itest30.GetAttributes("System.Reflection", "DefaultMemberAttribute").Single(); 2977var attr = m1.GetAttributes("System.Runtime.InteropServices", "LCIDConversionAttribute").Single(); 3043var attr = m1.GetAttributes("System.Runtime.InteropServices", "DispIdAttribute").Single(); 3332var attr = m1.Parameters[0].GetAttributes("System.Runtime.InteropServices", "DefaultParameterValueAttribute").Single(); 3389var attr = myDelegate.GetAttributes("System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute").Single();
Emit\OptionalArgumentsTests.cs (2)
226var attribute = attributes[0]; 464var attribute = ((PEModuleSymbol)module).GetCustomAttributesForToken(field.Handle).Single();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (72)
Attributes\AttributeTests.cs (14)
349var attribute = newLibComp.SourceAssembly.GetAttributes().Single(); // GetAttributes binds all attributes 1392foreach (var a in attrs) 3491var attr = attrs.Single(); 3753var attr = attrs.First(); 3867var attr = attrs.First(); 3969var attr = attrs.First(); 4041var attr = attrs.First(); 4274var attr = attrs.First(); 4955var attr = attrs.First(); 5016var attr = attrs.First(); 5456var attr = c.GetAttributes().Single(); 5500var attr = c.GetAttributes().Single(); 5534var attribute = methodTypeParameter.GetAttributes().Single(); 10069var attribute = m.GetAttributes().Single();
Attributes\AttributeTests_Assembly.cs (9)
1039var uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1040foreach (var attr in metadataAttributes) 1084foreach (var a in attrs) 1205foreach (var a in attrs) 1284foreach (var a in attrs) 1331foreach (var a in module.ContainingAssembly.GetAttributes()) 1378foreach (var a in attrs) 1790foreach (var attr in attributes) 2128private static IEnumerable<CSharpAttributeData> GetAssemblyDescriptionAttributes(AssemblySymbol assembly)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4393var attr = ctor.Parameters.Single().GetAttributes().Single(); 4423var attr = ctor.Parameters.Single().GetAttributes()[0];
Attributes\AttributeTests_Conditional.cs (1)
139var attributesArrayBuilder = new List<ImmutableArray<CSharpAttributeData>>();
Attributes\AttributeTests_Dynamic.cs (3)
519public static void ValidateDynamicAttribute(ImmutableArray<CSharpAttributeData> attributes, bool expectedDynamicAttribute, bool[] expectedTransformFlags = null) 529var dynamicAttribute = synthesizedDynamicAttributes.Single(); 1097foreach (var attr in attrs)
Attributes\AttributeTests_IsByRefLike.cs (5)
674var attribute = type.GetAttributes().Single(); 759var attribute = type.GetAttributes().Single(); 815var attribute = attributes[0]; 1073private static void AssertNotReferencedIsByRefLikeAttribute(ImmutableArray<CSharpAttributeData> attributes) 1075foreach (var attr in attributes)
Attributes\AttributeTests_NativeInteger.cs (5)
1495var attribute = GetNativeIntegerAttribute(attributes); 1618private static void AssertNativeIntegerAttribute(ImmutableArray<CSharpAttributeData> attributes) 1623private static void AssertAttributes(ImmutableArray<CSharpAttributeData> attributes, params string[] expectedNames) 1640private static CSharpAttributeData GetNativeIntegerAttribute(ImmutableArray<CSharpAttributeData> attributes)
Attributes\AttributeTests_Nullable.cs (7)
576private static void CheckAttribute(CSharpAttributeData attribute, string assemblyName) 4999var nullable = GetNullableAttribute(attributes); 5373private static void AssertNoNullableAttribute(ImmutableArray<CSharpAttributeData> attributes) 5378private static void AssertNullableAttribute(ImmutableArray<CSharpAttributeData> attributes) 5383private static void AssertAttributes(ImmutableArray<CSharpAttributeData> attributes, params string[] expectedNames) 5401private static CSharpAttributeData GetNullableAttribute(ImmutableArray<CSharpAttributeData> attributes)
Attributes\AttributeTests_NullablePublicOnly.cs (1)
587var attribute = module.GetAttributes().SingleOrDefault();
Attributes\AttributeTests_ReadOnlyStruct.cs (2)
642private static void AssertNotReferencedIsReadOnlyAttribute(ImmutableArray<CSharpAttributeData> attributes) 644foreach (var attr in attributes)
Attributes\AttributeTests_RefSafetyRules.cs (1)
222var attribute = module.GetAttributes().SingleOrDefault();
Attributes\AttributeTests_Security.cs (2)
60var typeAttribute = (CSharpAttributeData)securityAttribute.Attribute;
Attributes\AttributeTests_Synthesized.cs (10)
62private void VerifyCompilationRelaxationsAttribute(CSharpAttributeData attribute, bool isSynthesized) 73private void VerifyRuntimeCompatibilityAttribute(CSharpAttributeData attribute, bool isSynthesized) 90private void VerifyDebuggableAttribute(CSharpAttributeData attribute, OptimizationLevel optimizations, bool isSynthesized) 405var dd = anon.GetAttributes().Where(a => a.AttributeClass.Name == "DebuggerDisplayAttribute").Single(); 1613var unverifiableCode = module.GetAttributes().Single(); 1682var stateMachineAttribute = attributes.First(); 1725var stateMachineAttribute = attributes.First(); 1767var stateMachineAttribute = attributes.First(); 1846var iteratorAttribute = iteratorMethod.GetAttributes().Single(); 1876var iteratorAttribute = iteratorMethod.GetAttributes().Single();
Attributes\AttributeTests_Tuples.cs (2)
614ImmutableArray<CSharpAttributeData> attributes, 627var tupleAttr = synthesizedTupleElementNamesAttr.Single();
Attributes\AttributeTests_WellKnownAttributes.cs (6)
136var attrSym = attrs.First(); 265var attrSym = type1.GetAttribute(comvSym); 403var attrSym = type1.GetAttribute(ciptSym); 2397var attrSym = method.GetAttributes().First(); 5065var attrSym = attrs.First(); 13365var attribute = module.ContainingAssembly.GetTypeByMetadataName("Program").GetMethod("Test").Parameters.Single().GetAttributes().Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
110foreach (var attrData in m.ContainingAssembly.GetAttributes()) 224foreach (var attrData in m.ContainingAssembly.GetAttributes())
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\BindingTests.cs (3)
2570var a = x.GetAttributes()[0]; 2600var a = foo.GetAttributes()[0]; 2630var a = tt.GetAttributes()[0];
Semantics\LocalFunctionTests.cs (1)
506var attributes = symbol.GetAttributes().As<CSharpAttributeData>();
Semantics\NullableReferenceTypesTests.cs (6)
6456var attribute = c.GetAttributes().Single(); 6478var attribute = c.GetAttributes().Single(); 95076CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 95149CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 101201CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 101278CSharpAttributeData nullableAttribute = t22.GetAttributes().Single();
Semantics\RefFieldTests.cs (1)
11506var attribute = parameter.GetAttributes().FirstOrDefault(a => a.GetTargetAttributeSignatureIndex(parameter, AttributeDescription.ScopedRefAttribute) != -1);
Semantics\TopLevelStatementsTests.cs (7)
6159var programAttributes = GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>()); 6177Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(localFn1.GetAttributes().As<CSharpAttributeData>())); 9055Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9059Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>())); 9106Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9108Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).GetAttributes().As<CSharpAttributeData>()); 9493var fieldAttributes = GetAttributeNames(field.GetAttributes().As<CSharpAttributeData>());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (54)
Symbols\ExtensionMethodTests.cs (1)
2605var attr = ((PEModuleSymbol)module).GetCustomAttributesForToken(method.Handle).Single();
Symbols\Metadata\PE\LoadingAttributes.cs (42)
60var aBoolInst = assembly0.GetAttribute(aBoolClass); 63var aByteInst = assembly0.GetAttribute(aByteClass); 66var aCharInst = assembly0.GetAttribute(aCharClass); 69var aSingleInst = assembly0.GetAttribute(aSingleClass); 72var aDoubleInst = assembly0.GetAttribute(aDoubleClass); 75var aInt16Inst = assembly0.GetAttribute(aInt16Class); 78var aInt32Inst = assembly0.GetAttribute(aInt32Class); 81var aInt64Inst = assembly0.GetAttribute(aInt64Class); 84var aObjectInst = assembly0.GetAttribute(aObjectClass); 87var aStringInst = assembly0.GetAttribute(aStringClass); 90var aTypeInst = assembly0.GetAttribute(aTypeClass); 132var aBoolInst = module0.GetAttribute(aBoolClass); 135var aByteInst = module0.GetAttribute(aByteClass); 138var aCharInst = module0.GetAttribute(aCharClass); 141var aSingleInst = module0.GetAttribute(aSingleClass); 144var aDoubleInst = module0.GetAttribute(aDoubleClass); 147var aInt16Inst = module0.GetAttribute(aInt16Class); 150var aInt32Inst = module0.GetAttribute(aInt32Class); 153var aInt64Inst = module0.GetAttribute(aInt64Class); 156var aObjectInst = module0.GetAttribute(aObjectClass); 159var aStringInst = module0.GetAttribute(aStringClass); 162var aTypeInst = module0.GetAttribute(aTypeClass); 212Assert.Equal(aNestedAttribute, ((CSharpAttributeData)innerC1.GetAttributes(aNestedAttribute).Single()).AttributeClass); 268var a = c3.GetAttribute(aBoolClass); 327var a = c4.GetAttribute(aInt32Class); 388var attr = property1.GetMethod.GetReturnTypeAttributes().First(); 476var arg = field.GetAttributes().Single(); 546foreach (var sa in s.GetAttributes()) 601foreach (var a in attrs) 692var attrSym = igoo.GetAttribute(attrObj); 746var attrSym = dfoo.GetAttribute(attrObj); 781var modattr = assemblies[0].Modules[0].GetAttributes().First(); 795var attrSym = field.GetAttributes().First(); 852var attrSym = ibar.GetAttribute(attrObj); 922var attrSym = assemblies[0].GetAttribute(attrObj1); 964var attrSym = tp.GetAttributes().First(); 1066foreach (var a in attrs) 1124var attrSym = tp.GetAttribute(attrObj1); 1182var attr1 = assemblies[0].GetAttribute(asmFileAttr); 1210var attr1 = exprNS.GetTypeMembers("BinaryExpression").First().GetAttribute(dbgProxyAttr); 1241var attr = prop.GetAttributes().First(); 1275var attr = prop.GetAttributes(resCatAttr).Single();
Symbols\RequiredMembersTests.cs (6)
3323var attr = c.GetAttributes().Single(); 3352var attr = attrAttribute.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 3382var attr = p.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 3412var attr = f.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 5440var attrData = ctor.GetAttributes().Single(); 5486var attrData = ctor.GetAttributes().Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (5)
139private void TestAttributeRetargeting(IEnumerable<CSharpAttributeData> attributes) 143var attribute = attributes.First(); 303var attr = c.GetAttributes().Single(); 349var a = c1.GetAttributes().Single(); 391var a = c1.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (33)
CSharpTestBase.cs (3)
1708internal static IEnumerable<string> GetAttributeNames(ImmutableArray<CSharpAttributeData> attributes) 1713internal static IEnumerable<string> GetAttributeStrings(ImmutableArray<CSharpAttributeData> attributes) 1718internal static IEnumerable<string> GetAttributeStrings(IEnumerable<CSharpAttributeData> attributes)
Extensions.cs (8)
327public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, NamedTypeSymbol c) 332public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, string namespaceName, string typeName) 337public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, AttributeDescription description) 342public static CSharpAttributeData GetAttribute(this Symbol @this, NamedTypeSymbol c) 347public static CSharpAttributeData GetAttribute(this Symbol @this, string namespaceName, string typeName) 352public static CSharpAttributeData GetAttribute(this Symbol @this, MethodSymbol m) 366public static void VerifyValue<T>(this CSharpAttributeData attr, int i, TypedConstantKind kind, T v) 373public static void VerifyNamedArgumentValue<T>(this CSharpAttributeData attr, int i, string name, TypedConstantKind kind, T v)
NativeIntegerAttributesVisitor.cs (2)
39protected override CSharpAttributeData? GetTargetAttribute(ImmutableArray<CSharpAttributeData> attributes) =>
NullableAttributesVisitor.cs (11)
27private CSharpAttributeData? _nullableContext; 36var previousContext = _nullableContext; 46var previousContext = _nullableContext; 63var nullableContextAttribute = GetNullableContextAttribute(symbol.GetAttributes()); 64var nullableAttribute = GetNullableAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes()); 113private static CSharpAttributeData? GetNullableContextAttribute(ImmutableArray<CSharpAttributeData> attributes) => 116private static CSharpAttributeData? GetNullableAttribute(ImmutableArray<CSharpAttributeData> attributes) => 124protected override CSharpAttributeData GetTargetAttribute(ImmutableArray<CSharpAttributeData> attributes)
RequiredMemberAttributesVisitor.cs (2)
73protected override CSharpAttributeData? GetTargetAttribute(ImmutableArray<CSharpAttributeData> attributes)
TestAttributesVisitor.cs (7)
141var attribute = GetTargetAttribute((symbol is MethodSymbol method) ? method.GetReturnTypeAttributes() : symbol.GetAttributes()); 154protected static string ReportAttribute(CSharpAttributeData attribute) 204protected abstract CSharpAttributeData? GetTargetAttribute(ImmutableArray<CSharpAttributeData> attributes); 206protected static CSharpAttributeData? GetAttribute(ImmutableArray<CSharpAttributeData> attributes, string namespaceName, string name) 208foreach (var attribute in attributes)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
Metadata\WinMdDumpTest.cs (1)
235foreach (var attribute in attributes)