Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 6 additions & 5 deletions src/fsharp/CompileOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
module internal FSharp.Compiler.CompileOptions

open Internal.Utilities
open Internal.Utilities.StructuredFormat
open System
open System.IO
open FSharp.Compiler
Expand Down Expand Up @@ -1608,10 +1609,10 @@ let PrintWholeAssemblyImplementation g (tcConfig:TcConfig) outfile header expr =
let filename = outfile + ".terms"
use f = System.IO.File.CreateText (filename + "-" + string showTermFileCount + "-" + header)
showTermFileCount <- showTermFileCount + 1
Layout.outL f (Layout.squashTo 192 (DebugPrint.implFilesL g expr))
Layout.outL f (Display.squashTo 192 (DebugPrint.implFilesL g expr))
else
dprintf "\n------------------\nshowTerm: %s:\n" header
Layout.outL stderr (Layout.squashTo 192 (DebugPrint.implFilesL g expr))
Layout.outL stderr (Display.squashTo 192 (DebugPrint.implFilesL g expr))
dprintf "\n------------------\n"

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -1706,10 +1707,10 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM
PrintWholeAssemblyImplementation tcGlobals tcConfig outfile "pass-start" implFiles
#if DEBUG
if tcConfig.showOptimizationData then
dprintf "Expression prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.implFilesL tcGlobals implFiles)))
dprintf "Expression prior to optimization:\n%s\n" (Layout.showL (Display.squashTo 192 (DebugPrint.implFilesL tcGlobals implFiles)))

if tcConfig.showOptimizationData then
dprintf "CCU prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.entityL tcGlobals ccu.Contents)))
dprintf "CCU prior to optimization:\n%s\n" (Layout.showL (Display.squashTo 192 (DebugPrint.entityL tcGlobals ccu.Contents)))
#endif

let optEnv0 = optEnv
Expand Down Expand Up @@ -1738,7 +1739,7 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM
let optSettings = { optSettings with abstractBigTargets = false; reportingPhase = false }
#if DEBUG
if tcConfig.showOptimizationData then
dprintf "Optimization implFileOptData:\n%s\n" (Layout.showL (Layout.squashTo 192 (Optimizer.moduleInfoL tcGlobals implFileOptData)))
dprintf "Optimization implFileOptData:\n%s\n" (Layout.showL (Display.squashTo 192 (Optimizer.moduleInfoL tcGlobals implFileOptData)))
#endif

let implFile, optEnvExtraLoop =
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/NicePrint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,9 +2182,9 @@ let layoutExnDef denv x = x |> TastDefinitionPrinting.layoutExnDefn denv

let stringOfTyparConstraints denv x = x |> PrintTypes.layoutConstraintsWithInfo denv SimplifyTypes.typeSimplificationInfo0 |> showL

let outputTycon denv infoReader ad m (* width *) os x = TastDefinitionPrinting.layoutTycon denv infoReader ad m true WordL.keywordType x (* |> Layout.squashTo width *) |> bufferL os
let outputTycon denv infoReader ad m (* width *) os x = TastDefinitionPrinting.layoutTycon denv infoReader ad m true WordL.keywordType x (* |> Display.squashTo width *) |> bufferL os

let layoutTycon denv infoReader ad m (* width *) x = TastDefinitionPrinting.layoutTycon denv infoReader ad m true WordL.keywordType x (* |> Layout.squashTo width *)
let layoutTycon denv infoReader ad m (* width *) x = TastDefinitionPrinting.layoutTycon denv infoReader ad m true WordL.keywordType x (* |> Display.squashTo width *)

let layoutUnionCases denv x = x |> TastDefinitionPrinting.layoutUnionCaseFields denv true

Expand Down
7 changes: 4 additions & 3 deletions src/fsharp/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module internal FSharp.Compiler.Optimizer

open Internal.Utilities
open Internal.Utilities.StructuredFormat

open FSharp.Compiler
open FSharp.Compiler.AbstractIL.Diagnostics
Expand Down Expand Up @@ -1250,17 +1251,17 @@ let RemapOptimizationInfo g tmenv =
let AbstractAndRemapModulInfo msg g m (repackage, hidden) info =
let mrpi = mkRepackageRemapping repackage
#if DEBUG
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data prior to trim: \n%s\n" msg outputRange m (Layout.showL (Layout.squashTo 192 (moduleInfoL g info)))
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data prior to trim: \n%s\n" msg outputRange m (Layout.showL (Display.squashTo 192 (moduleInfoL g info)))
#else
ignore (msg, m)
#endif
let info = info |> AbstractLazyModulInfoByHiding false hidden
#if DEBUG
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data after trim:\n%s\n" msg outputRange m (Layout.showL (Layout.squashTo 192 (moduleInfoL g info)))
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data after trim:\n%s\n" msg outputRange m (Layout.showL (Display.squashTo 192 (moduleInfoL g info)))
#endif
let info = info |> RemapOptimizationInfo g mrpi
#if DEBUG
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data after remap:\n%s\n" msg outputRange m (Layout.showL (Layout.squashTo 192 (moduleInfoL g info)))
if verboseOptimizationInfo then dprintf "%s - %a - Optimization data after remap:\n%s\n" msg outputRange m (Layout.showL (Display.squashTo 192 (moduleInfoL g info)))
#endif
info

Expand Down
3 changes: 2 additions & 1 deletion src/fsharp/fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ open System.Threading
open Internal.Utilities
open Internal.Utilities.Collections
open Internal.Utilities.Filename
open Internal.Utilities.StructuredFormat

open FSharp.Compiler
open FSharp.Compiler.AbstractIL
Expand Down Expand Up @@ -321,7 +322,7 @@ module InterfaceFileWriter =
for (TImplFile (_, _, mexpr, _, _, _)) in declaredImpls do
let denv = BuildInitialDisplayEnvForSigFileGeneration tcGlobals
writeViaBuffer os (fun os s -> Printf.bprintf os "%s\n\n" s)
(NicePrint.layoutInferredSigOfModuleExpr true denv infoReader AccessibleFromSomewhere range0 mexpr |> Layout.squashTo 80 |> Layout.showL)
(NicePrint.layoutInferredSigOfModuleExpr true denv infoReader AccessibleFromSomewhere range0 mexpr |> Display.squashTo 80 |> Layout.showL)

if tcConfig.printSignatureFile <> "" then os.Dispose()

Expand Down
Loading