diff --git a/src/Juvix/Compiler/Backend/C/Translation/FromReg.hs b/src/Juvix/Compiler/Backend/C/Translation/FromReg.hs index d0d25fbeb0..145559d240 100644 --- a/src/Juvix/Compiler/Backend/C/Translation/FromReg.hs +++ b/src/Juvix/Compiler/Backend/C/Translation/FromReg.hs @@ -313,7 +313,7 @@ fromRegInstr bNoStack info = \case fromValue :: Reg.Value -> Expression fromValue = \case - Reg.Const c -> fromConst c + Reg.ValConst c -> fromConst c Reg.CRef Reg.ConstrField {..} -> case _constrFieldMemRep of Reg.MemRepConstr -> diff --git a/src/Juvix/Compiler/Core/Language/Base.hs b/src/Juvix/Compiler/Core/Language/Base.hs index a307eecce5..5e70174eb9 100644 --- a/src/Juvix/Compiler/Core/Language/Base.hs +++ b/src/Juvix/Compiler/Core/Language/Base.hs @@ -12,7 +12,7 @@ import GHC.Show qualified as Show import Juvix.Compiler.Core.Info (Info, IsInfo, Key) import Juvix.Compiler.Core.Language.Builtins (BuiltinDataTag (..), builtinConstrArgsNum) import Juvix.Extra.Serialize -import Juvix.Prelude hiding (Const) +import Juvix.Prelude import Prettyprinter type Location = Interval diff --git a/src/Juvix/Compiler/Reg/Extra/Base.hs b/src/Juvix/Compiler/Reg/Extra/Base.hs index 42f2716447..b705f47b4b 100644 --- a/src/Juvix/Compiler/Reg/Extra/Base.hs +++ b/src/Juvix/Compiler/Reg/Extra/Base.hs @@ -53,7 +53,7 @@ overValueRefs f = \case goValue :: Value -> Value goValue = \case - Const c -> Const c + ValConst c -> ValConst c CRef x -> CRef $ goConstrField x VRef x -> VRef $ f x diff --git a/src/Juvix/Compiler/Reg/Extra/Info.hs b/src/Juvix/Compiler/Reg/Extra/Info.hs index 9a61ae13a0..95492a6946 100644 --- a/src/Juvix/Compiler/Reg/Extra/Info.hs +++ b/src/Juvix/Compiler/Reg/Extra/Info.hs @@ -144,7 +144,7 @@ computeStringMap strs = snd . run . execState (HashMap.size strs, strs) . mapM g goVal :: (Member (State (Int, HashMap Text Int)) r) => Value -> Sem r () goVal = \case - Const (ConstString str) -> + ValConst (ConstString str) -> modify' ( \(sid :: Int, sstrs) -> if diff --git a/src/Juvix/Compiler/Reg/Interpreter.hs b/src/Juvix/Compiler/Reg/Interpreter.hs index 1263d84862..1fbf83a704 100644 --- a/src/Juvix/Compiler/Reg/Interpreter.hs +++ b/src/Juvix/Compiler/Reg/Interpreter.hs @@ -97,7 +97,7 @@ runFunction hout infoTable args0 info0 = do readValue :: Args -> Vars s -> Value -> ST s Val readValue args tmps = \case - Const c -> return $ readConst c + ValConst c -> return $ readConst c CRef r -> readConstrRef args tmps r VRef r -> readVarRef args tmps r diff --git a/src/Juvix/Compiler/Reg/Language.hs b/src/Juvix/Compiler/Reg/Language.hs index bc8f6632d4..2f94ca05b7 100644 --- a/src/Juvix/Compiler/Reg/Language.hs +++ b/src/Juvix/Compiler/Reg/Language.hs @@ -7,7 +7,7 @@ where import Juvix.Compiler.Reg.Language.Base data Value - = Const Constant + = ValConst Constant | CRef ConstrField | VRef VarRef diff --git a/src/Juvix/Compiler/Reg/Pretty/Base.hs b/src/Juvix/Compiler/Reg/Pretty/Base.hs index ba17525ccf..d5fd200ac6 100644 --- a/src/Juvix/Compiler/Reg/Pretty/Base.hs +++ b/src/Juvix/Compiler/Reg/Pretty/Base.hs @@ -43,7 +43,7 @@ instance PrettyCode ConstrField where instance PrettyCode Value where ppCode = \case - Const x -> Tree.ppCode x + ValConst x -> Tree.ppCode x CRef x -> ppCode x VRef x -> ppCode x diff --git a/src/Juvix/Compiler/Reg/Transformation/InitBranchVars.hs b/src/Juvix/Compiler/Reg/Transformation/InitBranchVars.hs index 5617cf122c..83f9b5957a 100644 --- a/src/Juvix/Compiler/Reg/Transformation/InitBranchVars.hs +++ b/src/Juvix/Compiler/Reg/Transformation/InitBranchVars.hs @@ -73,7 +73,7 @@ initBranchVars = mapT (const goFun) Assign InstrAssign { _instrAssignResult = vref, - _instrAssignValue = Const ConstVoid + _instrAssignValue = ValConst ConstVoid } checkInitialized :: InfoTable -> Bool diff --git a/src/Juvix/Compiler/Reg/Translation/FromAsm.hs b/src/Juvix/Compiler/Reg/Translation/FromAsm.hs index a1b75b325f..732999139b 100644 --- a/src/Juvix/Compiler/Reg/Translation/FromAsm.hs +++ b/src/Juvix/Compiler/Reg/Translation/FromAsm.hs @@ -131,7 +131,7 @@ fromAsmInstr funInfo tab si Asm.CmdInstr {..} = mkValue :: Asm.Value -> Value mkValue = \case - Asm.Constant c -> Const c + Asm.Constant c -> ValConst c Asm.Ref mv -> case mv of Asm.DRef dref -> VRef $ mkVar dref Asm.ConstrRef Asm.Field {..} -> diff --git a/src/Juvix/Compiler/Reg/Translation/FromSource.hs b/src/Juvix/Compiler/Reg/Translation/FromSource.hs index d3c3333110..6d2c60a92d 100644 --- a/src/Juvix/Compiler/Reg/Translation/FromSource.hs +++ b/src/Juvix/Compiler/Reg/Translation/FromSource.hs @@ -463,7 +463,7 @@ varTmp = do value :: (Members '[Reader ParserSig, InfoTableBuilder, State LocalParams] r) => ParsecS r Value -value = (Const <$> constant) <|> varOrConstrRef +value = (ValConst <$> constant) <|> varOrConstrRef varOrConstrRef :: (Members '[Reader ParserSig, InfoTableBuilder, State LocalParams] r) =>