Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
debug formatting
  • Loading branch information
dsyme committed Jul 11, 2019
commit 55844c23dcedbbc401f51cb91e8c29a93f61aced
2 changes: 2 additions & 0 deletions src/absil/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ type cenv =
generatePdb: bool
resolveAssemblyRef: (ILAssemblyRef -> Choice<string, System.Reflection.Assembly> option) }

override x.ToString() = "<cenv>"

/// Convert an Abstract IL type reference to Reflection.Emit System.Type value.
// This ought to be an adequate substitute for this whole function, but it needs
// to be thoroughly tested.
Expand Down
1 change: 1 addition & 0 deletions src/absil/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ type cenv =

member cenv.GetCode() = cenv.codeChunks.Close()

override x.ToString() = "<cenv>"

let FindOrAddSharedRow (cenv: cenv) tbl x = cenv.GetTable(tbl).FindOrAddSharedEntry x

Expand Down
16 changes: 12 additions & 4 deletions src/fsharp/DetupleArgs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -644,17 +644,26 @@ let hasTransfrom penv f = Zmap.tryFind f penv.transforms
*)

type env =
{ eg : TcGlobals
prefix : string
m : Range.range }
{
eg: TcGlobals

prefix: string

m: Range.range
}

override __.ToString() = "<en>"

let suffixE env s = {env with prefix = env.prefix + s}

let rangeE env m = {env with m = m}

let push b bs = b :: bs

let pushL xs bs = xs@bs

let newLocal env ty = mkCompGenLocal env.m env.prefix ty

let newLocalN env i ty = mkCompGenLocal env.m (env.prefix + string i) ty

let noEffectExpr env bindings x =
Expand Down Expand Up @@ -712,7 +721,6 @@ and collapseArgs env bindings n (callPattern) args =
| _ts :: _tss, [] ->
internalError "collapseArgs: CallPattern longer than callsite args. REPORT BUG"


//-------------------------------------------------------------------------
// pass - app fixup
//-------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/FindUnsolved.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type cenv =
denv: DisplayEnv
mutable unsolved: Typars }

override x.ToString() = "<cenv>"

/// Walk types, collecting type variables
let accTy cenv _env ty =
let normalizedTy = tryNormalizeMeasureInType cenv.g ty
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ type cenv =
delayedGenMethods: Queue<cenv -> unit>
}

override x.ToString() = "<cenv>"


let mkTypeOfExpr cenv m ilty =
let g = cenv.g
Expand Down Expand Up @@ -771,17 +773,26 @@ and NamedLocalIlxClosureInfo =
| NamedLocalIlxClosureInfoGenerator of (IlxGenEnv -> IlxClosureInfo)
| NamedLocalIlxClosureInfoGenerated of IlxClosureInfo

override __.ToString() = "<NamedLocalIlxClosureInfo>"

/// Indicates the overall representation decisions for all the elements of a namespace of module
and ModuleStorage =
{ Vals: Lazy<NameMap<ValStorage>>
SubModules: Lazy<NameMap<ModuleStorage>> }
{
Vals: Lazy<NameMap<ValStorage>>

SubModules: Lazy<NameMap<ModuleStorage>>
}

override __.ToString() = "<ModuleStorage>"

/// Indicate whether a call to the value can be implemented as
/// a branch. At the moment these are only used for generating branch calls back to
/// the entry label of the method currently being generated when a direct tailcall is
/// made in the method itself.
and BranchCallItem =

| BranchCallClosure of ArityInfo

| BranchCallMethod of
// Argument counts for compiled form of F# method or value
ArityInfo *
Expand All @@ -793,6 +804,8 @@ and BranchCallItem =
int *
// num obj args
int

override __.ToString() = "<BranchCallItem>"

/// Represents a place we can branch to
and Mark =
Expand Down Expand Up @@ -834,6 +847,8 @@ and IlxGenEnv =
withinSEH: bool
}

override __.ToString() = "<IlxGenEnv>"

let ReplaceTyenv tyenv (eenv: IlxGenEnv) = {eenv with tyenv = tyenv }

let EnvForTypars tps eenv = {eenv with tyenv = TypeReprEnv.ForTypars tps }
Expand Down
4 changes: 4 additions & 0 deletions src/fsharp/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ type cenv =
casApplied : Dictionary<Stamp, bool>
}

override x.ToString() = "<cenv>"

type IncrementalOptimizationEnv =
{ /// An identifier to help with name generation
latestBoundId: Ident option
Expand Down Expand Up @@ -415,6 +417,8 @@ type IncrementalOptimizationEnv =
localExternalVals = LayeredMap.Empty
globalModuleInfos = LayeredMap.Empty }

override x.ToString() = "<IncrementalOptimizationEnv>"

//-------------------------------------------------------------------------
// IsPartialExprVal - is the expr fully known?
//-------------------------------------------------------------------------
Expand Down
21 changes: 20 additions & 1 deletion src/fsharp/PostInferenceChecks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ type env =
returnScope : int

/// Are we in an app expression (Expr.App)?
isInAppExpr: bool }
isInAppExpr: bool
}

override __.ToString() = "<env>"

let BindTypar env (tp: Typar) =
{ env with
Expand Down Expand Up @@ -183,23 +186,39 @@ let CombineLimits limits =

type cenv =
{ boundVals: Dictionary<Stamp, int> // really a hash set

limitVals: Dictionary<Stamp, Limit>

mutable potentialUnboundUsesOfVals: StampMap<range>

mutable anonRecdTypes: StampMap<AnonRecdTypeInfo>

g: TcGlobals

amap: Import.ImportMap

/// For reading metadata
infoReader: InfoReader

internalsVisibleToPaths : CompilationPath list

denv: DisplayEnv

viewCcu : CcuThunk

reportErrors: bool

isLastCompiland : bool*bool

isInternalTestSpanStackReferring: bool

// outputs
mutable usesQuotations : bool

mutable entryPointGiven: bool }

override x.ToString() = "<cenv>"

/// Check if the value is an argument of a function
let IsValArgument env (v: Val) =
env.argVals.ContainsVal v
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/TypeChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ type cenv =
conditionalDefines = conditionalDefines
isInternalTestSpanStackReferring = isInternalTestSpanStackReferring }

override __.ToString() = "cenv(...)"
override __.ToString() = "<cenv>"

let CopyAndFixupTypars m rigid tpsorig =
ConstraintSolver.FreshenAndFixupTypars m rigid [] [] tpsorig
Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/autobox.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type cenv =
{ g: TcGlobals
amap: Import.ImportMap }

override x.ToString() = "<cenv>"

/// Find all the mutable locals that escape a method, function or lambda expression
let DecideEscapes syntacticArgs body =
let cantBeFree v =
Expand Down
14 changes: 12 additions & 2 deletions src/ilx/EraseClosures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ let mkFuncTypeRef n =
[IlxSettings.ilxNamespace () + ".OptimizedClosures"],
"FSharpFunc`"+ string (n + 1))
type cenv =
{ ilg:ILGlobals
{
ilg:ILGlobals

tref_Func: ILTypeRef[]

mkILTyFuncTy: ILType

addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef

addFieldNeverAttrs: ILFieldDef -> ILFieldDef
addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef }

addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef
}

override __.ToString() = "<cenv>"


let addMethodGeneratedAttrsToTypeDef cenv (tdef: ILTypeDef) =
tdef.With(methods = (tdef.Methods.AsList |> List.map (fun md -> md |> cenv.addMethodGeneratedAttrs) |> mkILMethods))
Expand Down