2 writes to AllowUnsafe
Microsoft.CodeAnalysis.CSharp (2)
CSharpCompilationOptions.cs (2)
235this.AllowUnsafe = allowUnsafe; 431return new CSharpCompilationOptions(this) { AllowUnsafe = enabled };
29 references to AllowUnsafe
Microsoft.CodeAnalysis.CSharp (15)
Binder\Binder_Statements.cs (1)
174if (!this.Compilation.Options.AllowUnsafe)
Binder\ExecutableCodeBinder.cs (1)
135&& compilation.Options.AllowUnsafe) // Don't cascade
Compilation\CSharpCompilation.cs (2)
4993if (Options.AllowUnsafe) 4995writeValue(CompilationOptionNames.Unsafe, Options.AllowUnsafe.ToString());
Compilation\CSharpDeterministicKeyBuilder.cs (1)
28writer.Write("unsafe", csharpOptions.AllowUnsafe);
CSharpCompilationOptions.cs (5)
248allowUnsafe: other.AllowUnsafe, 426if (enabled == this.AllowUnsafe) 774return this.AllowUnsafe == other.AllowUnsafe && 790Hash.Combine(this.AllowUnsafe,
Symbols\Attributes\AttributeData.cs (1)
243if (!compilation.Options.AllowUnsafe)
Symbols\Source\SourceAssemblySymbol.cs (2)
688if (!compilationOptions.AllowUnsafe) 1816if (_compilation.Options.AllowUnsafe)
Symbols\Source\SourceModuleSymbol.cs (1)
668if (compilation.Options.AllowUnsafe)
Symbols\SymbolExtensions.cs (1)
276return symbol.DeclaringCompilation.Options.AllowUnsafe;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierDiagnosticAnalyzer.cs (1)
28if (!options.AllowUnsafe)
Microsoft.CodeAnalysis.CSharp.Features (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierDiagnosticAnalyzer.cs (1)
28if (!options.AllowUnsafe)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.FixAllProvider.cs (1)
28if (document.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false })
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (1)
32if (context.Document.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false })
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Serialization\CSharpOptionsSerializationService.cs (1)
32writer.WriteBoolean(csharpOptions.AllowUnsafe);
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\ComClassGeneratorDiagnosticsAnalyzer.cs (1)
31bool unsafeCodeIsEnabled = context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
ComClassGenerator.cs (1)
32bool unsafeCodeIsEnabled = compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
ComInterfaceInfo.cs (1)
58if (env.Compilation.Options is not CSharpCompilationOptions { AllowUnsafe: true }) // Unsafe code enabled
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
126bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false };
Microsoft.Interop.JavaScript.JSImportGenerator (1)
Analyzers\JSImportExportDiagnosticsAnalyzer.cs (1)
79bool unsafeEnabled = context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
68bool unsafeEnabled = context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
126bool enableUnsafe = doc.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false };
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
59if (context.Compilation.Options is not CSharpCompilationOptions { AllowUnsafe: true })
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
212? new CompilationData(compilationOptions.AllowUnsafe, compilationOptions.CheckOverflow, langVersion)