git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: 0.10.2 merge fixes
commit9355f2f516b4da4ebb588e9b951aec6fa9c646ff authorAndy Arvanitis <andyarvanitis@gmail.com> dateTue 8 Nov 2016, 13:40 (10 years ago) parent7e46b25
6 files changed+23−17
pcc/Main.hs+4−3 pcc/TestMain.hs+12−8 purescript.cabal+2−1 src/Language/PureScript/CodeGen/Cpp.hs+1−1 src/Language/PureScript/CodeGen/Cpp/Optimizer.hs+1−1 src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+3−3
pcc/Main.hs+4−3
@@ -29,6 +29,7 @@ import Data.Bool (bool)
2929import qualified Data.ByteString.Lazy as B
3030import qualified Data.ByteString.UTF8 as BU8
3131import qualified Data.Map as M
32+import Data.Text (Text)
3233import Data.Version (showVersion)
3334
3435import qualified Language.PureScript as P
@@ -42,7 +43,7 @@ import qualified System.Console.ANSI as ANSI
4243import System.Exit (exitSuccess, exitFailure)
4344import System.FilePath.Glob (glob)
4445import System.IO (hSetEncoding, hPutStrLn, stdout, stderr, utf8)
45−import System.IO.UTF8
46+import System.IO.UTF8 (readUTF8FileT)
4647
4748import Make
4849import Makefile
@@ -100,8 +101,8 @@ globWarningOnMisses warn = concatMapM globWithWarning
100101 return paths
101102 concatMapM f = liftM concat . mapM f
102103
103−readInput :: [FilePath] -> IO [(FilePath, String)]
104−readInput inputFiles = forM inputFiles $ \inFile -> (inFile, ) <$> readUTF8File inFile
104+readInput :: [FilePath] -> IO [(FilePath, Text)]
105+readInput inputFiles = forM inputFiles $ \inFile -> (inFile, ) <$> readUTF8FileT inFile
105106
106107inputFile :: Parser FilePath
107108inputFile = strArgument $
pcc/TestMain.hs+12−8
@@ -98,14 +98,18 @@ repo = "git://github.com/pure11/"
9898packages :: [(String, String)]
9999-------------------------------------------------------------------------------
100100packages =
101− [ ("purescript-eff", "")
102− , ("purescript-prelude", "")
103− , ("purescript-assert", "")
104− , ("purescript-st", "")
105− , ("purescript-console", "")
106− , ("purescript-functions", "")
107− , ("purescript-partial", "")
108− , ("purescript-newtype", "")
101+ [ ("purescript-eff", "")
102+ , ("purescript-prelude", "")
103+ , ("purescript-assert", "")
104+ , ("purescript-st", "")
105+ , ("purescript-console", "")
106+ , ("purescript-functions", "")
107+ , ("purescript-partial", "")
108+ , ("purescript-newtype", "")
109+ , ("purescript-control", "")
110+ , ("purescript-invariant", "")
111+ , ("purescript-monoid", "")
112+ , ("purescript-generics-rep", "")
109113 ]
110114
111115-------------------------------------------------------------------------------
purescript.cabal+2−1
@@ -533,6 +533,7 @@ executable pcc
533533 mtl -any,
534534 optparse-applicative >= 0.12.1,
535535 parsec -any,
536+ text -any,
536537 time -any,
537538 transformers -any,
538539 transformers-compat -any,
@@ -540,7 +541,7 @@ executable pcc
540541 main-is: Main.hs
541542 buildable: True
542543 hs-source-dirs: pcc
543− other-modules: Paths_purescript
544+ other-modules: Paths_purescript Make Makefile
544545 ghc-options: -Wall -O2 -fno-warn-unused-do-bind -threaded -rtsopts "-with-rtsopts=-N"
545546
546547
src/Language/PureScript/CodeGen/Cpp.hs+1−1
@@ -795,7 +795,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
795795 catMaybes . map modCtor . M.keys $ E.dataConstructors env]]
796796 where
797797 modCtor :: Qualified (ProperName a) -> Maybe String
798− modCtor (Qualified (Just mn') (ProperName name)) | mn' == mn = Just name
798+ modCtor (Qualified (Just mn') (ProperName name)) | mn' == mn = Just $ identToCpp (Ident name)
799799 modCtor _ = Nothing
800800
801801 -------------------------------------------------------------------------------------------------
src/Language/PureScript/CodeGen/Cpp/Optimizer.hs+1−1
@@ -89,7 +89,7 @@ optimize' nm cpp = do
8989 , inlineOperator (C.dataFunction, C.apply) $ \f x -> CppApp f [x]
9090 , inlineOperator (C.prelude, (C.#)) $ \x f -> CppApp f [x]
9191 , inlineOperator (C.dataFunction, C.applyFlipped) $ \x f -> CppApp f [x]
92− , inlineOperator (C.dataArrayUnsafe, C.unsafeIndex) $ flip CppIndexer
92+ , inlineOperator (C.dataArray, C.unsafeIndex) $ flip CppIndexer
9393 , inlineCommonOperators
9494 ]) cpp
9595
src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+3−3
@@ -188,9 +188,9 @@ inlineCommonOperators = applyAll $
188188 , binary heytingAlgebraBoolean opDisj Or
189189 , unary heytingAlgebraBoolean opNot Not
190190
191− , binary' C.dataIntBits (C..|.) BitwiseOr
192− , binary' C.dataIntBits (C..&.) BitwiseAnd
193− , binary' C.dataIntBits (C..^.) BitwiseXor
191+ , binary' C.dataIntBits (C.or) BitwiseOr
192+ , binary' C.dataIntBits (C.and) BitwiseAnd
193+ , binary' C.dataIntBits (C.xor) BitwiseXor
194194 , binary' C.dataIntBits C.shl ShiftLeft
195195 , binary' C.dataIntBits C.shr ShiftRight
196196 -- , binary' C.dataIntBits C.zshr ZeroFillShiftRight