4 types derived from CSharpAttributeData
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Attributes\PEAttributeData.cs (1)
18internal sealed class PEAttributeData : CSharpAttributeData
Symbols\Attributes\RetargetingAttributeData.cs (1)
15internal sealed class RetargetingAttributeData : CSharpAttributeData
Symbols\Attributes\SourceAttributeData.cs (1)
18internal sealed class SourceAttributeData : CSharpAttributeData
Symbols\Source\SynthesizedAttributeData.cs (1)
15internal abstract class SynthesizedAttributeData : CSharpAttributeData
702 references to CSharpAttributeData
Microsoft.CodeAnalysis.CSharp (489)
Binder\Binder_Attributes.cs (3)
75CSharpAttributeData?[] attributeDataArray, 126internal (CSharpAttributeData, BoundAttribute) GetAttribute( 282private CSharpAttributeData GetAttribute(BoundAttribute boundAttribute, BindingDiagnosticBag diagnostics)
Binder\EarlyWellKnownAttributeBinder.cs (2)
26internal (CSharpAttributeData, BoundAttribute) GetAttribute( 42internal new (CSharpAttributeData, BoundAttribute) GetAttribute(
Compiler\ClsComplianceChecker.cs (8)
144foreach (CSharpAttributeData assemblyLevelAttribute in peModule.GetAssemblyAttributes()) 342foreach (CSharpAttributeData attribute in symbol.GetAttributes()) 599private void CheckForAttributeWithArrayArgumentInternal(ImmutableArray<CSharpAttributeData> attributes) 601foreach (CSharpAttributeData attribute in attributes) 655private bool TryGetAttributeWarningLocation(CSharpAttributeData attribute, out Location location) 766private bool TryGetClsComplianceAttributeLocation(ImmutableArray<CSharpAttributeData> attributes, out Location attributeLocation) 768foreach (CSharpAttributeData data in attributes) 1187foreach (CSharpAttributeData data in symbol.GetAttributes())
Emitter\Model\MethodSymbolAdapter.cs (2)
512ImmutableArray<CSharpAttributeData> userDefined = AdaptedMethodSymbol.GetReturnTypeAttributes(); 513ArrayBuilder<CSharpAttributeData> synthesized = null;
Emitter\Model\SourceAssemblySymbolAdapter.cs (3)
16internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder, bool emittingRefAssembly, bool emittingAssemblyAttributesInNetModule) 20ImmutableArray<CSharpAttributeData> userDefined = this.GetAttributes(); 21ArrayBuilder<CSharpAttributeData> synthesized = null;
Emitter\Model\SymbolAdapter.cs (13)
85internal virtual IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 93internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder, bool emittingAssemblyAttributesInNetModule) 98ImmutableArray<CSharpAttributeData> userDefined; 99ArrayBuilder<CSharpAttributeData> synthesized = null; 112internal IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit( 113ImmutableArray<CSharpAttributeData> userDefined, 114ArrayBuilder<CSharpAttributeData> synthesized, 123return SpecializedCollections.EmptyEnumerable<CSharpAttributeData>(); 129private IEnumerable<CSharpAttributeData> GetCustomAttributesToEmitIterator( 130ImmutableArray<CSharpAttributeData> userDefined, 131ArrayBuilder<CSharpAttributeData> synthesized, 139foreach (var attribute in synthesized) 151CSharpAttributeData attribute = userDefined[i];
Emitter\NoPia\EmbeddedEvent.cs (2)
23protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 73foreach (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)
243protected override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 248protected override CSharpAttributeData CreateTypeIdentifierAttribute(bool hasGuid, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedTypesManager.cs (5)
32EmbeddedTypesManager<PEModuleBuilder, ModuleCompilationState, EmbeddedTypesManager, SyntaxNode, CSharpAttributeData, 118internal override int GetTargetAttributeSignatureIndex(CSharpAttributeData attrData, AttributeDescription description) 123internal override CSharpAttributeData CreateSynthesizedAttribute(WellKnownMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 155internal override bool TryGetAttributeArguments(CSharpAttributeData attrData, out ImmutableArray<TypedConstant> constructorArguments, out ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 634protected override CSharpAttributeData CreateCompilerGeneratedAttribute()
Errors\MessageProvider.cs (3)
263diagnostics.Add(ErrorCode.ERR_InvalidAttributeArgument, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), node.GetErrorDisplayName()); 280diagnostics.Add(ErrorCode.ERR_MarshalUnmanagedTypeNotValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName); 285diagnostics.Add(ErrorCode.ERR_MarshalUnmanagedTypeOnlyValidForFields, ((CSharpAttributeData)attribute).GetAttributeArgumentLocation(parameterIndex), unmanagedTypeName);
FlowAnalysis\DefiniteAssignment.cs (1)
1919private void VisitAttributes(ImmutableArray<(CSharpAttributeData, BoundAttribute)> boundAttributes)
Lowering\ClosureConversion\LambdaCapturedVariable.cs (2)
185internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 190foreach (CSharpAttributeData attr in definition.GetAttributes())
Lowering\IteratorRewriter\IteratorConstructor.cs (1)
31internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
28foreach (var attrData in @interface.GetAttributes())
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (2)
100internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 105foreach (CSharpAttributeData attr in definition.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 (8)
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>)); 121internal sealed override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Lowering\SynthesizedMethodBaseSymbol.cs (4)
150public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 155: ImmutableArray<CSharpAttributeData>.Empty; 158public sealed override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 161return InheritsBaseMethodAttributes ? BaseMethod.GetReturnTypeAttributes() : ImmutableArray<CSharpAttributeData>.Empty;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
247internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
146internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
86internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
168internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
160internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Attributes\AttributeData.cs (7)
213internal void DecodeSecurityAttribute<T>(Symbol targetSymbol, CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 239internal static void DecodeSkipLocalsInitAttribute<T>(CSharpCompilation compilation, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 250internal static void DecodeMemberNotNullAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 286private static void ReportBadNotNullMemberIfNeeded(TypeSymbol type, DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, string memberName) 300internal static void DecodeMemberNotNullWhenAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 790internal static int IndexOfAttribute(this ImmutableArray<CSharpAttributeData> attributes, AttributeDescription description) 803internal static string? DecodeNotNullIfNotNullAttribute(this CSharpAttributeData attribute)
Symbols\Attributes\RetargetingAttributeData.cs (2)
17private readonly CSharpAttributeData _underlying; 24CSharpAttributeData underlying,
Symbols\Attributes\SourceAttributeData.cs (1)
114/// 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\Extensions\RewrittenMethodSymbol.cs (1)
86public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (4)
69internal sealed override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 74foreach (CSharpAttributeData attr in extensionProperty.GetAttributes()) 86internal override void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 201internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Metadata\PE\PEAssemblySymbol.cs (2)
65private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 140public 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; 580public override ImmutableArray<CSharpAttributeData> GetAttributes() 607internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 609foreach (CSharpAttributeData attribute in GetAttributes())
Symbols\Metadata\PE\PEMethodSymbol.cs (10)
308public ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 351retVal._lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; 991public override ImmutableArray<CSharpAttributeData> GetAttributes() 996var attributeData = default(ImmutableArray<CSharpAttributeData>); 1067return ImmutableArray<CSharpAttributeData>.Empty; 1073? InterlockedOperations.Initialize(ref uncommonFields._lazyCustomAttributes, ImmutableArray<CSharpAttributeData>.Empty) 1078internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) => GetAttributes(); 1080public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() => Signature.ReturnParam.GetAttributes(); 1718internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 1723internal override void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Metadata\PE\PEModuleSymbol.cs (21)
86private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 91private ImmutableArray<CSharpAttributeData> _lazyAssemblyAttributes; 242public override ImmutableArray<CSharpAttributeData> GetAttributes() 251internal ImmutableArray<CSharpAttributeData> GetAssemblyAttributes() 255ArrayBuilder<CSharpAttributeData> moduleAssemblyAttributesBuilder = null; 277moduleAssemblyAttributesBuilder = new ArrayBuilder<CSharpAttributeData>(); 290(moduleAssemblyAttributesBuilder != null) ? moduleAssemblyAttributesBuilder.ToImmutableAndFree() : ImmutableArray<CSharpAttributeData>.Empty, 291default(ImmutableArray<CSharpAttributeData>)); 296internal void LoadCustomAttributes(EntityHandle token, ref ImmutableArray<CSharpAttributeData> customAttributes) 303ref ImmutableArray<CSharpAttributeData> customAttributes) 309internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 316internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 329internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 349ArrayBuilder<CSharpAttributeData> customAttributesBuilder = null; 396customAttributesBuilder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 410return ImmutableArray<CSharpAttributeData>.Empty; 416internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token) 428internal ImmutableArray<CSharpAttributeData> GetCustomAttributesForToken(EntityHandle token, 466private ImmutableArray<CSharpAttributeData> GetCustomAttributesFilterCompilerAttributes(EntityHandle token, out bool foundExtension, out bool foundReadOnly) 667ImmutableArray<CSharpAttributeData> assemblyAttributes = GetAssemblyAttributes(); 680ImmutableArray<CSharpAttributeData> assemblyAttributes = GetAssemblyAttributes();
Symbols\Metadata\PE\PENamedTypeSymbol.cs (4)
139internal ImmutableArray<CSharpAttributeData> lazyCustomAttributes; 890public override ImmutableArray<CSharpAttributeData> GetAttributes() 895return ImmutableArray<CSharpAttributeData>.Empty; 934internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Metadata\PE\PEParameterSymbol.cs (11)
159private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 185private ImmutableArray<CSharpAttributeData> _lazyHiddenAttributes; 270_lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; 271_lazyHiddenAttributes = ImmutableArray<CSharpAttributeData>.Empty; 1057public override ImmutableArray<CSharpAttributeData> GetAttributes() 1091ImmutableArray<CSharpAttributeData> attributes = 1109var builder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 1130ImmutableInterlocked.InterlockedInitialize(ref _lazyHiddenAttributes, ImmutableArray<CSharpAttributeData>.Empty); 1162internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder) 1164foreach (CSharpAttributeData attribute in GetAttributes()) 1170foreach (CSharpAttributeData attribute in _lazyHiddenAttributes)
Symbols\Metadata\PE\PEPropertySymbol.cs (7)
179public ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 367retVal._lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; 730public override ImmutableArray<CSharpAttributeData> GetAttributes() 736ImmutableArray<CSharpAttributeData> attributes = containingPEModuleSymbol.GetCustomAttributesForToken( 755return ImmutableArray<CSharpAttributeData>.Empty; 762result = ImmutableArray<CSharpAttributeData>.Empty; 770internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (2)
45private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 640public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\MethodSymbol.cs (4)
391public virtual ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 398return ImmutableArray<CSharpAttributeData>.Empty; 1155internal virtual void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 1273protected static void AddRequiredMembersMarkerAttributes(ref ArrayBuilder<CSharpAttributeData> attributes, MethodSymbol methodToAttribute)
Symbols\PublicModel\MethodSymbol.cs (1)
268return _underlying.GetReturnTypeAttributes().Cast<CSharpAttributeData, AttributeData>();
Symbols\ReducedExtensionMethodSymbol.cs (1)
459public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Retargeting\RetargetingAssemblySymbol.cs (2)
91private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 210public 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)
38private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 255public override ImmutableArray<CSharpAttributeData> GetAttributes() 260internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\Retargeting\RetargetingParameterSymbol.cs (3)
25private ImmutableArray<CSharpAttributeData> _lazyCustomAttributes; 65public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 70internal 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()) 1143private ImmutableArray<CSharpAttributeData> RetargetAttributes(ImmutableArray<CSharpAttributeData> oldAttributes) 1148internal IEnumerable<CSharpAttributeData> RetargetAttributes(IEnumerable<CSharpAttributeData> attributes) 1150foreach (var attributeData in attributes) 1156private CSharpAttributeData RetargetAttributeData(CSharpAttributeData oldAttributeData) 1302internal ImmutableArray<CSharpAttributeData> GetRetargetedAttributes( 1303ImmutableArray<CSharpAttributeData> underlyingAttributes, 1304ref ImmutableArray<CSharpAttributeData> lazyCustomAttributes) 1309ImmutableArray<CSharpAttributeData> retargetedAttributes = this.RetargetAttributes(underlyingAttributes); 1311ImmutableInterlocked.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 (11)
22private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 72public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 82private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 118internal sealed override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 120CSharpAttributeData? attributeData; 163protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 168var attribute = arguments.Attribute; 204MarshalAsAttributeDecoder<FieldWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Field, MessageProvider.Instance); 265private void VerifyConstantValueMatches(ConstantValue attrValue, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 313internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 389internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\ImplicitNamedTypeSymbol.cs (2)
34public override ImmutableArray<CSharpAttributeData> GetAttributes() 37return ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Source\SourceAssemblySymbol.cs (47)
66private CustomAttributesBag<CSharpAttributeData> _lazySourceAttributesBag; 71private CustomAttributesBag<CSharpAttributeData> _lazyNetModuleAttributesBag; 1146private bool IsKnownAssemblyAttribute(CSharpAttributeData attribute) 1189private HashSet<CSharpAttributeData> GetUniqueSourceAssemblyAttributes() 1191ImmutableArray<CSharpAttributeData> appliedSourceAttributes = this.GetSourceAttributesBag().Attributes; 1193HashSet<CSharpAttributeData> uniqueAttributes = null; 1197CSharpAttributeData attribute = appliedSourceAttributes[i]; 1210private static bool AddUniqueAssemblyAttribute(CSharpAttributeData attribute, ref HashSet<CSharpAttributeData> uniqueAttributes) 1216uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1222private bool ValidateAttributeUsageForNetModuleAttribute(CSharpAttributeData attribute, string netModuleName, BindingDiagnosticBag diagnostics, ref HashSet<CSharpAttributeData> uniqueAttributes) 1281private ImmutableArray<CSharpAttributeData> GetNetModuleAttributes(out ImmutableArray<string> netModuleNames) 1283ArrayBuilder<CSharpAttributeData> moduleAssemblyAttributesBuilder = null; 1290foreach (var attributeData in peModuleSymbol.GetAssemblyAttributes()) 1295moduleAssemblyAttributesBuilder = ArrayBuilder<CSharpAttributeData>.GetInstance(); 1306return ImmutableArray<CSharpAttributeData>.Empty; 1314ImmutableArray<CSharpAttributeData> attributesFromNetModules, 1326HashSet<CSharpAttributeData> uniqueAttributes = GetUniqueSourceAssemblyAttributes(); 1328var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 1340CSharpAttributeData attribute = attributesFromNetModules[i]; 1363private void LoadAndValidateNetModuleAttributes(ref CustomAttributesBag<CSharpAttributeData> lazyNetModuleAttributesBag) 1367Interlocked.CompareExchange(ref lazyNetModuleAttributesBag, CustomAttributesBag<CSharpAttributeData>.Empty, null); 1374ImmutableArray<CSharpAttributeData> attributesFromNetModules = GetNetModuleAttributes(out netModuleNames); 1432CustomAttributesBag<CSharpAttributeData> netModuleAttributesBag; 1436netModuleAttributesBag = new CustomAttributesBag<CSharpAttributeData>(); 1441if (netModuleAttributesBag.IsEmpty) netModuleAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 1445netModuleAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 1471ImmutableArray<CSharpAttributeData> attributesFromNetModules = GetNetModuleAttributes(out netModuleNames); 1484WellKnownAttributeData limitedDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> attributesFromNetModules, 1493HashSet<CSharpAttributeData> uniqueAttributes = null; 1500CSharpAttributeData attribute = attributesFromNetModules[i]; 1512void limitedDecodeWellKnownAttribute(CSharpAttributeData attribute, QuickAttributes attributeMatches, ref CommonAssemblyWellKnownAttributeData result) 1535private CustomAttributesBag<CSharpAttributeData> GetNetModuleAttributesBag() 1582private CustomAttributesBag<CSharpAttributeData> GetSourceAttributesBag() 1596public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 1663CustomAttributesBag<CSharpAttributeData>? attributesBag = _lazySourceAttributesBag; 1711CustomAttributesBag<CSharpAttributeData> attributesBag = _lazySourceAttributesBag; 1780private static IEnumerable<Cci.SecurityAttribute> GetSecurityAttributes(CustomAttributesBag<CSharpAttributeData> attributesBag) 1790foreach (var securityAttribute in securityData.GetSecurityAttributes<CSharpAttributeData>(attributesBag.Attributes)) 1939internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 2202private void DecodeTypeForwardedToAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2270CSharpAttributeData attrData, 2358protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 2363private void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, int index, bool isFromNetModule) 2365var attribute = arguments.Attribute; 2594private static void ValidateIntegralAttributeNonNegativeArguments(CSharpAttributeData attribute, AttributeSyntax nodeOpt, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceClonedParameterSymbol.cs (1)
113public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceComplexParameterSymbol.cs (27)
38private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 574internal sealed override CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 608public ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindParameterAttributes() 619if (CSharpAttributeData.IsTargetEarlyAttribute(attributeType, attributeSyntax, AttributeDescription.OptionalAttribute)) 636internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 638if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DefaultParameterValueAttribute)) 642else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DecimalConstantAttribute)) 646else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.DateTimeConstantAttribute)) 650else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.UnscopedRefAttribute)) 659if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerLineNumberAttribute)) 663else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerFilePathAttribute)) 667else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerMemberNameAttribute)) 671else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CallerArgumentExpressionAttribute)) 700private (CSharpAttributeData?, BoundAttribute?) EarlyDecodeAttributeForDefaultParameterValue(AttributeDescription description, ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 729protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 733var attribute = arguments.Attribute; 779MarshalAsAttributeDecoder<ParameterWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.Parameter, MessageProvider.Instance); 881private static bool? DecodeMaybeNullWhenOrNotNullWhenOrDoesNotReturnIfAttribute(CSharpAttributeData attribute) 889private void DecodeDefaultParameterValueAttribute(AttributeDescription description, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 891var attribute = arguments.Attribute; 931private ConstantValue DecodeDefaultParameterValueAttribute(AttributeDescription description, CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 950private ConstantValue DecodeDefaultParameterValueAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt) 1155private void ValidateCallerArgumentExpressionAttribute(AttributeSyntax node, CSharpAttributeData attribute, BindingDiagnosticBag diagnostics) 1238private void DecodeInterpolatedStringHandlerArgumentAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, BindingDiagnosticBag diagnostics, int attributeIndex) 1321(int Ordinal, ParameterSymbol? Parameter)? decodeName(TypedConstant constant, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1378static void setInterpolatedStringHandlerAttributeError(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1385internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceConstructorSymbolBase.cs (2)
240internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 244if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.SetsRequiredMembersAttribute))
Symbols\Source\SourceEventFieldSymbol.cs (1)
59internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceEventSymbol.cs (9)
35private CustomAttributesBag<CSharpAttributeData>? _lazyCustomAttributesBag; 205private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 259public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 299internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 301CSharpAttributeData? attributeData; 342protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 344var attribute = arguments.Attribute; 362CSharpAttributeData.DecodeSkipLocalsInitAttribute<CommonEventWellKnownAttributeData>(DeclaringCompilation, ref arguments); 370internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData>? attributes)
Symbols\Source\SourceFieldSymbol.cs (2)
114protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 119var attribute = arguments.Attribute;
Symbols\Source\SourceFixedFieldSymbol.cs (2)
41internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 207internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1437foreach (var attr in symbol.GetAttributes()) 5936internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceMemberFieldSymbol.cs (2)
114internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 142internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceMethodSymbol.cs (2)
103internal sealed override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 109internal static void AddSynthesizedAttributes(MethodSymbol target, PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (36)
28private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 29private CustomAttributesBag<CSharpAttributeData> _lazyReturnTypeCustomAttributesBag; 246private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 263private CustomAttributesBag<CSharpAttributeData> GetReturnTypeAttributesBag() 274private CustomAttributesBag<CSharpAttributeData> GetAttributesBag(ref CustomAttributesBag<CSharpAttributeData> lazyCustomAttributesBag, bool forReturnType) 316public override ImmutableArray<CSharpAttributeData> GetAttributes() 325public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes() 331internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 339if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ConditionalAttribute)) 354else if (EarlyDecodeDeprecatedOrExperimentalOrObsoleteAttribute(ref arguments, out CSharpAttributeData? attributeData, out BoundAttribute? boundAttribute, out ObsoleteAttributeData? obsoleteData)) 363else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.UnmanagedCallersOnlyAttribute)) 371else if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.OverloadResolutionPriorityAttribute)) 401public ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindMethodAttributes() 509protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 524private void DecodeWellKnownAttributeAppliedToMethod(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 528var attribute = arguments.Attribute; 538AttributeData.DecodeMethodImplAttribute<MethodWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>(ref arguments, MessageProvider.Instance); 589CSharpAttributeData.DecodeSkipLocalsInitAttribute<MethodWellKnownAttributeData>(DeclaringCompilation, ref arguments); 598CSharpAttributeData.DecodeMemberNotNullAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 603CSharpAttributeData.DecodeMemberNotNullWhenAttribute<MethodWellKnownAttributeData>(ContainingType, ref arguments); 686ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, 713private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 777private void DecodeWellKnownAttributeAppliedToReturnValue(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 781var attribute = arguments.Attribute; 788MarshalAsAttributeDecoder<ReturnTypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>.Decode(ref arguments, AttributeTargets.ReturnValue, MessageProvider.Instance); 816private void DecodeDllImportAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 820var attribute = arguments.Attribute; 941private void DecodeModuleInitializerAttribute(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 990private void DecodeInterceptsLocationAttribute(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1008private void DecodeInterceptsLocationChecksumBased(DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, int version, string? data) 1149DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, 1175var attributeData = arguments.Attribute; 1373private void DecodeUnmanagedCallersOnlyAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1429static UnmanagedCallersOnlyAttributeData DecodeUnmanagedCallersOnlyAttributeData(SourceMethodSymbol @this, CSharpAttributeData attribute, Location location, BindingDiagnosticBag diagnostics) 1459internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Source\SourceModuleSymbol.cs (7)
44private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 515private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 538public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 560protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 564var attribute = arguments.Attribute; 586CSharpAttributeData.DecodeSkipLocalsInitAttribute<ModuleWellKnownAttributeData>(DeclaringCompilation, ref arguments); 633internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceNamedTypeSymbol.cs (22)
31private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 840private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 862public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 902internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 905CSharpAttributeData? attributeData; 908if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ComImportAttribute)) 923if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CodeAnalysisEmbeddedAttribute)) 938if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.ConditionalAttribute)) 965if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.AttributeUsageAttribute)) 997if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.InterpolatedStringHandlerAttribute)) 1012if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.InlineArrayAttribute)) 1030if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.CollectionBuilderAttribute)) 1095protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1100var attribute = arguments.Attribute; 1138AttributeData.DecodeStructLayoutAttribute<TypeWellKnownAttributeData, AttributeSyntax, CSharpAttributeData, AttributeLocation>( 1183CSharpAttributeData.DecodeSkipLocalsInitAttribute<TypeWellKnownAttributeData>(DeclaringCompilation, ref arguments); 1300private AttributeUsageInfo DecodeAttributeUsageAttribute(CSharpAttributeData attribute, AttributeSyntax node, bool diagnose, BindingDiagnosticBag diagnosticsOpt = null) 1337private void DecodeCoClassAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1339var attribute = arguments.Attribute; 1390private void ValidateConditionalAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics) 1588internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 1687internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourceParameterSymbol.cs (2)
191internal abstract CustomAttributesBag<CSharpAttributeData> GetAttributesBag(); 197public sealed override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Source\SourceParameterSymbolBase.cs (2)
69internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 75internal static void AddSynthesizedAttributes(ParameterSymbol parameter, PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
797internal sealed override void AddSynthesizedReturnTypeAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 803internal void AddSynthesizedReturnTypeFlowAnalysisAttributes(ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Source\SourcePropertySymbolBase.cs (16)
71private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 473CustomAttributesBag<CSharpAttributeData>? temp = null; 1304private CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 1349public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 1388internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 1443internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 1445CSharpAttributeData? attributeData; 1459if (CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.IndexerNameAttribute)) 1479else if ((IsIndexer || this.GetIsNewExtensionMember()) && CSharpAttributeData.IsTargetEarlyAttribute(arguments.AttributeType, arguments.AttributeSyntax, AttributeDescription.OverloadResolutionPriorityAttribute)) 1523protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 1530var attribute = arguments.Attribute; 1549CSharpAttributeData.DecodeSkipLocalsInitAttribute<PropertyWellKnownAttributeData>(DeclaringCompilation, ref arguments); 1587CSharpAttributeData.DecodeMemberNotNullAttribute<PropertyWellKnownAttributeData>(ContainingType, ref arguments); 1592CSharpAttributeData.DecodeMemberNotNullWhenAttribute<PropertyWellKnownAttributeData>(ContainingType, ref arguments); 1706internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 1718private void ValidateIndexerNameAttribute(CSharpAttributeData attribute, AttributeSyntax node, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
154internal override CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 157return CustomAttributesBag<CSharpAttributeData>.Empty;
Symbols\Source\SourceTypeParameterSymbol.cs (7)
32private CustomAttributesBag<CSharpAttributeData> _lazyCustomAttributesBag; 167public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 178internal virtual CustomAttributesBag<CSharpAttributeData> GetAttributesBag() 195CustomAttributesBag<CSharpAttributeData> attributesBag = typeParameter.GetAttributesBag(); 386internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 427protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 432var 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)
206public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 211public override ImmutableArray<CSharpAttributeData> GetReturnTypeAttributes()
Symbols\SubstitutedNamedTypeSymbol.cs (2)
209public sealed override ImmutableArray<CSharpAttributeData> GetAttributes() 472internal override IEnumerable<CSharpAttributeData> GetCustomAttributesToEmit(PEModuleBuilder moduleBuilder)
Symbols\SubstitutedPropertySymbol.cs (1)
63public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\Symbol.cs (8)
874internal virtual void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 881internal static void AddSynthesizedAttribute(ref ArrayBuilder<CSharpAttributeData> attributes, CSharpAttributeData attribute) 887attributes = new ArrayBuilder<CSharpAttributeData>(1); 1536internal bool ReportExplicitUseOfReservedAttributes(in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, ReservedAttributes reserved) 1538var attribute = arguments.Attribute; 1616bool reportExplicitUseOfReservedAttribute(CSharpAttributeData attribute, in DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, in AttributeDescription attributeDescription)
Symbols\Symbol_Attributes.cs (30)
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.WindowsExperimentalAttribute)) 169else if (CSharpAttributeData.IsTargetEarlyAttribute(type, syntax, AttributeDescription.ExperimentalAttribute)) 216protected void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 238protected virtual void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 260internal virtual void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData) 301ref CustomAttributesBag<CSharpAttributeData>? lazyCustomAttributesBag, 318ImmutableArray<CSharpAttributeData> boundAttributes; 329Interlocked.CompareExchange(ref lazyCustomAttributesBag, new CustomAttributesBag<CSharpAttributeData>(), null); 355var attributeDataArray = new CSharpAttributeData[totalAttributesCount]; 393boundAttributes = ImmutableArray<CSharpAttributeData>.Empty; 396Interlocked.CompareExchange(ref lazyCustomAttributesBag, CustomAttributesBag<CSharpAttributeData>.WithEmptyData(), null); 435if (lazyCustomAttributesBag.IsEmpty) lazyCustomAttributesBag = CustomAttributesBag<CSharpAttributeData>.Empty; 442void removeObsoleteDiagnosticsForForwardedTypes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> attributesToBind, ref BindingDiagnosticBag diagnostics) 474CSharpAttributeData boundAttribute = boundAttributes[i]; 540protected ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindAttributes(OneOrMany<SyntaxList<AttributeListSyntax>> attributeDeclarations, Binder? rootBinder) 542var boundAttributeArrayBuilder = ArrayBuilder<(CSharpAttributeData, BoundAttribute)>.GetInstance(); 562private void RecordPresenceOfBadAttributes(ImmutableArray<CSharpAttributeData> boundAttributes) 564foreach (var attribute in boundAttributes) 770CSharpAttributeData?[] attributeDataArray, 798(CSharpAttributeData? earlyAttributeDataOpt, BoundAttribute? boundAttributeOpt) = this.EarlyDecodeWellKnownAttribute(ref arguments); 840ImmutableArray<CSharpAttributeData> boundAttributes, 852var arguments = new DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation>(); 859CSharpAttributeData boundAttribute = boundAttributes[i]; 887CSharpAttributeData attribute,
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
928internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (3)
141internal override (CSharpAttributeData?, BoundAttribute?) EarlyDecodeWellKnownAttribute(ref EarlyDecodeWellKnownAttributeArguments<EarlyWellKnownAttributeBinder, NamedTypeSymbol, AttributeSyntax, AttributeLocation> arguments) 150protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 158internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (2)
71internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 73foreach (CSharpAttributeData attr in ParameterSymbol.GetAttributes())
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (1)
75internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
93internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (2)
81internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 87internal void AddSynthesizedFlowAnalysisAttributes(ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (4)
43internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 236protected sealed override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments) 241var attribute = arguments.Attribute; 262internal override void PostDecodeWellKnownAttributes(ImmutableArray<CSharpAttributeData> boundAttributes, ImmutableArray<AttributeSyntax> allAttributeSyntaxNodes, BindingDiagnosticBag diagnostics, AttributeLocation symbolPart, WellKnownAttributeData decodedData)
Symbols\Synthesized\SynthesizedContainer.cs (1)
52internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
183internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
383internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedEnumValueFieldSymbol.cs (1)
38internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
46internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
74internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
196internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
322internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Synthesized\SynthesizedParameterSymbol.cs (3)
148internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 376public override ImmutableArray<CSharpAttributeData> GetAttributes() 378return _baseParameterForAttributes?.GetAttributes() ?? ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (4)
35internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) 41foreach (CSharpAttributeData attr in definition.GetAttributes()) 58public override ImmutableArray<CSharpAttributeData> GetAttributes() 65return ImmutableArray<CSharpAttributeData>.Empty;
Symbols\Tuples\TupleFieldSymbol.cs (2)
134public override ImmutableArray<CSharpAttributeData> GetAttributes() 325public override ImmutableArray<CSharpAttributeData> GetAttributes()
Symbols\TypeSymbol.cs (1)
1982foreach (var attributeData in implementingSymbol.GetAttributes())
Symbols\Wrapped\WrappedParameterSymbol.cs (2)
69public override ImmutableArray<CSharpAttributeData> GetAttributes() 74internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
178public override ImmutableArray<CSharpAttributeData> GetAttributes()
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
1150var attribute = method.GetAttributes().Single();
CodeGen\CodeGenFunctionPointersTests.cs (9)
11676var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11739var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11802var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11861var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 11895var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12136var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12279var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12318var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 12362var 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)
1304var attribute = backingField.GetAttributes().Single();
Emit\OptionalArgumentsTests.cs (2)
226var attribute = attributes[0]; 464var attribute = ((PEModuleSymbol)module).GetCustomAttributesForToken(field.Handle).Single();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (91)
Attributes\AttributeTests.cs (22)
349var attribute = newLibComp.SourceAssembly.GetAttributes().Single(); // GetAttributes binds all attributes 1430foreach (var a in attrs) 3531var attr = attrs.Single(); 3795var attr = attrs.First(); 3909var attr = attrs.First(); 4011var attr = attrs.First(); 4083var attr = attrs.First(); 4316var attr = attrs.First(); 4645var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4677var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4710var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4742var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4778var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A2"); 4809var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4835var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 4867var attr = c.GetAttributes().Single(d => d.AttributeClass?.Name == "A"); 5253var attr = attrs.First(); 5314var attr = attrs.First(); 5754var attr = c.GetAttributes().Single(); 5798var attr = c.GetAttributes().Single(); 5832var attribute = methodTypeParameter.GetAttributes().Single(); 10369var attribute = m.GetAttributes().Single();
Attributes\AttributeTests_Assembly.cs (9)
1040var uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1041foreach (var attr in metadataAttributes) 1085foreach (var a in attrs) 1206foreach (var a in attrs) 1285foreach (var a in attrs) 1332foreach (var a in module.ContainingAssembly.GetAttributes()) 1379foreach (var a in attrs) 1796foreach (var attr in attributes) 2134private static IEnumerable<CSharpAttributeData> GetAssemblyDescriptionAttributes(AssemblySymbol assembly)
Attributes\AttributeTests_CallerInfoAttributes.cs (2)
4406var attr = ctor.Parameters.Single().GetAttributes().Single(); 4436var 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(); 1094foreach (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)
1497var attribute = GetNativeIntegerAttribute(attributes); 1620private static void AssertNativeIntegerAttribute(ImmutableArray<CSharpAttributeData> attributes) 1625private static void AssertAttributes(ImmutableArray<CSharpAttributeData> attributes, params string[] expectedNames) 1642private 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)
137var attrSym = attrs.First(); 266var attrSym = type1.GetAttribute(comvSym); 404var attrSym = type1.GetAttribute(ciptSym); 2478var attrSym = method.GetAttributes().First(); 5154var attrSym = attrs.First(); 13541var attribute = module.ContainingAssembly.GetTypeByMetadataName("Program").GetMethod("Test").Parameters.Single().GetAttributes().Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
117foreach (var attrData in m.ContainingAssembly.GetAttributes()) 263foreach (var attrData in m.ContainingAssembly.GetAttributes())
OverloadResolutionPriorityTests.cs (1)
906var attr = c!.GetAttributes().Single();
PartialEventsAndConstructorsTests.cs (1)
3273static void assertEqual(IEnumerable<string> expected, ImmutableArray<CSharpAttributeData> actual)
RefReadonlyParameterTests.cs (2)
336var attribute = Assert.Single(p.GetAttributes()); 443var attribute = Assert.Single(p.GetAttributes());
Semantics\ParamsCollectionTests.cs (7)
239var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 355var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 538var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 683var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 1427var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2551var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2687var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\BindingTests.cs (3)
2603var a = x.GetAttributes()[0]; 2633var a = foo.GetAttributes()[0]; 2663var a = tt.GetAttributes()[0];
Semantics\LocalFunctionTests.cs (1)
506var attributes = symbol.GetAttributes().As<CSharpAttributeData>();
Semantics\NullableReferenceTypesTests.cs (6)
6468var attribute = c.GetAttributes().Single(); 6490var attribute = c.GetAttributes().Single(); 98846CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 98919CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 104971CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 105048CSharpAttributeData nullableAttribute = t22.GetAttributes().Single();
Semantics\RefFieldTests.cs (1)
12066var attribute = parameter.GetAttributes().FirstOrDefault(a => a.GetTargetAttributeSignatureIndex(AttributeDescription.ScopedRefAttribute) != -1);
Semantics\TopLevelStatementsTests.cs (7)
6172var programAttributes = GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>()); 6190Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(localFn1.GetAttributes().As<CSharpAttributeData>())); 9068Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9072Assert.Equal(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(program.GetAttributes().As<CSharpAttributeData>())); 9119Assert.Empty(program.GetAttributes().As<CSharpAttributeData>()); 9121Assert.Empty(program.GetMethod(WellKnownMemberNames.TopLevelStatementsEntryPointMethodName).GetAttributes().As<CSharpAttributeData>()); 9506var fieldAttributes = GetAttributeNames(field.GetAttributes().As<CSharpAttributeData>());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (54)
Symbols\ExtensionMethodTests.cs (1)
2599var 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)
3948var attr = c.GetAttributes().Single(); 3977var attr = attrAttribute.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 4007var attr = p.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 4037var attr = f.GetAttributes().Where(a => a.AttributeClass!.Name == "AttrAttribute").Single(); 6886var attrData = ctor.GetAttributes().Single(); 6932var attrData = ctor.GetAttributes().Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (5)
140private void TestAttributeRetargeting(IEnumerable<CSharpAttributeData> attributes) 144var attribute = attributes.First(); 304var attr = c.GetAttributes().Single(); 350var a = c1.GetAttributes().Single(); 392var a = c1.GetAttributes().Single();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (34)
CSharpTestBase.cs (3)
2259internal static IEnumerable<string> GetAttributeNames(ImmutableArray<CSharpAttributeData> attributes) 2264internal static IEnumerable<string> GetAttributeStrings(ImmutableArray<CSharpAttributeData> attributes) 2269internal static IEnumerable<string> GetAttributeStrings(IEnumerable<CSharpAttributeData> attributes)
Extensions.cs (9)
364public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, NamedTypeSymbol c) 369public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, string namespaceName, string typeName) 374public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, AttributeDescription description) 379public static CSharpAttributeData GetAttribute(this Symbol @this, NamedTypeSymbol c) 384public static CSharpAttributeData GetAttribute(this Symbol @this, string namespaceName, string typeName) 389public static CSharpAttributeData GetAttribute(this Symbol @this, MethodSymbol m) 403public static void VerifyValue<T>(this CSharpAttributeData attr, int i, TypedConstantKind kind, T v) 410public static void VerifyNamedArgumentValue<T>(this CSharpAttributeData attr, int i, string name, TypedConstantKind kind, T v) 419public static ImmutableArray<string> ToStrings(this ImmutableArray<CSharpAttributeData> attributes)
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)