diff options
author | Norman Ramsey <nr@cs.tufts.edu> | 2022-02-07 10:42:36 -0500 |
---|---|---|
committer | Cheng Shao <astrohavoc@gmail.com> | 2022-05-21 03:11:04 +0000 |
commit | 4aa3c5bde8c54f6ab8cbb2a574f7654590c077ca (patch) | |
tree | 43e79b6f797f12a3eb040252a20ac80659c55514 /testsuite/tests/ghc-api | |
parent | 36b8a57cb30c1374cce749b6f1554a2d438336b9 (diff) | |
download | haskell-4aa3c5bde8c54f6ab8cbb2a574f7654590c077ca.tar.gz |
Change `Backend` type and remove direct dependencieswip/backend-as-record
With this change, `Backend` becomes an abstract type
(there are no more exposed value constructors).
Decisions that were formerly made by asking "is the
current back end equal to (or different from) this named value
constructor?" are now made by interrogating the back end about
its properties, which are functions exported by `GHC.Driver.Backend`.
There is a description of how to migrate code using `Backend` in the
user guide.
Clients using the GHC API can find a backdoor to access the Backend
datatype in GHC.Driver.Backend.Internal.
Bumps haddock submodule.
Fixes #20927
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r-- | testsuite/tests/ghc-api/T10052/T10052.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/T10052/T10052.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/T8639_api.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/apirecomp001/myghc.hs | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/ghc-api/T10052/T10052.hs b/testsuite/tests/ghc-api/T10052/T10052.hs index 2b82a41c15..472667b188 100644 --- a/testsuite/tests/ghc-api/T10052/T10052.hs +++ b/testsuite/tests/ghc-api/T10052/T10052.hs @@ -23,7 +23,7 @@ runGhc' args act = do logger <- getLogger (dflags1, _leftover, _warns) <- parseDynamicFlags logger dflags0 flags let dflags2 = dflags1 { - backend = Interpreter + backend = interpreterBackend , ghcLink = LinkInMemory , verbosity = 1 } diff --git a/testsuite/tests/ghc-api/T10052/T10052.stderr b/testsuite/tests/ghc-api/T10052/T10052.stderr index 50db4fe9f2..14d76b9f49 100644 --- a/testsuite/tests/ghc-api/T10052/T10052.stderr +++ b/testsuite/tests/ghc-api/T10052/T10052.stderr @@ -1,3 +1,3 @@ when making flags consistent: warning: - Optimization flags conflict with --interactive; optimization flags ignored. + Optimization flags are incompatible with the byte-code interpreter; optimization flags ignored. diff --git a/testsuite/tests/ghc-api/T8639_api.hs b/testsuite/tests/ghc-api/T8639_api.hs index e74b994a27..8b9b5ce95d 100644 --- a/testsuite/tests/ghc-api/T8639_api.hs +++ b/testsuite/tests/ghc-api/T8639_api.hs @@ -11,7 +11,7 @@ main = do { [libdir] <- getArgs ; runGhc (Just libdir) $ do flags <- getSessionDynFlags - setSessionDynFlags (flags{ backend = Interpreter, ghcLink = LinkInMemory}) + setSessionDynFlags (flags{ backend = interpreterBackend, ghcLink = LinkInMemory}) target <- guessTarget "T8639_api_a.hs" Nothing Nothing setTargets [target] load LoadAllTargets diff --git a/testsuite/tests/ghc-api/apirecomp001/myghc.hs b/testsuite/tests/ghc-api/apirecomp001/myghc.hs index 3d2cb9c238..7f1d7cdfff 100644 --- a/testsuite/tests/ghc-api/apirecomp001/myghc.hs +++ b/testsuite/tests/ghc-api/apirecomp001/myghc.hs @@ -26,7 +26,7 @@ main = do logger <- getLogger (dflags, _, _) <- parseDynamicFlags logger dflags0 (map (mkGeneralLocated "on the commandline") args) - setSessionDynFlags $ dflags { backend = NoBackend + setSessionDynFlags $ dflags { backend = noBackend , ghcLink = LinkInMemory , verbosity = 0 -- silence please } @@ -37,7 +37,7 @@ main = do prn "target nothing: ok" dflags <- getSessionDynFlags - setSessionDynFlags $ dflags { backend = Interpreter } + setSessionDynFlags $ dflags { backend = interpreterBackend } ok <- load LoadAllTargets when (failed ok) $ error "Couldn't load A.hs in interpreted mode" prn "target interpreted: ok" |