-
Notifications
You must be signed in to change notification settings - Fork 99
Run simplifier before generating ByteCode #410
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! It would be great to have a testcase for this. #393 looks reasonably easy to test.
@@ -144,9 +145,14 @@ compileModule packageState deps tmr = | |||
let pm' = pm{pm_mod_summary = tweak $ pm_mod_summary pm} | |||
let tm' = tm{tm_parsed_module = pm'} | |||
GHC.dm_core_module <$> GHC.desugarModule tm' | |||
|
|||
let tc_result = fst (tm_internals_ (tmrModule tmr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set -O0
explicitly or does hie-bios
set that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that ghcide
set all the flags it was interested in. At least on the .hi
files branch, I believe this is the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know any code that sets -O0
. I think so far it just didn’t matter since we didn’t run the simplifier and don’t do code generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hie-bios
definitely sets it: https://github.com/mpickering/hie-bios/blob/master/src/HIE/Bios/Environment.hs#L41
Assuming, ghcide
still uses initSession
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the .hi file branch this will need to be set but for now, initSession
does set it.
Running the simplifier is necessary to do things like inline data constructor wrappers. Fixes #256 and #393
2fab0dc
to
87371a1
Compare
Added a test now which I verified fails before this patch but succeeds with the patch. |
At long last with this branch I can almost load our main API server into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
Running the simplifier is necessary to do things like inline data constructor wrappers. Fixes haskell/ghcide#256 and haskell/ghcide#393
Running the simplifier is necessary to do things like inline data constructor wrappers. Fixes haskell/ghcide#256 and haskell/ghcide#393
Running the simplifier is necessary to do things like inline data constructor wrappers. Fixes haskell/ghcide#256 and haskell/ghcide#393
Running the simplifier is necessary to do things like inline data
constructor wrappers.
Fixes #256 and #393