Add a ghc wrapper to invoke ghc on individual files

With all the extensions used in streamly, optimization options and
ddump-simpl options.

This is useful for compiling standalone files, when inspecting core for
perf issues.  I wish cabal could invoke ghc with environment from the
cabal file. Can it?
This commit is contained in:
Harendra Kumar 2021-02-10 02:30:04 +05:30
parent 7500c72e6b
commit d2d0e16d53
2 changed files with 46 additions and 0 deletions

45
bin/ghc.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
ghc -Wall \
-Wcompat \
-Wunrecognised-warning-flags \
-Widentities \
-Wincomplete-record-updates \
-Wincomplete-uni-patterns \
-Wredundant-constraints \
-Wnoncanonical-monad-instances \
-Rghc-timing \
-XBangPatterns \
-XCApiFFI \
-XCPP \
-XConstraintKinds \
-XDeriveDataTypeable \
-XDeriveGeneric \
-XDeriveTraversable \
-XExistentialQuantification \
-XFlexibleContexts \
-XFlexibleInstances \
-XGeneralizedNewtypeDeriving \
-XInstanceSigs \
-XKindSignatures \
-XLambdaCase \
-XMagicHash \
-XMultiParamTypeClasses \
-XPatternSynonyms \
-XRankNTypes \
-XRecordWildCards \
-XScopedTypeVariables \
-XTupleSections \
-XTypeFamilies \
-XViewPatterns \
-XNoMonoLocalBinds \
-XTypeApplications \
-XQuantifiedConstraints \
-O2 \
-fdicts-strict \
-fspec-constr-recursive=16 \
-fmax-worker-args=16 \
-fplugin Fusion.Plugin \
-ddump-to-file \
-ddump-simpl \
$*

View File

@ -123,6 +123,7 @@ extra-source-files:
bin/bench.sh
bin/bench-exec-one.sh
bin/build-lib.sh
bin/ghc.sh
bin/mk-hscope.sh
bin/mk-tags.sh
bin/targets.sh