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)
64
internal
EmbeddableAttributes
GetNeedsGeneratedAttributes()
70
private
EmbeddableAttributes
GetNeedsGeneratedAttributesInternal()
72
return (
EmbeddableAttributes
)_needsGeneratedAttributes | Compilation.GetNeedsGeneratedAttributes(freezeState: this is not PEDeltaAssemblyBuilder);
75
private void SetNeedsGeneratedAttributes(
EmbeddableAttributes
attributes)
1932
EmbeddableAttributes
attribute,
1937
Debug.Assert(diagnosticsOpt is null || attribute ==
EmbeddableAttributes
.ParamCollectionAttribute, "Don't report any errors. They should be reported during binding.");
1952
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsReadOnlyAttribute);
1957
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.RequiresLocationAttribute);
1962
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ParamCollectionAttribute, diagnostics, location);
1967
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsUnmanagedAttribute);
1972
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableAttribute);
1977
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableContextAttribute);
1983
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NativeIntegerAttribute);
1988
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ScopedRefAttribute);
Symbols\Compilation_WellKnownMembers.cs (29)
46
internal
EmbeddableAttributes
GetNeedsGeneratedAttributes(bool freezeState = true)
53
return (
EmbeddableAttributes
)_needsGeneratedAttributes;
56
private void SetNeedsGeneratedAttributes(
EmbeddableAttributes
attributes)
518
private void EnsureEmbeddableAttributeExists(
EmbeddableAttributes
attribute, BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation)
527
if ((attribute & (
EmbeddableAttributes
.NullableAttribute |
EmbeddableAttributes
.NullableContextAttribute)) != 0 &&
536
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsReadOnlyAttribute, diagnostics, location, modifyCompilation);
541
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.RequiresLocationAttribute, diagnostics, location, modifyCompilation);
546
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ParamCollectionAttribute, diagnostics, location, modifyCompilation: modifyCompilation);
551
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsByRefLikeAttribute, diagnostics, location, modifyCompilation);
556
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.IsUnmanagedAttribute, diagnostics, location, modifyCompilation);
561
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableAttribute, diagnostics, location, modifyCompilation);
566
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NullableContextAttribute, diagnostics, location, modifyCompilation);
572
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.NativeIntegerAttribute, diagnostics, location, modifyCompilation);
577
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ScopedRefAttribute, diagnostics, location, modifyCompilation);
582
EnsureEmbeddableAttributeExists(
EmbeddableAttributes
.ExtensionMarkerAttribute, diagnostics, location, modifyCompilation);
585
internal bool CheckIfAttributeShouldBeEmbedded(
EmbeddableAttributes
attribute, BindingDiagnosticBag? diagnosticsOpt, Location locationOpt)
589
case
EmbeddableAttributes
.IsReadOnlyAttribute:
596
case
EmbeddableAttributes
.IsByRefLikeAttribute:
603
case
EmbeddableAttributes
.IsUnmanagedAttribute:
610
case
EmbeddableAttributes
.NullableAttribute:
619
case
EmbeddableAttributes
.NullableContextAttribute:
626
case
EmbeddableAttributes
.NullablePublicOnlyAttribute:
633
case
EmbeddableAttributes
.NativeIntegerAttribute:
643
case
EmbeddableAttributes
.ScopedRefAttribute:
650
case
EmbeddableAttributes
.RefSafetyRulesAttribute:
657
case
EmbeddableAttributes
.RequiresLocationAttribute:
664
case
EmbeddableAttributes
.ParamCollectionAttribute:
671
case
EmbeddableAttributes
.ExtensionMarkerAttribute:
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_RefReadOnly.cs (1)
2563
return (compilation.GetNeedsGeneratedAttributes() &
EmbeddableAttributes
.IsReadOnlyAttribute) != 0;