227 references to Platform
Microsoft.CodeAnalysis (27)
Compilation\Compilation.cs (10)
2214
Platform
platform = compilationOptions.Platform;
2219
platform =
Platform
.AnyCpu;
2288
case
Platform
.Arm64:
2292
case
Platform
.Arm:
2296
case
Platform
.X64:
2300
case
Platform
.Itanium:
2304
case
Platform
.X86:
2308
case
Platform
.AnyCpu:
2309
case
Platform
.AnyCpu32BitPreferred:
2319
corFlags: GetCorHeaderFlags(machine, HasStrongName, prefers32Bit: platform ==
Platform
.AnyCpu32BitPreferred),
Compilation\CompilationOptions.cs (4)
132
public
Platform
Platform { get; protected set; }
280
Platform
platform,
438
public CompilationOptions WithPlatform(
Platform
platform)
531
protected abstract CompilationOptions CommonWithPlatform(
Platform
platform);
Compilation\Platform.cs (9)
47
internal static bool IsValid(this
Platform
value)
49
return value >=
Platform
.AnyCpu && value <=
Platform
.Arm64;
52
internal static bool Requires64Bit(this
Platform
value)
54
return value ==
Platform
.X64 || value ==
Platform
.Itanium || value ==
Platform
.Arm64;
57
internal static bool Requires32Bit(this
Platform
value)
59
return value ==
Platform
.X86;
Compilation\SubsystemVersion.cs (2)
154
internal static SubsystemVersion Default(OutputKind outputKind,
Platform
platform)
156
if (platform ==
Platform
.Arm)
Emit\EmitOptions.cs (1)
55
/// If the value is 0 the file alignment is determined based upon the value of <see cref="
Platform
"/>.
PEWriter\MetadataWriter.PortablePdb.cs (1)
923
var
platform = module.CommonCompilation.Options.Platform;
Microsoft.CodeAnalysis.CSharp (27)
CommandLine\CSharpCommandLineParser.cs (11)
97
Platform
platform =
Platform
.AnyCpu;
1833
private static
Platform
ParsePlatform(string value, IList<Diagnostic> diagnostics)
1838
return
Platform
.X86;
1840
return
Platform
.X64;
1842
return
Platform
.Itanium;
1844
return
Platform
.AnyCpu;
1846
return
Platform
.AnyCpu32BitPreferred;
1848
return
Platform
.Arm;
1850
return
Platform
.Arm64;
1855
return
Platform
.AnyCpu;
CSharpCompilationOptions.cs (11)
71
Platform
platform =
Platform
.AnyCpu,
121
Platform
platform,
166
Platform
platform,
208
Platform
platform,
453
public new CSharpCompilationOptions WithPlatform(
Platform
platform)
659
protected override CompilationOptions CommonWithPlatform(
Platform
platform) => WithPlatform(platform);
745
if (Platform ==
Platform
.AnyCpu32BitPreferred && OutputKind.IsValid() && !(OutputKind == OutputKind.ConsoleApplication || OutputKind == OutputKind.WindowsApplication || OutputKind == OutputKind.WindowsRuntimeApplication))
863
Platform
platform,
902
Platform
platform,
946
Platform
platform,
Symbols\Source\SourceModuleSymbol.cs (5)
92
case
Platform
.Arm:
94
case
Platform
.X64:
96
case
Platform
.Arm64:
98
case
Platform
.Itanium:
110
return DeclaringCompilation.Options.Platform ==
Platform
.X86;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (17)
CommandLineTests.cs (17)
4527
Assert.Equal(
Platform
.X64, parsedArgs.CompilationOptions.Platform);
4531
Assert.Equal(
Platform
.X86, parsedArgs.CompilationOptions.Platform);
4536
Assert.Equal(
Platform
.AnyCpu, parsedArgs.CompilationOptions.Platform);
4540
Assert.Equal(
Platform
.Itanium, parsedArgs.CompilationOptions.Platform);
4544
Assert.Equal(
Platform
.AnyCpu, parsedArgs.CompilationOptions.Platform);
4548
Assert.Equal(
Platform
.AnyCpu32BitPreferred, parsedArgs.CompilationOptions.Platform);
4552
Assert.Equal(
Platform
.Arm, parsedArgs.CompilationOptions.Platform);
4558
Assert.Equal(
Platform
.AnyCpu, parsedArgs.CompilationOptions.Platform); //anycpu is default
4564
Assert.Equal(
Platform
.AnyCpu, parsedArgs.CompilationOptions.Platform); //anycpu is default
11812
var csc32 = CreateCompilationWithMscorlib46(csc32src, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X86), assemblyName: "csc32");
12534
var list = new List<Tuple<string,
Platform
>>()
12536
Tuple.Create("x86",
Platform
.X86),
12537
Tuple.Create("x64",
Platform
.X64),
12538
Tuple.Create("itanium",
Platform
.Itanium),
12539
Tuple.Create("anycpu",
Platform
.AnyCpu),
12540
Tuple.Create("anycpu32bitpreferred",
Platform
.AnyCpu32BitPreferred),
12541
Tuple.Create("arm",
Platform
.Arm)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (85)
Emit\CompilationEmitTests.cs (51)
2035
WithPlatform(
Platform
.Arm64).
3486
var compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.AnyCpu));
3490
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X86));
3494
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X64));
3500
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.AnyCpu32BitPreferred));
3506
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.Arm));
3524
options: TestOptions.DebugDll.WithPlatform(
Platform
.X86));
3558
options: TestOptions.DebugDll.WithPlatform(
Platform
.X64));
3608
options: TestOptions.DebugDll.WithPlatform(
Platform
.Arm));
3648
options: TestOptions.ReleaseExe.WithPlatform(
Platform
.AnyCpu));
3689
var compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X64));
3772
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X86));
3777
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X86));
3782
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X86));
3786
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X64));
3791
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X64));
3796
compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithPlatform(
Platform
.X64));
4679
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium), assemblyName: "PlatformMismatch");
4693
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.AnyCpu));
4699
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.AnyCpu));
4705
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.AnyCpu));
4711
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.AnyCpu));
4717
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.X86));
4725
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.X86));
4733
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.X86));
4741
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.X86));
4764
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium), assemblyName: "PlatformMismatch");
4777
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.AnyCpu));
4785
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.X86));
4793
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.AnyCpu));
4809
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.X86), assemblyName: "PlatformMismatch");
4824
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4832
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4840
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
4848
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
4865
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.X86), assemblyName: "PlatformMismatch");
4879
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4896
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.AnyCpu), assemblyName: "PlatformMismatch");
4911
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4917
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4923
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
4929
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
4944
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.AnyCpu), assemblyName: "PlatformMismatch");
4958
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4973
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium), assemblyName: "PlatformMismatch");
4988
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
4994
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
5000
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
5006
parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium));
5021
var refCompilation = CreateEmptyCompilation(refSource, parseOptions: parseOptions, options: TestOptions.ReleaseModule.WithPlatform(
Platform
.Itanium), assemblyName: "PlatformMismatch");
5036
parseOptions: parseOptions, options: TestOptions.ReleaseDll.WithPlatform(
Platform
.Itanium));
Emit\DeterministicTests.cs (26)
29
private Guid CompiledGuid(string source, string assemblyName, bool debug,
Platform
platform =
Platform
.AnyCpu)
34
private Guid CompiledGuid(string source, string assemblyName, CSharpCompilationOptions options, EmitOptions emitOptions = null,
Platform
platform =
Platform
.AnyCpu)
51
private (ImmutableArray<byte> pe, ImmutableArray<byte> pdb) EmitDeterministic(string source,
Platform
platform, DebugInformationFormat pdbFormat, bool optimize)
131
var mvid1 = CompiledGuid(source, "X1", false,
Platform
.X86);
132
var mvid2 = CompiledGuid(source, "X1", false,
Platform
.X86);
135
var mvid3 = CompiledGuid(source, "X1", false,
Platform
.X64);
136
var mvid4 = CompiledGuid(source, "X1", false,
Platform
.X64);
139
var mvid5 = CompiledGuid(source, "X1", false,
Platform
.Arm64);
140
var mvid6 = CompiledGuid(source, "X1", false,
Platform
.Arm64);
152
var result1 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.X64, DebugInformationFormat.Embedded, optimize: false);
153
var result2 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.Arm64, DebugInformationFormat.Embedded, optimize: false);
218
var result1 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.AnyCpu32BitPreferred, pdbFormat, optimize: true);
219
var result2 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.AnyCpu32BitPreferred, pdbFormat, optimize: true);
223
var result3 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.X64, pdbFormat, optimize: true);
224
var result4 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.X64, pdbFormat, optimize: true);
228
var result5 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.Arm64, pdbFormat, optimize: true);
229
var result6 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.Arm64, pdbFormat, optimize: true);
245
var result1 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.AnyCpu32BitPreferred, pdbFormat, optimize: false);
246
var result2 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.AnyCpu32BitPreferred, pdbFormat, optimize: false);
250
var result3 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.X64, pdbFormat, optimize: false);
251
var result4 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.X64, pdbFormat, optimize: false);
255
var result5 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.Arm64, pdbFormat, optimize: false);
256
var result6 = EmitDeterministic(CompareAllBytesEmitted_Source,
Platform
.Arm64, pdbFormat, optimize: false);
477
.WithPlatform(
Platform
.AnyCpu)
Emit\EmitMetadataTests.cs (8)
2213
VerifyEmitWithNoResources(comp,
Platform
.AnyCpu);
2214
VerifyEmitWithNoResources(comp,
Platform
.AnyCpu32BitPreferred);
2215
VerifyEmitWithNoResources(comp,
Platform
.Arm); // broken before fix
2216
VerifyEmitWithNoResources(comp,
Platform
.Itanium); // broken before fix
2217
VerifyEmitWithNoResources(comp,
Platform
.X64); // broken before fix
2218
VerifyEmitWithNoResources(comp,
Platform
.X86);
2221
private void VerifyEmitWithNoResources(CSharpCompilation comp,
Platform
platform)
2424
options: TestOptions.DebugExe.WithPlatform(
Platform
.X64).WithDeterministic(true),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
320
platform:
Platform
.AnyCpu,
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScriptCompiler.cs (1)
64
platform:
Platform
.AnyCpu,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Compilation\CSharpCompilationOptionsTests.cs (10)
83
TestHiddenProperty((old, value) => old.WithPlatform(value), opt => opt.Platform,
Platform
.Itanium);
121
TestProperty((old, value) => old.WithPlatform(value), opt => opt.Platform,
Platform
.Itanium);
184
new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithPlatform((
Platform
)Int32.MaxValue).VerifyErrors(
188
new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithPlatform((
Platform
)Int32.MinValue).VerifyErrors(
334
new CSharpCompilationOptions(OutputKind.ConsoleApplication, platform: (
Platform
)Int32.MinValue).VerifyErrors(
345
new CSharpCompilationOptions(OutputKind.ConsoleApplication, platform:
Platform
.AnyCpu32BitPreferred).VerifyErrors();
347
new CSharpCompilationOptions(OutputKind.WindowsRuntimeApplication, platform:
Platform
.AnyCpu32BitPreferred).VerifyErrors();
349
new CSharpCompilationOptions(OutputKind.WindowsRuntimeMetadata, platform:
Platform
.AnyCpu32BitPreferred).VerifyErrors(
352
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, platform:
Platform
.AnyCpu32BitPreferred).VerifyErrors(
398
Platform
platform = 0;
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
517
ProjectSettingKind.Platform => (oldOptions.WithPlatform(
Platform
.Arm64), "AnyCpu", "Arm64"),
Microsoft.CodeAnalysis.Rebuild (4)
CompilationFactory.cs (4)
208
protected static
Platform
GetPlatform(string? platform)
210
?
Platform
.AnyCpu
211
: (
Platform
)Enum.Parse(typeof(
Platform
), platform);
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
OptionRoundTripTests.cs (4)
33
public static readonly object[][] Platforms = ((
Platform
[])Enum.GetValues(typeof(
Platform
))).Select(p => new[] { (object)p }).ToArray();
37
public void Platform_RoundTrip(
Platform
platform)
49
public void Platform_RoundTrip_VB(
Platform
platform)
Microsoft.CodeAnalysis.VisualBasic (27)
CommandLine\VisualBasicCommandLineParser.vb (11)
143
Dim platform As
Platform
=
Platform
.AnyCpu
2163
Private Shared Function ParsePlatform(name As String, value As String, errors As List(Of Diagnostic)) As
Platform
2169
Return
Platform
.X86
2171
Return
Platform
.X64
2173
Return
Platform
.Itanium
2175
Return
Platform
.AnyCpu
2177
Return
Platform
.AnyCpu32BitPreferred
2179
Return
Platform
.Arm
2181
Return
Platform
.Arm64
2187
Return
Platform
.AnyCpu
Symbols\Source\SourceModuleSymbol.vb (5)
107
Case
Platform
.Arm64
109
Case
Platform
.Arm
111
Case
Platform
.X64
113
Case
Platform
.Itanium
123
Return DeclaringCompilation.Options.Platform =
Platform
.X86
VisualBasicCompilationOptions.vb (11)
87
Optional platform As
Platform
=
Platform
.AnyCpu,
164
platform As
Platform
,
233
platform As
Platform
,
787
Public Shadows Function WithPlatform(value As
Platform
) As VisualBasicCompilationOptions
987
Protected Overrides Function CommonWithPlatform(platform As
Platform
) As CompilationOptions
1066
If Platform =
Platform
.AnyCpu32BitPreferred AndAlso OutputKind.IsValid() AndAlso
1163
platform As
Platform
,
1228
platform As
Platform
,
1294
Optional platform As
Platform
=
Platform
.AnyCpu,
Microsoft.CodeAnalysis.Workspaces (3)
Serialization\AbstractOptionsSerializationService.cs (3)
89
Platform
platform,
124
var
platform = (
Platform
)reader.ReadInt32();
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (10)
VisualStudioMSBuildWorkspaceTests.cs (10)
500
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
515
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
529
Assert.Equal(
Platform
.AnyCpu32BitPreferred, compilation.Options.Platform);
544
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
559
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
624
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
639
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
653
Assert.Equal(
Platform
.AnyCpu32BitPreferred, compilation.Options.Platform);
668
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
683
Assert.Equal(
Platform
.AnyCpu, compilation.Options.Platform);
Microsoft.VisualStudio.LanguageServices (7)
Interactive\VsResetInteractive.cs (7)
166
private static InteractiveHostPlatform? GetInteractiveHostPlatform(string targetFrameworkMoniker,
Platform
platform)
176
case
Platform
.Arm:
177
case
Platform
.AnyCpu32BitPreferred:
178
case
Platform
.X86:
181
case
Platform
.Itanium:
182
case
Platform
.X64:
183
case
Platform
.Arm64:
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (2)
127
if (!Enum.TryParse(GetStringOption(CompilerOptions.OPTID_PLATFORM, ""), ignoreCase: true, result: out
Platform
platform))
129
platform =
Platform
.AnyCpu;
Microsoft.VisualStudio.LanguageServices.Implementation (1)
ProjectSystem\CPS\TempPECompiler.cs (1)
69
.WithPlatform(
Platform
.AnyCpu)