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

Added jitTracking option to the compiler to enable debugging without warnings

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