Add missing ptr null to constructors with no arguments (e.g. Nil)

This commit is contained in:
Martin Fredin 2023-05-14 13:24:18 +02:00
parent 86256066b6
commit 2d41dac6eb

View file

@ -17,13 +17,13 @@ import Control.Monad.State (gets, modify)
import Data.Char (ord)
import Data.Coerce (coerce)
import Data.Foldable.Extra (notNull)
import Data.List (isPrefixOf)
import qualified Data.Map as Map
import Data.Maybe (fromJust, fromMaybe, isNothing)
import Data.Tuple.Extra (second)
import Debug.Trace (traceShow)
import Grammar.Print (printTree)
import Monomorphizer.MonomorphizerIr
import Debug.Trace (traceShow)
import Data.List (isPrefixOf)
compileScs :: [Def] -> CompilerState ()
@ -480,7 +480,7 @@ exprToValue et@(e, t) = case e of
pure $ VIdent vc (type2LlvmType t)
| otherwise -> pure $ VFunction name Global (type2LlvmType t)
where
call = Call FastCC (type2LlvmType t) Global name []
call = Call FastCC (type2LlvmType t) Global name [(Ptr, VNull)]
Nothing -> gets $ val
. fromJust