@@ -36,29 +36,24 @@ open Microsoft.FSharp.Compiler.Infos
3636
3737open System.Collections .Generic
3838
39-
40-
41- let verboseOptimizationInfo =
4239#if BUILDING_ PROTO
40+ let verboseOptimizationInfo =
4341try not ( System.String.IsNullOrEmpty( System.Environment.GetEnvironmentVariable" FSHARP_verboseOptimizationInfo" )) with _ -> false
44- #else
45- false
46- #endif
4742let verboseOptimizations =
48- #if BUILDING_ PROTO
4943try not ( System.String.IsNullOrEmpty( System.Environment.GetEnvironmentVariable" FSHARP_verboseOptimizations" )) with _ -> false
5044#else
51- false
45+ let [<Literal>] verboseOptimizationInfo = false
46+ let [<Literal>] verboseOptimizations = false
5247#endif
5348
5449let i_ldlen = [ I_ ldlen; ( AI_ conv DT_ I4) ]
5550
56- let callSize = 1 // size of a function call
57- let forAndWhileLoopSize = 5 // size of a for/while loop
58- let tryCatchSize = 5 // size of a try/catch
59- let tryFinallySize = 5 // size of a try/finally
60- let closureTotalSize = 10 // Total cost of a closure. Each closure adds a class definition
61- let methodDefnTotalSize = 1 // Total cost of a method definition
51+ let [<Literal>] callSize = 1 // size of a function call
52+ let [<Literal>] forAndWhileLoopSize = 5 // size of a for/while loop
53+ let [<Literal>] tryCatchSize = 5 // size of a try/catch
54+ let [<Literal>] tryFinallySize = 5 // size of a try/finally
55+ let [<Literal>] closureTotalSize = 10 // Total cost of a closure. Each closure adds a class definition
56+ let [<Literal>] methodDefnTotalSize = 1 // Total cost of a method definition
6257
6358//-------------------------------------------------------------------------
6459// Partial information about an expression.
@@ -244,9 +239,9 @@ let BoundValueInfoBySize vinfo =
244239// What we know about the world
245240//-------------------------------------------------------------------------
246241
247- let jitOptDefault = true
248- let localOptDefault = true
249- let crossModuleOptDefault = true
242+ let [<Literal>] jitOptDefault = true
243+ let [<Literal>] localOptDefault = true
244+ let [<Literal>] crossModuleOptDefault = true
250245
251246type OptimizationSettings =
252247{ abstractBigTargets: bool ;
@@ -933,7 +928,7 @@ let mkAssemblyCodeValueInfo g instrs argvals tys =
933928// Size constants and combinators
934929//-------------------------------------------------------------------------
935930
936- let localVarSize = 1
931+ let [<Literal>] localVarSize = 1
937932
938933let rec AddTotalSizesAux acc l = match lwith [] -> acc| h:: t-> AddTotalSizesAux( h.TotalSize+ acc) t
939934let AddTotalSizes l = AddTotalSizesAux0 l
@@ -1209,7 +1204,7 @@ let AbstractAndRemapModulInfo msg g m (repackage,hidden) info =
12091204//-------------------------------------------------------------------------
12101205
12111206// Mark some variables (the ones we introduce via abstractBigTargets) as don't-eliminate
1212- let suffixForVariablesThatMayNotBeEliminated = " $cont"
1207+ let [<Literal>] suffixForVariablesThatMayNotBeEliminated = " $cont"
12131208
12141209/// Type applications of F# "type functions" may cause side effects, e.g.
12151210/// let x<'a> = printfn "hello"; typeof<'a>