提交 cc2c9bb9 编写于 作者: O Omar Tawfik

Added jitTracking option to the compiler to enable debugging without warnings

上级 4bfc36df
......@@ -3692,12 +3692,13 @@ type ILGlobals with
mkILCustomAttribute this (mkSystemDiagnosticsDebuggableTypeRef this, [this.typ_Bool; this.typ_Bool], [ILAttribElem.Bool false; ILAttribElem.Bool jitOptimizerDisabled], [])
member this.mkDebuggableAttributeV2(ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) =
member this.mkDebuggableAttributeV2(jitTracking, ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) =
let tref = mkSystemDiagnosticsDebuggableTypeRef this
mkILCustomAttribute this
(tref,[mkILNonGenericValueTy (tref_DebuggableAttribute_DebuggingModes this)],
(* See System.Diagnostics.DebuggableAttribute.DebuggingModes *)
[ILAttribElem.Int32( (if jitOptimizerDisabled then 256 else 0) |||
[ILAttribElem.Int32( (if jitTracking then 1 else 0) |||
(if jitOptimizerDisabled then 256 else 0) |||
(if ignoreSymbolStoreSequencePoints then 2 else 0) |||
(if enableEnC then 4 else 0))],[])
......
......@@ -1624,7 +1624,7 @@ type ILGlobals =
with
member mkDebuggableAttribute: bool (* disable JIT optimizations *) -> ILAttribute
/// Some commonly used custom attibutes
member mkDebuggableAttributeV2 : bool (* ignoreSymbolStoreSequencePoints *) * bool (* disable JIT optimizations *) * bool (* enable EnC *) -> ILAttribute
member mkDebuggableAttributeV2 : bool (* jitTracking *) * bool (* ignoreSymbolStoreSequencePoints *) * bool (* disable JIT optimizations *) * bool (* enable EnC *) -> ILAttribute
member mkCompilerGeneratedAttribute : unit -> ILAttribute
member mkDebuggerNonUserCodeAttribute : unit -> ILAttribute
member mkDebuggerStepThroughAttribute : unit -> ILAttribute
......
......@@ -2063,6 +2063,7 @@ type TcConfigBuilder =
mutable onlyEssentialOptimizationData : bool
mutable useOptimizationDataFile : bool
mutable useSignatureDataFile : bool
mutable jitTracking : bool
mutable portablePDB : bool
mutable ignoreSymbolStoreSequencePoints : bool
mutable internConstantStrings : bool
......@@ -2232,6 +2233,7 @@ type TcConfigBuilder =
onlyEssentialOptimizationData = false
useOptimizationDataFile = false
useSignatureDataFile = false
jitTracking = true
portablePDB = true
ignoreSymbolStoreSequencePoints = false
internConstantStrings = true
......@@ -2713,6 +2715,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
member x.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData
member x.useOptimizationDataFile = data.useOptimizationDataFile
member x.useSignatureDataFile = data.useSignatureDataFile
member x.jitTracking = data.jitTracking
member x.portablePDB = data.portablePDB
member x.ignoreSymbolStoreSequencePoints = data.ignoreSymbolStoreSequencePoints
member x.internConstantStrings = data.internConstantStrings
......
......@@ -304,6 +304,7 @@ type TcConfigBuilder =
mutable onlyEssentialOptimizationData : bool
mutable useOptimizationDataFile : bool
mutable useSignatureDataFile : bool
mutable jitTracking : bool
mutable portablePDB : bool
mutable ignoreSymbolStoreSequencePoints : bool
mutable internConstantStrings : bool
......@@ -456,6 +457,7 @@ type TcConfig =
member onlyEssentialOptimizationData : bool
member useOptimizationDataFile : bool
member useSignatureDataFile : bool
member jitTracking : bool
member portablePDB : bool
member ignoreSymbolStoreSequencePoints : bool
member internConstantStrings : bool
......
......@@ -474,11 +474,11 @@ let SetDebugSwitch (tcConfigB : TcConfigBuilder) (dtype : string option) (s : Op
match dtype with
| Some(s) ->
match s with
| "portable" -> tcConfigB.portablePDB <- true
| "pdbonly" -> tcConfigB.portablePDB <- false
| "full" -> tcConfigB.portablePDB <- false
| "portable" -> tcConfigB.portablePDB <- true ; tcConfigB.jitTracking <- false
| "pdbonly" -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- false
| "full" -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- true
| _ -> error(Error(FSComp.SR.optsUnrecognizedDebugType(s), rangeCmdArgs))
| None -> tcConfigB.portablePDB <- false
| None -> tcConfigB.portablePDB <- false; tcConfigB.jitTracking <- s = OptionSwitch.On;
tcConfigB.debuginfo <- s = OptionSwitch.On
let setOutFileName tcConfigB s =
......@@ -520,6 +520,7 @@ let PrintOptionInfo (tcConfigB:TcConfigBuilder) =
printfn " doDetuple . . . . . . : %+A" tcConfigB.doDetuple
printfn " doTLR . . . . . . . . : %+A" tcConfigB.doTLR
printfn " doFinalSimplify. . . . : %+A" tcConfigB.doFinalSimplify
printfn " jitTracking . . . . . : %+A" tcConfigB.jitTracking
printfn " portablePDB. . . . . . : %+A" tcConfigB.portablePDB
printfn " debuginfo . . . . . . : %+A" tcConfigB.debuginfo
printfn " resolutionEnvironment : %+A" tcConfigB.resolutionEnvironment
......@@ -910,8 +911,8 @@ let deprecatedFlagsFsc tcConfigB =
cliRootFlag tcConfigB
CompilerOption("jit-optimize", tagNone, OptionUnit (fun _ -> tcConfigB.optSettings <- { tcConfigB.optSettings with jitOptUser = Some true }), Some(DeprecatedCommandLineOptionNoDescription("--jit-optimize", rangeCmdArgs)), None)
CompilerOption("no-jit-optimize", tagNone, OptionUnit (fun _ -> tcConfigB.optSettings <- { tcConfigB.optSettings with jitOptUser = Some false }), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-optimize", rangeCmdArgs)), None)
CompilerOption("jit-tracking", tagNone, OptionUnit (fun _ -> () ), Some(DeprecatedCommandLineOptionNoDescription("--jit-tracking", rangeCmdArgs)), None)
CompilerOption("no-jit-tracking", tagNone, OptionUnit (fun _ -> () ), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-tracking", rangeCmdArgs)), None)
CompilerOption("jit-tracking", tagNone, OptionUnit (fun _ -> (tcConfigB.jitTracking <- true) ), Some(DeprecatedCommandLineOptionNoDescription("--jit-tracking", rangeCmdArgs)), None)
CompilerOption("no-jit-tracking", tagNone, OptionUnit (fun _ -> (tcConfigB.jitTracking <- false) ), Some(DeprecatedCommandLineOptionNoDescription("--no-jit-tracking", rangeCmdArgs)), None)
CompilerOption("progress", tagNone, OptionUnit (fun () -> progress := true), Some(DeprecatedCommandLineOptionNoDescription("--progress", rangeCmdArgs)), None)
(compilingFsLibFlag tcConfigB)
(compilingFsLib20Flag tcConfigB)
......
......@@ -1054,7 +1054,7 @@ module MainModuleBuilder =
yield! iattrs
yield! codegenResults.ilAssemAttrs
if Option.isSome pdbfile then
yield (tcGlobals.ilg.mkDebuggableAttributeV2 (tcConfig.ignoreSymbolStoreSequencePoints, disableJitOptimizations, false (* enableEnC *) ))
yield (tcGlobals.ilg.mkDebuggableAttributeV2 (tcConfig.jitTracking, tcConfig.ignoreSymbolStoreSequencePoints, disableJitOptimizations, false (* enableEnC *) ))
yield! reflectedDefinitionAttrs ]
// Make the manifest of the assembly
......@@ -1068,6 +1068,7 @@ module MainModuleBuilder =
Some { man with Version= Some ver
CustomAttrs = manifestAttrs
DisableJitOptimizations=disableJitOptimizations
JitTracking= tcConfig.jitTracking
SecurityDecls=secDecls }
let resources =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册