Skip to content

Commit c1ed4ec

Browse files
T-GroCopilot
andcommitted
Apply fantomas formatting to all TypedTreeOps files
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6311b88 commit c1ed4ec

9 files changed

+72
-86
lines changed

src/Compiler/TypedTree/TypedTreeOps.Attributes.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,6 @@ module internal AttributeHelpers =
959959
| CompiledTypeRepr.ILAsmNamed(typeRef, _, _) -> typeRef.Enclosing.IsEmpty && typeRef.Name = attrFullName
960960
| CompiledTypeRepr.ILAsmOpen _ -> false)
961961

962-
963962
type ValRef with
964963
member vref.IsDispatchSlot =
965964
match vref.MemberInfo with
@@ -1253,7 +1252,6 @@ module internal AttributeHelpers =
12531252
warning (Failure(FSComp.SR.tastUnexpectedDecodeOfInterfaceDataVersionAttribute ()))
12541253
false
12551254

1256-
12571255
let isSealedTy g ty =
12581256
let ty = stripTyEqnsAndMeasureEqns g ty
12591257

src/Compiler/TypedTree/TypedTreeOps.Attributes.fsi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ module internal AttributeHelpers =
197197
/// Try to find the AttributeUsage attribute, looking for the value of the AllowMultiple named parameter
198198
val TryFindAttributeUsageAttribute: TcGlobals -> range -> TyconRef -> bool option
199199

200-
201200
val (|AttribBitwiseOrExpr|_|): TcGlobals -> Expr -> (Expr * Expr) voption
202201

203202
[<return: Struct>]
@@ -310,7 +309,6 @@ module internal AttributeHelpers =
310309
typeEntity: Entity ->
311310
Entity
312311

313-
314312
[<AutoOpen>]
315313
module internal ByrefAndSpanHelpers =
316314

src/Compiler/TypedTree/TypedTreeOps.ExprConstruction.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,6 @@ module internal TypeTesters =
13601360
else
13611361
CompilerGeneratedName f.rfield_id.idText
13621362

1363-
13641363
[<AutoOpen>]
13651364
module internal CommonContainers =
13661365

src/Compiler/TypedTree/TypedTreeOps.Remap.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,5 +1691,3 @@ module internal TypeEquivalence =
16911691
member _.GetHashCode(a) = hash a.MemberName
16921692
}
16931693
)
1694-
1695-

src/Compiler/TypedTree/TypedTreeOps.Remap.fsi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,5 +566,3 @@ module internal TypeEquivalence =
566566

567567
/// Create an empty immutable mapping from witnesses to some data
568568
val EmptyTraitWitnessInfoHashMap: TcGlobals -> TraitWitnessInfoHashMap<'T>
569-
570-

src/Compiler/TypedTree/TypedTreeOps.Remapping.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ module internal SignatureOps =
588588
let freeTyvarsAllPublic tyvars =
589589
Zset.forall isPublicTycon tyvars.FreeTycons
590590

591-
592591
/// Combine a list of ModuleOrNamespaceType's making up the description of a CCU. checking there are now
593592
/// duplicate modules etc.
594593
let CombineCcuContentFragments l =
@@ -2707,7 +2706,6 @@ module internal ExprAnalysis =
27072706
let witnessInfo = traitInfo.GetWitnessInfo()
27082707
GenWitnessTy g witnessInfo
27092708

2710-
27112709
//--------------------------------------------------------------------------
27122710
// Decision tree reduction
27132711
//--------------------------------------------------------------------------

src/Compiler/TypedTree/TypedTreeOps.Remapping.fsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ module internal ExprAnalysis =
283283
/// Compute the type of an expression from the expression itself
284284
val tyOfExpr: TcGlobals -> Expr -> TType
285285

286-
287286
/// Accumulate the targets actually used in a decision graph (for reporting warnings)
288287
val accTargetsOfDecisionTree: DecisionTree -> int list -> int list
289288

src/Compiler/TypedTree/TypedTreeOps.Transforms.fs

Lines changed: 72 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,91 +2170,91 @@ module internal TupleCompilation =
21702170
mkLoop (fun _idxVar loopVar -> mkInvisibleLet elemVar.Range elemVar loopVar bodyExpr))
21712171
| ValueNone ->
21722172

2173-
let mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr = ranges
2173+
let mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr = ranges
21742174

2175-
if isStringTy g enumerableTy then
2176-
// type is string, optimize for expression as:
2177-
// let $str = enumerable
2178-
// for $idx = 0 to str.Length - 1 do
2179-
// let elem = str.[idx]
2180-
// body elem
2175+
if isStringTy g enumerableTy then
2176+
// type is string, optimize for expression as:
2177+
// let $str = enumerable
2178+
// for $idx = 0 to str.Length - 1 do
2179+
// let elem = str.[idx]
2180+
// body elem
21812181

2182-
let strVar, strExpr = mkCompGenLocal mFor "str" enumerableTy
2183-
let idxVar, idxExpr = mkCompGenLocal elemVar.Range "idx" g.int32_ty
2182+
let strVar, strExpr = mkCompGenLocal mFor "str" enumerableTy
2183+
let idxVar, idxExpr = mkCompGenLocal elemVar.Range "idx" g.int32_ty
21842184

2185-
let lengthExpr = mkGetStringLength g mFor strExpr
2186-
let charExpr = mkGetStringChar g mFor strExpr idxExpr
2185+
let lengthExpr = mkGetStringLength g mFor strExpr
2186+
let charExpr = mkGetStringChar g mFor strExpr idxExpr
21872187

2188-
let startExpr = mkZero g mFor
2189-
let finishExpr = mkDecr g mFor lengthExpr
2190-
// for compat reasons, loop item over string is sometimes object, not char
2191-
let loopItemExpr = mkCoerceIfNeeded g elemVar.Type g.char_ty charExpr
2192-
let bodyExpr = mkInvisibleLet mIn elemVar loopItemExpr bodyExpr
2188+
let startExpr = mkZero g mFor
2189+
let finishExpr = mkDecr g mFor lengthExpr
2190+
// for compat reasons, loop item over string is sometimes object, not char
2191+
let loopItemExpr = mkCoerceIfNeeded g elemVar.Type g.char_ty charExpr
2192+
let bodyExpr = mkInvisibleLet mIn elemVar loopItemExpr bodyExpr
21932193

2194-
let forExpr =
2195-
mkFastForLoop g (DebugPointAtFor.No, spIn, mWholeExpr, idxVar, startExpr, true, finishExpr, bodyExpr)
2194+
let forExpr =
2195+
mkFastForLoop g (DebugPointAtFor.No, spIn, mWholeExpr, idxVar, startExpr, true, finishExpr, bodyExpr)
21962196

2197-
let expr = mkLet spFor mFor strVar enumerableExpr forExpr
2197+
let expr = mkLet spFor mFor strVar enumerableExpr forExpr
21982198

2199-
expr
2199+
expr
2200+
2201+
elif isListTy g enumerableTy then
2202+
// type is list, optimize for expression as:
2203+
// let mutable $currentVar = listExpr
2204+
// let mutable $nextVar = $tailOrNull
2205+
// while $guardExpr do
2206+
// let i = $headExpr
2207+
// bodyExpr ()
2208+
// $current <- $next
2209+
// $next <- $tailOrNull
2210+
2211+
let IndexHead = 0
2212+
let IndexTail = 1
2213+
2214+
let currentVar, currentExpr = mkMutableCompGenLocal mIn "current" enumerableTy
2215+
let nextVar, nextExpr = mkMutableCompGenLocal mIn "next" enumerableTy
2216+
let elemTy = destListTy g enumerableTy
22002217

2201-
elif isListTy g enumerableTy then
2202-
// type is list, optimize for expression as:
2203-
// let mutable $currentVar = listExpr
2204-
// let mutable $nextVar = $tailOrNull
2205-
// while $guardExpr do
2206-
// let i = $headExpr
2207-
// bodyExpr ()
2208-
// $current <- $next
2209-
// $next <- $tailOrNull
2210-
2211-
let IndexHead = 0
2212-
let IndexTail = 1
2213-
2214-
let currentVar, currentExpr = mkMutableCompGenLocal mIn "current" enumerableTy
2215-
let nextVar, nextExpr = mkMutableCompGenLocal mIn "next" enumerableTy
2216-
let elemTy = destListTy g enumerableTy
2217-
2218-
let guardExpr = mkNonNullTest g mFor nextExpr
2219-
2220-
let headOrDefaultExpr =
2221-
mkUnionCaseFieldGetUnprovenViaExprAddr (currentExpr, g.cons_ucref, [ elemTy ], IndexHead, mIn)
2222-
2223-
let tailOrNullExpr =
2224-
mkUnionCaseFieldGetUnprovenViaExprAddr (currentExpr, g.cons_ucref, [ elemTy ], IndexTail, mIn)
2225-
2226-
let bodyExpr =
2227-
mkInvisibleLet
2228-
mIn
2229-
elemVar
2230-
headOrDefaultExpr
2231-
(mkSequential
2218+
let guardExpr = mkNonNullTest g mFor nextExpr
2219+
2220+
let headOrDefaultExpr =
2221+
mkUnionCaseFieldGetUnprovenViaExprAddr (currentExpr, g.cons_ucref, [ elemTy ], IndexHead, mIn)
2222+
2223+
let tailOrNullExpr =
2224+
mkUnionCaseFieldGetUnprovenViaExprAddr (currentExpr, g.cons_ucref, [ elemTy ], IndexTail, mIn)
2225+
2226+
let bodyExpr =
2227+
mkInvisibleLet
22322228
mIn
2233-
bodyExpr
2229+
elemVar
2230+
headOrDefaultExpr
22342231
(mkSequential
22352232
mIn
2236-
(mkValSet mIn (mkLocalValRef currentVar) nextExpr)
2237-
(mkValSet mIn (mkLocalValRef nextVar) tailOrNullExpr)))
2238-
2239-
let expr =
2240-
// let mutable current = enumerableExpr
2241-
mkLet
2242-
spFor
2243-
mIn
2244-
currentVar
2245-
enumerableExpr
2246-
// let mutable next = current.TailOrNull
2247-
(mkInvisibleLet
2248-
mFor
2249-
nextVar
2250-
tailOrNullExpr
2251-
// while nonNull next do
2252-
(mkWhile g (spInWhile, WhileLoopForCompiledForEachExprMarker, guardExpr, bodyExpr, mBody)))
2233+
bodyExpr
2234+
(mkSequential
2235+
mIn
2236+
(mkValSet mIn (mkLocalValRef currentVar) nextExpr)
2237+
(mkValSet mIn (mkLocalValRef nextVar) tailOrNullExpr)))
22532238

2254-
expr
2239+
let expr =
2240+
// let mutable current = enumerableExpr
2241+
mkLet
2242+
spFor
2243+
mIn
2244+
currentVar
2245+
enumerableExpr
2246+
// let mutable next = current.TailOrNull
2247+
(mkInvisibleLet
2248+
mFor
2249+
nextVar
2250+
tailOrNullExpr
2251+
// while nonNull next do
2252+
(mkWhile g (spInWhile, WhileLoopForCompiledForEachExprMarker, guardExpr, bodyExpr, mBody)))
2253+
2254+
expr
22552255

2256-
else
2257-
expr
2256+
else
2257+
expr
22582258

22592259
| _ -> expr
22602260

@@ -2883,7 +2883,6 @@ module internal ResumableCodePatterns =
28832883

28842884
| _ -> ValueNone
28852885

2886-
28872886
[<return: Struct>]
28882887
let (|ResumableCodeInvoke|_|) g expr =
28892888
match expr with

src/Compiler/TypedTree/TypedTreeOps.Transforms.fsi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,3 @@ module internal SeqExprPatterns =
341341
/// Detect a 'seq { ... }' expression
342342
[<return: Struct>]
343343
val (|Seq|_|): TcGlobals -> Expr -> (Expr * TType) voption
344-

0 commit comments

Comments
 (0)