Option "-ddump-rn-ast" dumps imports and exports too
ClosedPublic

Authored by alanz on Sep 13 2017, 7:48 AM.

Details

Summary

Previously the renamed source decls only were dumped, now the imports, exports
and doc_hdr are too.

Test Plan

./validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alanz created this revision.Sep 13 2017, 7:48 AM
bgamari accepted this revision.Sep 13 2017, 12:09 PM

Looks reasonable to me. Just fix the nits listed inline.

compiler/main/HscMain.hs
395

A comment describing what the function does would be helpful here; "extract" is a pretty vague verb.

397

I'm confused; is this even true? It looks to me like it's in Hsc.

428

Alignment.

This revision is now accepted and ready to land.Sep 13 2017, 12:09 PM
alanz marked 2 inline comments as done.Sep 13 2017, 12:21 PM
alanz added inline comments.
compiler/main/HscMain.hs
397

It is true, and it is in the original code. The RenamedSource is only returned if a flag is set to do so, hence tcg_rn_decls tc_result returns a Maybe value, and if Nothing is returned rn_info ends up as that.

You will see the test results updated to be wrapped in Just.

alanz updated this revision to Diff 13855.Sep 13 2017, 12:50 PM
alanz marked an inline comment as done.

Update for @bgamari comments

This revision was automatically updated to reflect the committed changes.