Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d4b8d9c
cleanup changes, squash
dsyme Jan 25, 2022
f6c016c
preserve debug points in optimization
dsyme Jan 25, 2022
c25755d
fix baselines
dsyme Jan 25, 2022
59d8a0e
fix build
dsyme Jan 25, 2022
1b49976
Merge branch 'misc5' of https://github.com/dsyme/fsharp into misc5
dsyme Jan 26, 2022
157c240
Merge branch 'main' of https://github.com/dotnet/fsharp into misc5
dsyme Jan 27, 2022
190d2a5
update tests
dsyme Jan 27, 2022
8e327e9
simplify 'when' debug points and add debug points on conditional logic
dsyme Jan 27, 2022
d04c98a
fix tests
dsyme Jan 27, 2022
e8dc382
unwind async changes
dsyme Jan 27, 2022
10d18fe
unwind async changes
dsyme Jan 27, 2022
5362215
revert changes to async
dsyme Jan 27, 2022
0d5656f
remove false extra debug points from computation expressions
dsyme Jan 27, 2022
505e296
fix debug points on while of computation expressions
dsyme Jan 27, 2022
9941dd9
fix test
dsyme Jan 28, 2022
963d976
merge main
dsyme Feb 3, 2022
ebfd31b
fix debug points in classes
dsyme Feb 3, 2022
f60f9bf
fix debug points in classes
dsyme Feb 3, 2022
4ab2e76
fix surface area
dsyme Feb 4, 2022
f99cebb
Merge branch 'main' of https://github.com/dotnet/fsharp into misc5
dsyme Feb 4, 2022
0812139
add back __debugPoint for 'in' for for loops in tasks and CEs
dsyme Feb 4, 2022
43099da
fix ValidateBreakpointLocation for pipe and boolean logic
dsyme Feb 4, 2022
28fff66
update baselines
dsyme Feb 4, 2022
5d454ae
better debug points for yield/return
dsyme Feb 4, 2022
6257066
update surface area
dsyme Feb 4, 2022
e61c326
fix minor issues
dsyme Feb 4, 2022
56e4c10
remove attempt at extra attribute generation
dsyme Feb 4, 2022
80c02c3
fix failing test
dsyme Feb 4, 2022
a3e5b77
update baselines
dsyme Feb 4, 2022
ea4cbf5
walkthrough tweaks
dsyme Feb 4, 2022
8d755b0
fix baseline
dsyme Feb 6, 2022
0e4a486
Merge branch 'main' into misc5
dsyme Feb 7, 2022
b5ef766
fix build
dsyme Feb 7, 2022
af60131
Merge branch 'main' of https://github.com/dotnet/fsharp into misc5
dsyme Feb 7, 2022
f3aa467
try fix test
dsyme Feb 7, 2022
f7c02be
try fix test
dsyme Feb 7, 2022
03579cc
try fix test
dsyme Feb 7, 2022
af2e9ed
minimise diff
dsyme Feb 7, 2022
bcc276d
minimise diff
dsyme Feb 7, 2022
49aa34e
minimise diff
dsyme Feb 7, 2022
5590570
update docs
dsyme Feb 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 133 additions & 109 deletions docs/debug-emit.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ This document contains current and historical release notes information. They ar

These release notes track our current efforts to document changes to the F# project over time. They are split into the language, core library, compiler/tools, and compiler service.

### FSharp Compiler Service (main)

* Some syntax tree nodes have changed, e.g. introduction of SyntaxTree trivia
* Resolved expressions (FSharpExpr) now reveal debug points, you must match them explicitly using `DebugPoint(dp, expr)`
* Some node types in FSharpExpr (e.g. Let, While, TryFinally, TryWith) reveal additional debug points
* In FSharpExpr, FastIntegerForLoop has been renamed to IntegerForLoop

### F# 6.0 / Visual Studio 17.0


Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let rec private evalILAttribElem e =
| ILAttribElem.TypeRef None -> null

let rec private evalFSharpAttribArg g e =
match e with
match stripDebugPoints e with
| Expr.Const (c, _, _) ->
match c with
| Const.Bool b -> box b
Expand Down
56 changes: 28 additions & 28 deletions src/fsharp/AugmentWithHashCompare.fs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ let mkCompareTestConjuncts g m exprs =
(a, b) ||> List.foldBack (fun e acc ->
let nv, ne = mkCompGenLocal m "n" g.int_ty
mkCompGenLet m nv e
(mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.int_ty
(mkCond DebugPointAtBinding.NoneAtSticky m g.int_ty
(mkClt g m ne (mkZero g m))
ne
(mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.int_ty
(mkCond DebugPointAtBinding.NoneAtSticky m g.int_ty
(mkCgt g m ne (mkZero g m))
ne
acc)))
Expand All @@ -172,7 +172,7 @@ let mkEqualsTestConjuncts g m exprs =
| [h] -> h
| l ->
let a, b = List.frontAndBack l
List.foldBack (fun e acc -> mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.bool_ty e acc (mkFalse g m)) a b
List.foldBack (fun e acc -> mkCond DebugPointAtBinding.NoneAtSticky m g.bool_ty e acc (mkFalse g m)) a b

let mkMinimalTy (g: TcGlobals) (tcref: TyconRef) =
if tcref.Deref.IsExceptionDecl then [], g.exn_ty
Expand Down Expand Up @@ -304,9 +304,9 @@ let mkExnEquality (g: TcGlobals) exnref (exnc: Tycon) =
let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m )
let cases =
[ mkCase(DecisionTreeTest.IsInst(g.exn_ty, mkAppTy exnref []),
mbuilder.AddResultTarget(expr, DebugPointAtTarget.No)) ]
let dflt = Some(mbuilder.AddResultTarget(mkFalse g m, DebugPointAtTarget.No))
let dtree = TDSwitch(DebugPointAtSwitch.No, thate, cases, dflt, m)
mbuilder.AddResultTarget(expr)) ]
let dflt = Some(mbuilder.AddResultTarget(mkFalse g m))
let dtree = TDSwitch(thate, cases, dflt, m)
mbuilder.Close(dtree, m, g.bool_ty)

let expr = mkBindThatNullEquals g m thise thate expr
Expand All @@ -327,9 +327,9 @@ let mkExnEqualityWithComparer g exnref (exnc: Tycon) (_thisv, thise) thatobje (t
let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m )
let cases =
[ mkCase(DecisionTreeTest.IsInst(g.exn_ty, mkAppTy exnref []),
mbuilder.AddResultTarget(expr, DebugPointAtTarget.No)) ]
let dflt = mbuilder.AddResultTarget(mkFalse g m, DebugPointAtTarget.No)
let dtree = TDSwitch(DebugPointAtSwitch.No, thate, cases, Some dflt, m)
mbuilder.AddResultTarget(expr)) ]
let dflt = mbuilder.AddResultTarget(mkFalse g m)
let dtree = TDSwitch(thate, cases, Some dflt, m)
mbuilder.Close(dtree, m, g.bool_ty)
let expr = mkBindThatAddr g m g.exn_ty thataddrv thatv thate expr
let expr = mkIsInstConditional g m g.exn_ty thatobje thatv expr (mkFalse g m)
Expand Down Expand Up @@ -367,19 +367,19 @@ let mkUnionCompare g tcref (tycon: Tycon) =
mkCompGenLet m thisucv (mkUnionCaseProof (thise, cref, tinst, m))
(mkCompGenLet m thatucv (mkUnionCaseProof (thataddre, cref, tinst, m))
(mkCompareTestConjuncts g m (List.mapi (mkTest thisucve thatucve) rfields)))
Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test, DebugPointAtTarget.No)))
Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test)))

let nullary, nonNullary = List.partition Option.isNone (List.map mkCase ucases)
if isNil nonNullary then mkZero g m else
let cases = nonNullary |> List.map (function Some c -> c | None -> failwith "mkUnionCompare")
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkZero g m, DebugPointAtTarget.No))
let dtree = TDSwitch(DebugPointAtSwitch.No, thise, cases, dflt, m)
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkZero g m))
let dtree = TDSwitch(thise, cases, dflt, m)
mbuilder.Close(dtree, m, g.int_ty)

let expr =
if ucases.Length = 1 then expr else
let tagsEqTested =
mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.int_ty
mkCond DebugPointAtBinding.NoneAtSticky m g.int_ty
(mkILAsmCeq g m thistage thattage)
expr
(mkAsmExpr ([ AI_sub ], [], [thistage; thattage], [g.int_ty], m))in
Expand Down Expand Up @@ -428,19 +428,19 @@ let mkUnionCompareWithComparer g tcref (tycon: Tycon) (_thisv, thise) (_thatobjv
(mkCompGenLet m thatucv (mkUnionCaseProof (thataddre, cref, tinst, m))
(mkCompareTestConjuncts g m (List.mapi (mkTest thisucve thatucve) rfields)))

Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test, DebugPointAtTarget.No)))
Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test)))

let nullary, nonNullary = List.partition Option.isNone (List.map mkCase ucases)
if isNil nonNullary then mkZero g m else
let cases = nonNullary |> List.map (function Some c -> c | None -> failwith "mkUnionCompare")
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkZero g m, DebugPointAtTarget.No))
let dtree = TDSwitch(DebugPointAtSwitch.No, thise, cases, dflt, m)
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkZero g m))
let dtree = TDSwitch(thise, cases, dflt, m)
mbuilder.Close(dtree, m, g.int_ty)

let expr =
if ucases.Length = 1 then expr else
let tagsEqTested =
mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.int_ty
mkCond DebugPointAtBinding.NoneAtSticky m g.int_ty
(mkILAsmCeq g m thistage thattage)
expr
(mkAsmExpr ([ AI_sub ], [], [thistage; thattage], [g.int_ty], m))
Expand Down Expand Up @@ -488,19 +488,19 @@ let mkUnionEquality g tcref (tycon: Tycon) =
(mkCompGenLet m thatucv (mkUnionCaseProof (thataddre, cref, tinst, m))
(mkEqualsTestConjuncts g m (List.mapi (mkTest thisucve thatucve) rfields)))

Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test, DebugPointAtTarget.No)))
Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget(test)))

let nullary, nonNullary = List.partition Option.isNone (List.map mkCase ucases)
if isNil nonNullary then mkTrue g m else
let cases = List.map (function Some c -> c | None -> failwith "mkUnionEquality") nonNullary
let dflt = (if isNil nullary then None else Some (mbuilder.AddResultTarget(mkTrue g m, DebugPointAtTarget.No)))
let dtree = TDSwitch(DebugPointAtSwitch.No, thise, cases, dflt, m)
let dflt = (if isNil nullary then None else Some (mbuilder.AddResultTarget(mkTrue g m)))
let dtree = TDSwitch(thise, cases, dflt, m)
mbuilder.Close(dtree, m, g.bool_ty)

let expr =
if ucases.Length = 1 then expr else
let tagsEqTested =
mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.bool_ty
mkCond DebugPointAtBinding.NoneAtSticky m g.bool_ty
(mkILAsmCeq g m thistage thattage)
expr
(mkFalse g m)
Expand Down Expand Up @@ -550,19 +550,19 @@ let mkUnionEqualityWithComparer g tcref (tycon: Tycon) (_thisv, thise) thatobje
(mkCompGenLet m thatucv (mkUnionCaseProof (thataddre, cref, tinst, m))
(mkEqualsTestConjuncts g m (List.mapi (mkTest thisucve thatucve) rfields)))

Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget (test, DebugPointAtTarget.No)))
Some (mkCase(DecisionTreeTest.UnionCase(cref, tinst), mbuilder.AddResultTarget (test)))

let nullary, nonNullary = List.partition Option.isNone (List.map mkCase ucases)
if isNil nonNullary then mkTrue g m else
let cases = List.map (function Some c -> c | None -> failwith "mkUnionEquality") nonNullary
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkTrue g m, DebugPointAtTarget.No))
let dtree = TDSwitch(DebugPointAtSwitch.No, thise, cases, dflt, m)
let dflt = if isNil nullary then None else Some (mbuilder.AddResultTarget(mkTrue g m))
let dtree = TDSwitch(thise, cases, dflt, m)
mbuilder.Close(dtree, m, g.bool_ty)

let expr =
if ucases.Length = 1 then expr else
let tagsEqTested =
mkCond DebugPointAtBinding.NoneAtSticky DebugPointAtTarget.No m g.bool_ty
mkCond DebugPointAtBinding.NoneAtSticky m g.bool_ty
(mkILAsmCeq g m thistage thattage)
expr
(mkFalse g m)
Expand Down Expand Up @@ -649,7 +649,7 @@ let mkUnionHashWithComparer g tcref (tycon: Tycon) compe =
(mkCompGenSequential m
(mkValSet m (mkLocalValRef accv) (mkInt g m i))
(mkCombineHashGenerators g m (List.mapi (mkHash ucve) ucase1.RecdFields) (mkLocalValRef accv) acce))
Some(mkCase(DecisionTreeTest.UnionCase(c1ref, tinst), mbuilder.AddResultTarget(test, DebugPointAtTarget.No)))
Some(mkCase(DecisionTreeTest.UnionCase(c1ref, tinst), mbuilder.AddResultTarget(test)))

let nullary, nonNullary = ucases
|> List.mapi mkCase
Expand All @@ -658,8 +658,8 @@ let mkUnionHashWithComparer g tcref (tycon: Tycon) compe =
let dflt = if isNil nullary then None
else
let tag = mkUnionCaseTagGetViaExprAddr (thise, tcref, tinst, m)
Some(mbuilder.AddResultTarget(tag, DebugPointAtTarget.No))
let dtree = TDSwitch(DebugPointAtSwitch.No, thise, cases, dflt, m)
Some(mbuilder.AddResultTarget(tag))
let dtree = TDSwitch(thise, cases, dflt, m)
let stmt = mbuilder.Close(dtree, m, g.int_ty)
let expr = mkCompGenLet m accv (mkZero g m) stmt
let expr = if tycon.IsStructOrEnumTycon then expr else mkBindNullHash g m thise expr
Expand Down
Loading