summaryrefslogtreecommitdiff
path: root/src/dex.hs
diff options
context:
space:
mode:
authorDougal Maclaurin <dougalm@google.com>2021-07-27 16:46:32 -0400
committerDougal Maclaurin <dougalm@google.com>2021-07-27 16:46:32 -0400
commit09bc70a618d1deda45d548b2901e1a06f8f1bb0a (patch)
tree13461adae56564c1c67a3a1a6b683094332059e8 /src/dex.hs
parentfd2f7e40d5b02346d15aab5d747631c8e66221f6 (diff)
parent47955edfa782958275b94054f9d944e6e980d3d8 (diff)
Merge branch 'main' into top-level-naming-changes
Diffstat (limited to 'src/dex.hs')
-rw-r--r--src/dex.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/dex.hs b/src/dex.hs
index 76e09142..4451d693 100644
--- a/src/dex.hs
+++ b/src/dex.hs
@@ -190,16 +190,23 @@ optionList opts = eitherReader \s -> case lookup s opts of
parseEvalOpts :: Parser EvalConfig
parseEvalOpts = EvalConfig
<$> option
- (optionList [ ("llvm", LLVM)
- , ("llvm-cuda", LLVMCUDA)
- , ("llvm-mc", LLVMMC)
- , ("interpreter", Interpreter)])
+ (optionList backends)
(long "backend" <> value LLVM <>
- helpOption "Backend" "llvm (default) | llvm-cuda | llvm-mc | interpreter")
+ helpOption "Backend" (intercalate " | " $ fst <$> backends))
<*> optional (strOption $ long "lib-path" <> metavar "PATH" <> help "Library path")
<*> optional (strOption $ long "logto"
<> metavar "FILE"
<> help "File to log to" <> showDefault)
+ where
+ backends = [ ("llvm", LLVM)
+ , ("llvm-mc", LLVMMC)
+#ifdef DEX_CUDA
+ , ("llvm-cuda", LLVMCUDA)
+#endif
+#if DEX_LLVM_VERSION == HEAD
+ , ("mlir", MLIR)
+#endif
+ , ("interpreter", Interpreter)]
main :: IO ()
main = do