Support adding objects from TH
authorAlec Theriault <alec.theriault@gmail.com>
Sun, 25 Mar 2018 17:59:27 +0000 (13:59 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 25 Mar 2018 18:33:22 +0000 (14:33 -0400)
commitceb914771aece0aa6d87339227ce406c7179d1d1
tree1b63f9af0e0c7e212c840e1ccd1e6add484774cf
parentaffdea82bb70e5a912b679a169c6e9a230e4c93e
Support adding objects from TH

The user facing TH interface changes are:

  * 'addForeignFile' is renamed to 'addForeignSource'
  * 'qAddForeignFile'/'addForeignFile' now expect 'FilePath's
  * 'RawObject' is now a constructor for 'ForeignSrcLang'
  * 'qAddTempFile'/'addTempFile' let you request a temporary file
    from the compiler.

Test Plan: unsure about this, added a TH test

Reviewers: goldfire, bgamari, angerman

Reviewed By: bgamari, angerman

Subscribers: hsyl20, mboes, carter, simonmar, bitonic, ljli, rwbarton, thomie

GHC Trac Issues: #14298

Differential Revision: https://phabricator.haskell.org/D4217
13 files changed:
compiler/main/CodeOutput.hs
compiler/main/DriverPipeline.hs
compiler/main/HscTypes.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSplice.hs
libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs
libraries/ghci/GHCi/Message.hs
libraries/ghci/GHCi/TH.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
testsuite/tests/th/T13366.hs
testsuite/tests/th/T14298.hs [new file with mode: 0644]
testsuite/tests/th/T14298.stdout [new file with mode: 0644]
testsuite/tests/th/all.T