diff options
author | Dougal Maclaurin <dougalm@google.com> | 2021-07-27 16:46:32 -0400 |
---|---|---|
committer | Dougal Maclaurin <dougalm@google.com> | 2021-07-27 16:46:32 -0400 |
commit | 09bc70a618d1deda45d548b2901e1a06f8f1bb0a (patch) | |
tree | 13461adae56564c1c67a3a1a6b683094332059e8 /src/dex.hs | |
parent | fd2f7e40d5b02346d15aab5d747631c8e66221f6 (diff) | |
parent | 47955edfa782958275b94054f9d944e6e980d3d8 (diff) |
Merge branch 'main' into top-level-naming-changes
Diffstat (limited to 'src/dex.hs')
-rw-r--r-- | src/dex.hs | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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 |