Skip to content

Commit

Permalink
Remove VampIR compile command and tests (#3104)
Browse files Browse the repository at this point in the history
* Closes #2841 
* Moves the `vampir` compilation target under `dev`.
* Removes VampIR tests that require the external `vamp-ir` executable.
  • Loading branch information
lukaszcz authored Oct 16, 2024
1 parent c50ad06 commit f1bb0e5
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 481 deletions.
2 changes: 0 additions & 2 deletions app/Commands/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Commands.Compile.Cairo qualified as Cairo
import Commands.Compile.Native qualified as Native
import Commands.Compile.Options
import Commands.Compile.RiscZeroRust qualified as RiscZeroRust
import Commands.Compile.Vampir qualified as Vampir
import Commands.Compile.Wasi qualified as Wasi

runCommand :: (Members AppEffects r) => CompileCommand -> Sem r ()
Expand All @@ -19,5 +18,4 @@ runCommand = \case
Wasi opts -> Wasi.runCommand opts
Anoma opts -> Anoma.runCommand opts
Cairo opts -> Cairo.runCommand opts
Vampir opts -> Vampir.runCommand opts
RiscZeroRust opts -> RiscZeroRust.runCommand opts
5 changes: 1 addition & 4 deletions app/Commands/Compile/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Commands.Compile.Anoma.Options
import Commands.Compile.Cairo.Options
import Commands.Compile.Native.Options
import Commands.Compile.RiscZeroRust.Options
import Commands.Compile.Vampir.Options
import Commands.Compile.Wasi.Options
import Commands.Extra.NewCompile
import CommonOptions
Expand All @@ -16,7 +15,6 @@ import Juvix.Config qualified as Config
data CompileCommand
= Native (NativeOptions 'InputMain)
| Wasi (WasiOptions 'InputMain)
| Vampir (VampirOptions 'InputMain)
| Anoma (AnomaOptions 'InputMain)
| Cairo (CairoOptions 'InputMain)
| RiscZeroRust (RiscZeroRustOptions 'InputMain)
Expand All @@ -27,8 +25,7 @@ parseCompileCommand = commandTargetsHelper supportedTargets

supportedTargets :: [(CompileTarget, Parser CompileCommand)]
supportedTargets =
[ (AppTargetVampIR, Vampir <$> parseVampir),
(AppTargetAnoma, Anoma <$> parseAnoma),
[ (AppTargetAnoma, Anoma <$> parseAnoma),
(AppTargetCairo, Cairo <$> parseCairo),
(AppTargetNative64, Native <$> parseNative)
]
Expand Down
2 changes: 2 additions & 0 deletions app/Commands/Dev/DevCompile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Commands.Dev.DevCompile.Options
import Commands.Dev.DevCompile.Reg qualified as Reg
import Commands.Dev.DevCompile.Rust qualified as Rust
import Commands.Dev.DevCompile.Tree qualified as Tree
import Commands.Dev.DevCompile.Vampir qualified as Vampir

runCommand :: (Members AppEffects r) => DevCompileCommand -> Sem r ()
runCommand = \case
Expand All @@ -19,3 +20,4 @@ runCommand = \case
Casm opts -> Casm.runCommand opts
Rust opts -> Rust.runCommand opts
NativeRust opts -> NativeRust.runCommand opts
Vampir opts -> Vampir.runCommand opts
12 changes: 11 additions & 1 deletion app/Commands/Dev/DevCompile/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Commands.Dev.DevCompile.NativeRust.Options
import Commands.Dev.DevCompile.Reg.Options
import Commands.Dev.DevCompile.Rust.Options
import Commands.Dev.DevCompile.Tree.Options
import Commands.Dev.DevCompile.Vampir.Options
import CommonOptions
import Juvix.Config qualified as Config

Expand All @@ -18,6 +19,7 @@ data DevCompileCommand
| Casm (CasmOptions 'InputMain)
| Rust (RustOptions 'InputMain)
| NativeRust (NativeRustOptions 'InputMain)
| Vampir (VampirOptions 'InputMain)
deriving stock (Data)

parseDevCompileCommand :: Parser DevCompileCommand
Expand All @@ -28,7 +30,8 @@ parseDevCompileCommand =
commandReg,
commandTree,
commandCasm,
commandAsm
commandAsm,
commandVampir
]
<> [commandRust | Config.config ^. Config.configRust]
<> [commandNativeRust | Config.config ^. Config.configRust]
Expand Down Expand Up @@ -82,3 +85,10 @@ commandNativeRust =
info
(NativeRust <$> parseNativeRust)
(progDesc "Compile to native executable through Rust")

commandVampir :: Mod CommandFields DevCompileCommand
commandVampir =
command "vampir" $
info
(Vampir <$> parseVampir)
(progDesc "Compile to VampIR")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Commands.Compile.Vampir where
module Commands.Dev.DevCompile.Vampir where

import Commands.Base
import Commands.Compile.Vampir.Options
import Commands.Dev.DevCompile.Vampir.Options
import Commands.Extra.NewCompile
import Juvix.Compiler.Backend.VampIR.Translation qualified as VampIR

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE UndecidableInstances #-}

module Commands.Compile.Vampir.Options
( module Commands.Compile.Vampir.Options,
module Commands.Dev.DevCompile.Vampir.Options
( module Commands.Dev.DevCompile.Vampir.Options,
module Commands.Compile.CommonOptions,
)
where
Expand Down
2 changes: 1 addition & 1 deletion test/Core/VampIR/Positive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ toTestDescr = Normalize.toTestDescr' (const (coreVampIRAssertion (toStoredTransf
allTests :: TestTree
allTests =
testGroup
"JuvixCore VampIR positive tests"
"JuvixCore VampIR pipeline positive tests"
(map (mkTest . toTestDescr) Normalize.tests)
2 changes: 0 additions & 2 deletions test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Scope qualified
import Termination qualified
import Tree qualified
import Typecheck qualified
import VampIR qualified

slowTests :: IO TestTree
slowTests =
Expand All @@ -42,7 +41,6 @@ slowTests =
return Compilation.allTests,
return Examples.allTests,
Casm.allTests,
VampIR.allTests,
return Anoma.allTests,
return Repl.allTests
]
Expand Down
18 changes: 0 additions & 18 deletions test/VampIR.hs

This file was deleted.

32 changes: 0 additions & 32 deletions test/VampIR/Compilation/Base.hs

This file was deleted.

37 changes: 0 additions & 37 deletions test/VampIR/Compilation/Negative.hs

This file was deleted.

162 changes: 0 additions & 162 deletions test/VampIR/Compilation/Positive.hs

This file was deleted.

Loading

0 comments on commit f1bb0e5

Please sign in to comment.