Skip to content

Commit

Permalink
make some more functions into members in tast.fs
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme committed Nov 30, 2014
1 parent ddadb30 commit 20cb9b0
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 215 deletions.
20 changes: 10 additions & 10 deletions src/fsharp/AugmentWithHashCompare.fs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ let mkRecdCompare g tcref (tycon:Tycon) =
let compe = mkILCallGetComparer g m
let mkTest (fspec:RecdField) =
let fty = fspec.FormalType
let fref = mkNestedRecdFieldRef tcref fspec
let fref = tcref.NestedRecdFieldRef fspec
let m = fref.Range
mkCallGenericComparisonWithComparerOuter g m fty
compe
Expand All @@ -214,7 +214,7 @@ let mkRecdCompareWithComparer g tcref (tycon:Tycon) (_thisv,thise) (_,thate) com

let mkTest (fspec:RecdField) =
let fty = fspec.FormalType
let fref = mkNestedRecdFieldRef tcref fspec
let fref = tcref.NestedRecdFieldRef fspec
let m = fref.Range
mkCallGenericComparisonWithComparerOuter g m fty
compe
Expand All @@ -238,7 +238,7 @@ let mkRecdEquality g tcref (tycon:Tycon) =
let thisv,thatv,thise,thate = mkThisVarThatVar g m ty
let mkTest (fspec:RecdField) =
let fty = fspec.FormalType
let fref = mkNestedRecdFieldRef tcref fspec
let fref = tcref.NestedRecdFieldRef fspec
let m = fref.Range
mkCallGenericEqualityEROuter g m fty
(mkRecdFieldGetViaExprAddr(thise, fref, tinst, m))
Expand All @@ -259,7 +259,7 @@ let mkRecdEqualityWithComparer g tcref (tycon:Tycon) (_thisv,thise) thatobje (th

let mkTest (fspec:RecdField) =
let fty = fspec.FormalType
let fref = mkNestedRecdFieldRef tcref fspec
let fref = tcref.NestedRecdFieldRef fspec
let m = fref.Range

mkCallGenericEqualityWithComparerOuter g m fty
Expand Down Expand Up @@ -339,7 +339,7 @@ let mkUnionCompare g tcref (tycon:Tycon) =
let expr =
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m )
let mkCase ucase =
let cref = mkNestedUnionCaseRef tcref ucase
let cref = tcref.NestedUnionCaseRef ucase
let m = cref.Range
let thisucv,thisucve = mkCompGenLocal m "thisCast" (mkProvenUnionCaseTy cref tinst)
let thatucv,thatucve = mkCompGenLocal m "objCast" (mkProvenUnionCaseTy cref tinst)
Expand Down Expand Up @@ -396,7 +396,7 @@ let mkUnionCompareWithComparer g tcref (tycon:Tycon) (_thisv,thise) (thatv,thate
let expr =
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m )
let mkCase ucase =
let cref = mkNestedUnionCaseRef tcref ucase
let cref = tcref.NestedUnionCaseRef ucase
let m = cref.Range
let thisucv,thisucve = mkCompGenLocal m "thisCastu" (mkProvenUnionCaseTy cref tinst)
let thatucv,thatucve = mkCompGenLocal m "thatCastu" (mkProvenUnionCaseTy cref tinst)
Expand Down Expand Up @@ -455,7 +455,7 @@ let mkUnionEquality g tcref (tycon:Tycon) =
let expr =
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m )
let mkCase ucase =
let cref = mkNestedUnionCaseRef tcref ucase
let cref = tcref.NestedUnionCaseRef ucase
let m = cref.Range
let thisucv,thisucve = mkCompGenLocal m "thisCast" (mkProvenUnionCaseTy cref tinst)
let thatucv,thatucve = mkCompGenLocal m "objCast" (mkProvenUnionCaseTy cref tinst)
Expand Down Expand Up @@ -510,7 +510,7 @@ let mkUnionEqualityWithComparer g tcref (tycon:Tycon) (_thisv,thise) thatobje (t
let expr =
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m )
let mkCase ucase =
let cref = mkNestedUnionCaseRef tcref ucase
let cref = tcref.NestedUnionCaseRef ucase
let m = cref.Range
let thisucv,thisucve = mkCompGenLocal m "thisCastu" (mkProvenUnionCaseTy cref tinst)
let thatucv,thatucve = mkCompGenLocal m "thatCastu" (mkProvenUnionCaseTy cref tinst)
Expand Down Expand Up @@ -567,7 +567,7 @@ let mkRecdHashWithComparer g tcref (tycon:Tycon) compe =
let thisv,thise = mkThisVar g m ty
let mkFieldHash (fspec:RecdField) =
let fty = fspec.FormalType
let fref = mkNestedRecdFieldRef tcref fspec
let fref = tcref.NestedRecdFieldRef fspec
let m = fref.Range
let e = mkRecdFieldGetViaExprAddr(thise, fref, tinst, m)

Expand Down Expand Up @@ -605,7 +605,7 @@ let mkUnionHashWithComparer g tcref (tycon:Tycon) compe =
let mbuilder = new MatchBuilder(NoSequencePointAtInvisibleBinding,m )
let accv,acce = mkMutableCompGenLocal m "i" g.int_ty
let mkCase i ucase1 =
let c1ref = mkNestedUnionCaseRef tcref ucase1
let c1ref = tcref.NestedUnionCaseRef ucase1
let ucv,ucve = mkCompGenLocal m "unionCase" (mkProvenUnionCaseTy c1ref tinst)
let m = c1ref.Range
let mkHash j (rfield:RecdField) =
Expand Down
6 changes: 3 additions & 3 deletions src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ let ComputeStorageForNonLocalTopVal amap g cloc modref (v:Val) =
let rec ComputeStorageForNonLocalModuleOrNamespaceRef amap g cloc acc (modref:ModuleOrNamespaceRef) (modul:ModuleOrNamespace) =
let acc =
(acc, modul.ModuleOrNamespaceType.ModuleAndNamespaceDefinitions) ||> List.fold (fun acc smodul ->
ComputeStorageForNonLocalModuleOrNamespaceRef amap g (CompLocForSubModuleOrNamespace cloc smodul) acc (modref.MkNestedTyconRef smodul) smodul)
ComputeStorageForNonLocalModuleOrNamespaceRef amap g (CompLocForSubModuleOrNamespace cloc smodul) acc (modref.NestedTyconRef smodul) smodul)

let acc =
(acc, modul.ModuleOrNamespaceType.AllValsAndMembers) ||> Seq.fold (fun acc v ->
Expand Down Expand Up @@ -2033,7 +2033,7 @@ and GenAllocRecd cenv cgbuf eenv ctorInfo (tcref,argtys,args,m) sequel =
(args,relevantFields) ||> List.iter2 (fun e f ->
CG.EmitInstr cgbuf (pop 0) (Push (if tcref.IsStructOrEnumTycon then [ILType.Byref typ] else [typ])) mkLdarg0;
GenExpr cenv cgbuf eenv SPSuppress e Continue;
GenFieldStore false cenv cgbuf eenv (mkNestedRecdFieldRef tcref f,argtys,m) discard)
GenFieldStore false cenv cgbuf eenv (tcref.NestedRecdFieldRef f,argtys,m) discard)
// Object construction doesn't generate a true value.
// Object constructions will always just get thrown away so this is safe
GenSequel cenv eenv.cloc cgbuf sequel
Expand Down Expand Up @@ -6306,7 +6306,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
let isPropHidden =
((fspec.IsCompilerGenerated && not tycon.IsEnumTycon) ||
hiddenRepr ||
IsHiddenRecdField eenv.sigToImplRemapInfo (mkNestedRecdFieldRef tcref fspec))
IsHiddenRecdField eenv.sigToImplRemapInfo (tcref.NestedRecdFieldRef fspec))
let ilType = GenType cenv.amap m cenv.g eenvinner.tyenv fspec.FormalType
let ilFieldName = ComputeFieldName tycon fspec

Expand Down
Loading

0 comments on commit 20cb9b0

Please sign in to comment.