Skip to content

Commit cf9a87d

Browse files
committed
tests+xlf
1 parent 45771ab commit cf9a87d

22 files changed

+131
-25
lines changed

src/Compiler/Driver/CompilerConfig.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ type TcConfigBuilder =
458458
mutable metadataVersion: string option
459459
mutable standalone: bool
460460
mutable extraStaticLinkRoots: string list
461+
mutable compressMetadata: bool
461462
mutable noSignatureData: bool
462463
mutable onlyEssentialOptimizationData: bool
463464
mutable useOptimizationDataFile: bool
@@ -682,6 +683,7 @@ type TcConfigBuilder =
682683
metadataVersion = None
683684
standalone = false
684685
extraStaticLinkRoots = []
686+
compressMetadata = false
685687
noSignatureData = false
686688
onlyEssentialOptimizationData = false
687689
useOptimizationDataFile = false
@@ -1230,6 +1232,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
12301232
member _.metadataVersion = data.metadataVersion
12311233
member _.standalone = data.standalone
12321234
member _.extraStaticLinkRoots = data.extraStaticLinkRoots
1235+
member _.compressMetadata = data.compressMetadata
12331236
member _.noSignatureData = data.noSignatureData
12341237
member _.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData
12351238
member _.useOptimizationDataFile = data.useOptimizationDataFile

src/Compiler/Driver/CompilerConfig.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ type TcConfigBuilder =
331331

332332
mutable extraStaticLinkRoots: string list
333333

334+
mutable compressMetadata: bool
335+
334336
mutable noSignatureData: bool
335337

336338
mutable onlyEssentialOptimizationData: bool
@@ -647,6 +649,8 @@ type TcConfig =
647649

648650
member extraStaticLinkRoots: string list
649651

652+
member compressMetadata: bool
653+
650654
member noSignatureData: bool
651655

652656
member onlyEssentialOptimizationData: bool

src/Compiler/Driver/CompilerImports.fs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,12 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu
154154
// For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers
155155
// don't complain when they see the resource.
156156
let rName, compress =
157-
match tcConfig.signatureData with
158-
| SignatureDataOptions.Compress -> FSharpSignatureCompressDataResourceName, true
159-
| _ ->
160-
if ccu.AssemblyName = getFSharpCoreLibraryName then
161-
FSharpSignatureDataResourceName2, false
162-
else
163-
FSharpSignatureDataResourceName, false
157+
if tcConfig.compressMetadata then
158+
FSharpSignatureCompressDataResourceName, true
159+
elif ccu.AssemblyName = getFSharpCoreLibraryName then
160+
FSharpSignatureDataResourceName2, false
161+
else
162+
FSharpSignatureDataResourceName, false
164163

165164
let includeDir =
166165
if String.IsNullOrEmpty tcConfig.implicitIncludeDir then
@@ -191,13 +190,12 @@ let WriteOptimizationData (tcConfig: TcConfig, tcGlobals, fileName, inMem, ccu:
191190
// For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers
192191
// don't complain when they see the resource.
193192
let rName, compress =
194-
match tcConfig.optimizationData with
195-
| OptimizationDataOptions.Compress -> FSharpOptimizationCompressDataResourceName, true
196-
| _ ->
197-
if ccu.AssemblyName = getFSharpCoreLibraryName then
198-
FSharpOptimizationDataResourceName2, false
199-
else
200-
FSharpOptimizationDataResourceName, false
193+
if tcConfig.compressMetadata then
194+
FSharpOptimizationCompressDataResourceName, true
195+
elif ccu.AssemblyName = getFSharpCoreLibraryName then
196+
FSharpOptimizationDataResourceName2, false
197+
else
198+
FSharpOptimizationDataResourceName, false
201199

202200
PickleToResource inMem fileName tcGlobals compress ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo
203201

@@ -220,7 +218,7 @@ let EncodeOptimizationData (tcGlobals, tcConfig: TcConfig, outfile, exportRemapp
220218
let data = map2Of2 (Optimizer.RemapOptimizationInfo tcGlobals exportRemapping) data
221219

222220
let ccu, optData =
223-
if tcConfig.optimizationData = OptimizationDataOptions.None then
221+
if tcConfig.onlyEssentialOptimizationData then
224222
map2Of2 Optimizer.AbstractOptimizationInfoToEssentials data
225223
else
226224
data

src/Compiler/Driver/CompilerOptions.fs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,14 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) =
922922
Some(FSComp.SR.optsPlatform ())
923923
)
924924

925+
CompilerOption(
926+
"compressmetadata",
927+
tagNone,
928+
OptionUnit(fun () -> tcConfigB.compressMetadata <- false),
929+
None,
930+
Some(FSComp.SR.optsCompressMetadata ())
931+
)
932+
925933
CompilerOption(
926934
"nooptimizationdata",
927935
tagNone,

src/Compiler/FSComp.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ optsPublicSign,"Public-sign the assembly using only the public portion of the st
847847
optsWriteXml,"Write the xmldoc of the assembly to the given file"
848848
optsStrongKeyFile,"Specify a strong name key file"
849849
optsStrongKeyContainer,"Specify a strong name key container"
850+
optsCompressMetadata,"Compress interface and optimization data files"
850851
optsPlatform,"Limit which platforms this code can run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu."
851852
optsNoOpt,"Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility."
852853
optsNoInterface,"Don't add a resource to the generated assembly containing F#-specific metadata"

src/Compiler/xlf/FSComp.txt.cs.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
<target state="translated">Vymazat mezipaměť výsledků správce balíčků</target>
473473
<note />
474474
</trans-unit>
475+
<trans-unit id="optsCompressMetadata">
476+
<source>Compress interface and optimization data files</source>
477+
<target state="new">Compress interface and optimization data files</target>
478+
<note />
479+
</trans-unit>
475480
<trans-unit id="optsInvalidRefAssembly">
476481
<source>Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together.</source>
477482
<target state="translated">Neplatné použití generování referenčního sestavení, nepoužívejte --staticlink ani --refonly a --refout společně.</target>

src/Compiler/xlf/FSComp.txt.de.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
<target state="translated">Löschen Sie den Ergebniscache des Paketmanagers</target>
473473
<note />
474474
</trans-unit>
475+
<trans-unit id="optsCompressMetadata">
476+
<source>Compress interface and optimization data files</source>
477+
<target state="new">Compress interface and optimization data files</target>
478+
<note />
479+
</trans-unit>
475480
<trans-unit id="optsInvalidRefAssembly">
476481
<source>Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together.</source>
477482
<target state="translated">Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht "--staticlink" oder "--refonly" und "--refout" zusammen.</target>

src/Compiler/xlf/FSComp.txt.es.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
<target state="translated">Borrar la caché de resultados del administrador de paquetes</target>
473473
<note />
474474
</trans-unit>
475+
<trans-unit id="optsCompressMetadata">
476+
<source>Compress interface and optimization data files</source>
477+
<target state="new">Compress interface and optimization data files</target>
478+
<note />
479+
</trans-unit>
475480
<trans-unit id="optsInvalidRefAssembly">
476481
<source>Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together.</source>
477482
<target state="translated">Uso no válido de emitir un ensamblado de referencia, no use "--staticlink', or '--refonly' and '--refout" de forma conjunta.</target>

src/Compiler/xlf/FSComp.txt.fr.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
<target state="translated">Effacer le cache des résultats du Gestionnaire de package</target>
473473
<note />
474474
</trans-unit>
475+
<trans-unit id="optsCompressMetadata">
476+
<source>Compress interface and optimization data files</source>
477+
<target state="new">Compress interface and optimization data files</target>
478+
<note />
479+
</trans-unit>
475480
<trans-unit id="optsInvalidRefAssembly">
476481
<source>Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together.</source>
477482
<target state="translated">Utilisation non valide de l’émission d’un assembly de référence. N’utilisez pas '--staticlink' ni '--refonly' et '--refout' ensemble.</target>

src/Compiler/xlf/FSComp.txt.it.xlf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
<target state="translated">Cancellare la cache dei risultati di Gestione pacchetti</target>
473473
<note />
474474
</trans-unit>
475+
<trans-unit id="optsCompressMetadata">
476+
<source>Compress interface and optimization data files</source>
477+
<target state="new">Compress interface and optimization data files</target>
478+
<note />
479+
</trans-unit>
475480
<trans-unit id="optsInvalidRefAssembly">
476481
<source>Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together.</source>
477482
<target state="translated">Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--staticlink' o '--refonly' e '--refout'.</target>

0 commit comments

Comments
 (0)