61 references to EmbeddableAttributes
Microsoft.CodeAnalysis.CSharp (60)
Emitter\Model\PEAssemblyBuilder.cs (17)
391
EmbeddableAttributes
needsAttributes = GetNeedsGeneratedAttributes();
394
Compilation.CheckIfAttributeShouldBeEmbedded(
EmbeddableAttributes
.NullablePublicOnlyAttribute, diagnostics, Location.None))
396
needsAttributes |=
EmbeddableAttributes
.NullablePublicOnlyAttribute;
400
Compilation.CheckIfAttributeShouldBeEmbedded(
EmbeddableAttributes
.RefSafetyRulesAttribute, diagnostics, Location.None))
402
needsAttributes |=
EmbeddableAttributes
.RefSafetyRulesAttribute;
419
if ((needsAttributes &
EmbeddableAttributes
.IsReadOnlyAttribute) != 0)
428
if ((needsAttributes &
EmbeddableAttributes
.RequiresLocationAttribute) != 0)
437
if ((needsAttributes &
EmbeddableAttributes
.ParamCollectionAttribute) != 0)
446
if ((needsAttributes &
EmbeddableAttributes
.IsByRefLikeAttribute) != 0)
455
if ((needsAttributes &
EmbeddableAttributes
.IsUnmanagedAttribute) != 0)
464
if ((needsAttributes &
EmbeddableAttributes
.NullableAttribute) != 0)
473
if ((needsAttributes &
EmbeddableAttributes
.NullableContextAttribute) != 0)
482
if ((needsAttributes &
EmbeddableAttributes
.NullablePublicOnlyAttribute) != 0)
491
if ((needsAttributes &
EmbeddableAttributes
.NativeIntegerAttribute) != 0)
501
if ((needsAttributes &
EmbeddableAttributes
.ScopedRefAttribute) != 0)
510
if ((needsAttributes &
EmbeddableAttributes
.RefSafetyRulesAttribute) != 0)
519
if ((needsAttributes &
EmbeddableAttributes
.ExtensionMarkerAttribute) != 0)
Emitter\Model\PEModuleBuilder.cs (14)
60
internal
EmbeddableAttributes
GetNeedsGeneratedAttributes()
66
private
EmbeddableAttributes
GetNeedsGeneratedAttributesInternal()
68
return (
EmbeddableAttributes
)_needsGeneratedAttributes | Compilation.GetNeedsGeneratedAttributes();
71
private void SetNeedsGeneratedAttributes(
EmbeddableAttributes
attributes)
1783
EmbeddableAttributes
attribute,
1788
Debug.Assert(diagnosticsOpt is null || attribute ==
EmbeddableAttributes
.ParamCollectionAttribute, "Don't report any errors. They should be reported during binding.");
1803
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsReadOnlyAttribute);
1808
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.RequiresLocationAttribute);
1813
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ParamCollectionAttribute, diagnostics, location);
1818
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsUnmanagedAttribute);
1823
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableAttribute);
1828
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableContextAttribute);
1834
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NativeIntegerAttribute);
1839
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ScopedRefAttribute);
Symbols\Compilation_WellKnownMembers.cs (29)
46
internal
EmbeddableAttributes
GetNeedsGeneratedAttributes()
49
return (
EmbeddableAttributes
)_needsGeneratedAttributes;
52
private void SetNeedsGeneratedAttributes(
EmbeddableAttributes
attributes)
514
private void EnsureEmbeddableAttributeExists(
EmbeddableAttributes
attribute, BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation)
523
if ((attribute & (
EmbeddableAttributes
.NullableAttribute |
EmbeddableAttributes
.NullableContextAttribute)) != 0 &&
532
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsReadOnlyAttribute, diagnostics, location, modifyCompilation);
537
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.RequiresLocationAttribute, diagnostics, location, modifyCompilation);
542
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ParamCollectionAttribute, diagnostics, location, modifyCompilation: true);
547
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsByRefLikeAttribute, diagnostics, location, modifyCompilation);
552
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsUnmanagedAttribute, diagnostics, location, modifyCompilation);
557
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableAttribute, diagnostics, location, modifyCompilation);
562
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableContextAttribute, diagnostics, location, modifyCompilation);
568
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NativeIntegerAttribute, diagnostics, location, modifyCompilation);
573
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ScopedRefAttribute, diagnostics, location, modifyCompilation);
578
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ExtensionMarkerAttribute, diagnostics, location, modifyCompilation);
581
internal bool CheckIfAttributeShouldBeEmbedded(
EmbeddableAttributes
attribute, BindingDiagnosticBag? diagnosticsOpt, Location locationOpt)
585
case
EmbeddableAttributes
.IsReadOnlyAttribute:
592
case
EmbeddableAttributes
.IsByRefLikeAttribute:
599
case
EmbeddableAttributes
.IsUnmanagedAttribute:
606
case
EmbeddableAttributes
.NullableAttribute:
615
case
EmbeddableAttributes
.NullableContextAttribute:
622
case
EmbeddableAttributes
.NullablePublicOnlyAttribute:
629
case
EmbeddableAttributes
.NativeIntegerAttribute:
639
case
EmbeddableAttributes
.ScopedRefAttribute:
646
case
EmbeddableAttributes
.RefSafetyRulesAttribute:
653
case
EmbeddableAttributes
.RequiresLocationAttribute:
660
case
EmbeddableAttributes
.ParamCollectionAttribute:
667
case
EmbeddableAttributes
.ExtensionMarkerAttribute:
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_RefReadOnly.cs (1)
2563
return (compilation.GetNeedsGeneratedAttributes() &
EmbeddableAttributes
.IsReadOnlyAttribute) != 0;