-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.cs
More file actions
146 lines (132 loc) · 6.91 KB
/
Copy pathConfiguration.cs
File metadata and controls
146 lines (132 loc) · 6.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
namespace JSIL.Translator {
[Serializable]
public class Configuration {
[Serializable]
public sealed class AssemblyConfiguration {
public readonly List<string> TranslateAdditional = new List<string>();
public readonly List<string> Ignored = new List<string>();
public readonly List<string> Stubbed = new List<string>();
public readonly List<string> Proxies = new List<string>();
public readonly Dictionary<string, string> Redirects = new Dictionary<string, string>();
public void MergeInto (AssemblyConfiguration result) {
result.TranslateAdditional.AddRange(TranslateAdditional);
result.Ignored.AddRange(Ignored);
result.Stubbed.AddRange(Stubbed);
result.Proxies.AddRange(Proxies);
foreach (var kvp in Redirects)
result.Redirects[kvp.Key] = kvp.Value;
}
}
[Serializable]
public sealed class CodeGeneratorConfiguration {
public bool? EliminateStructCopies;
public bool? SimplifyOperators;
public bool? SimplifyLoops;
public bool? EliminateTemporaries;
public bool? EliminateRedundantControlFlow;
public bool? CacheMethodSignatures;
public bool? CacheGenericMethodSignatures;
public bool? CacheTypeExpressions;
public bool? CacheBaseMethodHandles;
public bool? EliminatePointlessFinallyBlocks;
public bool? PreferAccessorMethods;
public bool? HintIntegerArithmetic;
public bool? EnableThreadedTransforms;
public bool? FreezeImmutableObjects;
public bool? EnableUnsafeCode;
public bool? HoistAllocations;
public bool? HintDoubleArithmetic;
public bool? AutoGenerateEventAccessorsInSkeletons;
public bool? AggressivelyUseElementProxies;
public bool? EmitAllParameterNames;
public void MergeInto (CodeGeneratorConfiguration result) {
if (EliminateStructCopies.HasValue)
result.EliminateStructCopies = EliminateStructCopies;
if (EliminateTemporaries.HasValue)
result.EliminateTemporaries = EliminateTemporaries;
if (SimplifyLoops.HasValue)
result.SimplifyLoops = SimplifyLoops;
if (SimplifyOperators.HasValue)
result.SimplifyOperators = SimplifyOperators;
if (EliminateRedundantControlFlow.HasValue)
result.EliminateRedundantControlFlow = EliminateRedundantControlFlow;
if (CacheMethodSignatures.HasValue)
result.CacheMethodSignatures = CacheMethodSignatures;
if (CacheGenericMethodSignatures.HasValue)
result.CacheGenericMethodSignatures = CacheGenericMethodSignatures;
if (CacheTypeExpressions.HasValue)
result.CacheTypeExpressions = CacheTypeExpressions;
if (CacheBaseMethodHandles.HasValue)
result.CacheBaseMethodHandles = CacheBaseMethodHandles;
if (EliminatePointlessFinallyBlocks.HasValue)
result.EliminatePointlessFinallyBlocks = EliminatePointlessFinallyBlocks;
if (PreferAccessorMethods.HasValue)
result.PreferAccessorMethods = PreferAccessorMethods;
if (HintIntegerArithmetic.HasValue)
result.HintIntegerArithmetic = HintIntegerArithmetic;
if (FreezeImmutableObjects.HasValue)
result.FreezeImmutableObjects = FreezeImmutableObjects;
if (EnableUnsafeCode.HasValue)
result.EnableUnsafeCode = EnableUnsafeCode;
if (EnableThreadedTransforms.HasValue)
result.EnableThreadedTransforms = EnableThreadedTransforms;
if (HoistAllocations.HasValue)
result.HoistAllocations = HoistAllocations;
if (HintDoubleArithmetic.HasValue)
result.HintDoubleArithmetic = HintDoubleArithmetic;
if (AutoGenerateEventAccessorsInSkeletons.HasValue)
result.AutoGenerateEventAccessorsInSkeletons = AutoGenerateEventAccessorsInSkeletons;
if (AggressivelyUseElementProxies.HasValue)
result.AggressivelyUseElementProxies = AggressivelyUseElementProxies;
if (EmitAllParameterNames.HasValue)
result.EmitAllParameterNames = EmitAllParameterNames;
}
}
public bool? ApplyDefaults;
public bool? IncludeDependencies;
public bool? UseSymbols;
public bool? UseThreads;
public bool? UseDefaultProxies;
public bool? GenerateSkeletonsForStubbedAssemblies;
public bool? GenerateContentManifest;
public bool? RunBugChecks;
public bool? TuneGarbageCollection;
public string FilenameEscapeRegex;
public string AssemblyCollectionName;
public double? FrameworkVersion;
public readonly AssemblyConfiguration Assemblies = new AssemblyConfiguration();
public readonly CodeGeneratorConfiguration CodeGenerator = new CodeGeneratorConfiguration();
public virtual void MergeInto (Configuration result) {
if (ApplyDefaults.HasValue)
result.ApplyDefaults = ApplyDefaults;
if (IncludeDependencies.HasValue)
result.IncludeDependencies = IncludeDependencies;
if (UseSymbols.HasValue)
result.UseSymbols = UseSymbols;
if (UseThreads.HasValue)
result.UseThreads = UseThreads;
if (UseDefaultProxies.HasValue)
result.UseDefaultProxies = UseDefaultProxies;
if (FrameworkVersion.HasValue)
result.FrameworkVersion = FrameworkVersion;
if (GenerateSkeletonsForStubbedAssemblies.HasValue)
result.GenerateSkeletonsForStubbedAssemblies = GenerateSkeletonsForStubbedAssemblies;
if (GenerateContentManifest.HasValue)
result.GenerateContentManifest = GenerateContentManifest;
if (RunBugChecks.HasValue)
result.RunBugChecks = RunBugChecks;
if (TuneGarbageCollection.HasValue)
result.TuneGarbageCollection = TuneGarbageCollection;
if (FilenameEscapeRegex != null)
result.FilenameEscapeRegex = FilenameEscapeRegex;
if (AssemblyCollectionName != null)
result.AssemblyCollectionName = AssemblyCollectionName;
Assemblies.MergeInto(result.Assemblies);
CodeGenerator.MergeInto(result.CodeGenerator);
}
}
}