Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Run simplifier before generating ByteCode - #410

Merged
cocreature merged 1 commit into
haskell:masterfrom
mpickering:wip/fix-th
Feb 12, 2020
Merged

cocreature merged 1 commit into
haskell:masterfrom
mpickering:wip/fix-th

Conversation

@mpickering

Copy link
Copy Markdown
Contributor

Running the simplifier is necessary to do things like inline data
constructor wrappers.

Fixes #256 and #393

@cocreature cocreature left a comment

Copy link
Copy Markdown
Collaborator

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.

let tm' = tm{tm_parsed_module = pm'}
GHC.dm_core_module <$> GHC.desugarModule tm'

let tc_result = fst (tm_internals_ (tmrModule tmr))

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

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
@mpickering

Copy link
Copy Markdown
Contributor Author

Added a test now which I verified fails before this patch but succeeds with the patch.

@ocharles

Copy link
Copy Markdown
Contributor

At long last with this branch I can almost load our main API server into ghcide! Only 14 files left to go (273 files now work), but that's a different bug 🎉 Great work @mpickering!

@cocreature cocreature left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

@cocreature
cocreature merged commit 2d71599 into haskell:master Feb 12, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
Running the simplifier is necessary to do things like inline data
constructor wrappers.

Fixes haskell/ghcide#256 and haskell/ghcide#393
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
Running the simplifier is necessary to do things like inline data
constructor wrappers.

Fixes haskell/ghcide#256 and haskell/ghcide#393
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
Running the simplifier is necessary to do things like inline data
constructor wrappers.

Fixes haskell/ghcide#256 and haskell/ghcide#393
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template Haskell: ByteCodeLink.lookupCE During interactive linking, GHCi couldn't find the following symbol

4 participants