Skip to content

Commit 0406b0b

Browse files
T-GroCopilot
andcommitted
Rename TypeTesters→TypeQueries, ExprHelpers→ExprTransforms, tighten ExprShapeQueries→ExprAnalysis
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1461978 commit 0406b0b

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/Compiler/TypedTree/TypedTreeOps.ExprConstruction.fs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ module internal CollectionTypes =
583583
||> List.foldBack (fun (x, y) acc -> acc.Add(x, y))
584584

585585
[<AutoOpen>]
586-
module internal TypeTesters =
586+
module internal TypeQueries =
587587

588588
//--------------------------------------------------------------------------
589589
// From Ref_private to Ref_nonlocal when exporting data.
@@ -1348,6 +1348,18 @@ module internal TypeTesters =
13481348

13491349
not isStructural))
13501350

1351+
let useGenuineField (tycon: Tycon) (f: RecdField) =
1352+
Option.isSome f.LiteralValue
1353+
|| tycon.IsEnumTycon
1354+
|| f.rfield_secret
1355+
|| (not f.IsStatic && f.rfield_mutable && not tycon.IsRecordTycon)
1356+
1357+
let ComputeFieldName tycon f =
1358+
if useGenuineField tycon f then
1359+
f.rfield_id.idText
1360+
else
1361+
CompilerGeneratedName f.rfield_id.idText
1362+
13511363

13521364
[<AutoOpen>]
13531365
module internal CommonContainers =

src/Compiler/TypedTree/TypedTreeOps.ExprConstruction.fsi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ module internal CollectionTypes =
382382
static member OfList: (TyconRef * 'T) list -> TyconRefMultiMap<'T>
383383

384384
[<AutoOpen>]
385-
module internal TypeTesters =
385+
module internal TypeQueries =
386386

387387
/// Try to create a EntityRef suitable for accessing the given Entity from another assembly
388388
val tryRescopeEntity: CcuThunk -> Entity -> EntityRef voption
@@ -648,6 +648,10 @@ module internal TypeTesters =
648648
/// Determine if a value is a method implementing an interface dispatch slot using a private method impl
649649
val ComputeUseMethodImpl: g: TcGlobals -> v: Val -> bool
650650

651+
val useGenuineField: Tycon -> RecdField -> bool
652+
653+
val ComputeFieldName: Tycon -> RecdField -> string
654+
651655
[<AutoOpen>]
652656
module internal CommonContainers =
653657

src/Compiler/TypedTree/TypedTreeOps.ExprOps.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ module internal Makers =
16911691
mkCond DebugPointAtBinding.NoneAtInvisible m g.unit_ty e1 e2 (mkUnit g m)
16921692

16931693
[<AutoOpen>]
1694-
module internal ExprHelpers =
1694+
module internal ExprTransforms =
16951695

16961696
//--------------------------------------------------------------------------
16971697
// tupled lambda --> method/function with a given valReprInfo specification.

src/Compiler/TypedTree/TypedTreeOps.ExprOps.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ module internal Makers =
506506
val mkUnionCaseTest: TcGlobals -> Expr * UnionCaseRef * TypeInst * range -> Expr
507507

508508
[<AutoOpen>]
509-
module internal ExprHelpers =
509+
module internal ExprTransforms =
510510

511511
/// Given a lambda expression taking multiple variables, build a corresponding lambda taking a tuple
512512
val MultiLambdaToTupledLambda: TcGlobals -> Val list -> Expr -> Val * Expr

src/Compiler/TypedTree/TypedTreeOps.Remapping.fs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,7 @@ module internal ExprRemapping =
24392439
remapExprImpl ctxt CloneAll (mkInstRemap tpinst) e
24402440

24412441
[<AutoOpen>]
2442-
module internal ExprShapeQueries =
2442+
module internal ExprAnalysis =
24432443

24442444
//--------------------------------------------------------------------------
24452445
// Replace Marks - adjust debugging marks when a lambda gets
@@ -2591,18 +2591,6 @@ module internal ExprShapeQueries =
25912591

25922592
(recdFieldOfExnDefRefByIdx ecref n).IsMutable
25932593

2594-
let useGenuineField (tycon: Tycon) (f: RecdField) =
2595-
Option.isSome f.LiteralValue
2596-
|| tycon.IsEnumTycon
2597-
|| f.rfield_secret
2598-
|| (not f.IsStatic && f.rfield_mutable && not tycon.IsRecordTycon)
2599-
2600-
let ComputeFieldName tycon f =
2601-
if useGenuineField tycon f then
2602-
f.rfield_id.idText
2603-
else
2604-
CompilerGeneratedName f.rfield_id.idText
2605-
26062594
//---------------------------------------------------------------------------
26072595
// Witnesses
26082596
//---------------------------------------------------------------------------

src/Compiler/TypedTree/TypedTreeOps.Remapping.fsi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ module internal ExprRemapping =
258258
val remapTyconExnInfo: RemapContext -> Remap -> ExceptionInfo -> ExceptionInfo
259259

260260
[<AutoOpen>]
261-
module internal ExprShapeQueries =
261+
module internal ExprAnalysis =
262262

263263
/// Adjust marks in expressions, replacing all marks by the given mark.
264264
/// Used when inlining.
@@ -274,10 +274,6 @@ module internal ExprShapeQueries =
274274

275275
val isExnFieldMutable: TyconRef -> int -> bool
276276

277-
val useGenuineField: Tycon -> RecdField -> bool
278-
279-
val ComputeFieldName: Tycon -> RecdField -> string
280-
281277
val GenWitnessArgTys: TcGlobals -> TraitWitnessInfo -> TType list list
282278

283279
val GenWitnessTys: TcGlobals -> TraitWitnessInfos -> TType list

0 commit comments

Comments
 (0)