3 writes to OptimizationLevel
Microsoft.CodeAnalysis (1)
Compilation\CompilationOptions.cs (1)
311this.OptimizationLevel = optimizationLevel;
Microsoft.CodeAnalysis.CSharp (1)
CSharpCompilationOptions.cs (1)
390return new CSharpCompilationOptions(this) { OptimizationLevel = value };
Microsoft.CodeAnalysis.VisualBasic (1)
VisualBasicCompilationOptions.vb (1)
897Return New VisualBasicCompilationOptions(Me) With {.OptimizationLevel = value}
84 references to OptimizationLevel
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
CSharpCompilerTest.cs (2)
65Assert.Equal(expected, compilationOptions.OptimizationLevel); 97Assert.Equal(OptimizationLevel.Debug, compilationOptions.OptimizationLevel);
Microsoft.CodeAnalysis (6)
Compilation\CompilationOptions.cs (4)
357return OptimizationLevel == OptimizationLevel.Debug; 637this.OptimizationLevel == other.OptimizationLevel && 684Hash.Combine((int)this.OptimizationLevel,
Compilation\DeterministicKeyBuilder.cs (1)
452writer.Write("optimizationLevel", options.OptimizationLevel);
PEWriter\MetadataWriter.PortablePdb.cs (1)
916var optimizationLevel = module.CommonCompilation.Options.OptimizationLevel;
Microsoft.CodeAnalysis.CSharp (20)
CSharpCompilationOptions.cs (5)
237optimizationLevel: other.OptimizationLevel, 385if (value == this.OptimizationLevel) 695if (!OptimizationLevel.IsValid()) 697builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(OptimizationLevel), OptimizationLevel.ToString()));
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (1)
95if (compilationState.Compilation.Options.OptimizationLevel == OptimizationLevel.Release)
Lowering\LocalRewriter\LocalRewriter.cs (1)
762bool optimize = _compilation.Options.OptimizationLevel == OptimizationLevel.Release;
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
761this._factory.Compilation.Options.OptimizationLevel == OptimizationLevel.Release &&
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
47GenerateInstrumentation && _localRewriter._compilation.Options.OptimizationLevel != OptimizationLevel.Release;
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
22var optimizing = _compilation.Options.OptimizationLevel == OptimizationLevel.Release;
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
114if (compilation.Options.OptimizationLevel != OptimizationLevel.Release)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (3)
147F.Compilation.Options.OptimizationLevel == OptimizationLevel.Release) 530if (F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug) 680if (F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (2)
146bool isDebugBuild = F.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug; 274var optimizationLevel = F.Compilation.Options.OptimizationLevel;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
167if (Manager.Compilation.Options.OptimizationLevel == OptimizationLevel.Debug)
Symbols\Compilation_WellKnownMembers.cs (3)
490if (Options.OptimizationLevel != OptimizationLevel.Debug) 504if (Options.OptimizationLevel != OptimizationLevel.Debug) 734if (_options.OptimizationLevel == OptimizationLevel.Debug)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (10)
CommandLineTests.cs (10)
2560Assert.Equal(new CSharpCompilationOptions(OutputKind.ConsoleApplication).OptimizationLevel, parsedArgs.CompilationOptions.OptimizationLevel); 2564Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel); 2568Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel); 2572Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel); 2576Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel); 2588Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel); 2591Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel); 2594Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel); 2597Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\PatternTests.cs (5)
3554if (options.OptimizationLevel == OptimizationLevel.Debug) 3636if (options.OptimizationLevel == OptimizationLevel.Debug) 3708if (options.OptimizationLevel == OptimizationLevel.Debug) 3784if (options.OptimizationLevel == OptimizationLevel.Debug) 4332if (compilationOptions.OptimizationLevel == OptimizationLevel.Debug)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
Attributes\AttributeTests_Synthesized.cs (13)
295if (options.OptimizationLevel == OptimizationLevel.Debug) 486AssertEx.SetEqual(options.OptimizationLevel == OptimizationLevel.Debug ? 996VerifyDebuggableAttribute(attributes[2], options.OptimizationLevel, isSynthesized: true); 1030VerifyDebuggableAttribute(attributes[1], options.OptimizationLevel, isSynthesized: true); 1065VerifyDebuggableAttribute(attributes[1], options.OptimizationLevel, isSynthesized: true); 1101VerifyDebuggableAttribute(attributes[2], options.OptimizationLevel, isSynthesized: false); 1140VerifyDebuggableAttribute(attributes[2], options.OptimizationLevel, isSynthesized: false); 1174VerifyDebuggableAttribute(attributes[0], options.OptimizationLevel, isSynthesized: true); 1214VerifyDebuggableAttribute(assemblyAttributes[2], options.OptimizationLevel, isSynthesized: true); 1238VerifyDebuggableAttribute(module.GetAttributes().Single(), options.OptimizationLevel, isSynthesized: false); 1252VerifyDebuggableAttribute(assemblyAttributes[2], options.OptimizationLevel, isSynthesized: true); 1546VerifyDebuggableAttribute(attributes[1], options.OptimizationLevel, isSynthesized: true); 1587VerifyDebuggableAttribute(attributes[1], options.OptimizationLevel, isSynthesized: true);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\CSharpCompilationOptionsTests.cs (2)
77TestHiddenProperty((old, value) => old.WithOptimizationLevel(value), opt => opt.OptimizationLevel, OptimizationLevel.Release); 114TestProperty((old, value) => old.WithOptimizationLevel(value), opt => opt.OptimizationLevel, OptimizationLevel.Release);
Microsoft.CodeAnalysis.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
275Assert.Equal(scriptOptions.OptimizationLevel, compilation.Options.OptimizationLevel);
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\CompilationExtensions.cs (1)
64if (pdbStream == null && compilation.Options.OptimizationLevel == OptimizationLevel.Debug && options?.DebugInformationFormat != DebugInformationFormat.Embedded)
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
70(compilationOptions.OptimizationLevel, compilationOptions.DebugPlusMode),
Microsoft.CodeAnalysis.VisualBasic (15)
Analysis\IteratorAndAsyncAnalysis\IteratorAndAsyncCaptureWalker.vb (2)
77If info.Compilation.Options.OptimizationLevel <> OptimizationLevel.Release Then 145ElseIf compilation.Options.OptimizationLevel = OptimizationLevel.Release Then
Lowering\LocalRewriter\LocalRewriter.vb (1)
145Return Me.Compilation.Options.OptimizationLevel = OptimizationLevel.Debug
Lowering\StateMachineRewriter\StateMachineRewriter.vb (2)
167Dim isDebugBuild As Boolean = F.Compilation.Options.OptimizationLevel = OptimizationLevel.Debug 293If Not local.SynthesizedKind.IsSlotReusable(F.Compilation.Options.OptimizationLevel) Then
Symbols\Source\SourceAssemblySymbol.vb (1)
1597If options.OptimizationLevel = OptimizationLevel.Debug Then
Symbols\WellKnownMembers.vb (4)
254If Options.OptimizationLevel <> OptimizationLevel.Debug Then 266If Options.OptimizationLevel <> OptimizationLevel.Debug Then 282If Options.OptimizationLevel <> OptimizationLevel.Debug Then 290If Options.OptimizationLevel <> OptimizationLevel.Debug Then
VisualBasicCompilationOptions.vb (5)
312optimizationLevel:=other.OptimizationLevel, 889''' Creates a new <see cref="VisualBasicCompilationOptions"/> instance with a specified <see cref="VisualBasicCompilationOptions.OptimizationLevel"/>. 893If value = Me.OptimizationLevel Then 1046If Not OptimizationLevel.IsValid() Then 1047builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(OptimizationLevel), OptimizationLevel.ToString()))
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (5)
CommandLineTests.vb (5)
1691Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel) 1695Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel) ' default 1699Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel) 1703Assert.Equal(OptimizationLevel.Debug, parsedArgs.CompilationOptions.OptimizationLevel) 1707Assert.Equal(OptimizationLevel.Release, parsedArgs.CompilationOptions.OptimizationLevel)
Microsoft.CodeAnalysis.Workspaces (1)
Serialization\AbstractOptionsSerializationService.cs (1)
33writer.WriteInt32((int)options.OptimizationLevel);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
1539await AssertCSCompilationOptionsAsync(OptimizationLevel.Release, options => options.OptimizationLevel); 1546await AssertCSCompilationOptionsAsync(OptimizationLevel.Debug, options => options.OptimizationLevel);