git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: restore fn composition inlining
commitfebbf0aabd55d46eb831c1b7885f91699d005e9a authorAndy Arvanitis <andyarvanitis@gmail.com> dateSat 13 Aug 2016, 22:09 (10 years ago) parentd63fb7c
1 file changed+4−1
src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+4−1
src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+4−1
@@ -267,10 +267,13 @@ inlineFnComposition :: (MonadSupply m) => Cpp -> m Cpp
267267inlineFnComposition = everywhereOnCppTopDownM convert
268268 where
269269 convert :: (MonadSupply m) => Cpp -> m Cpp
270+ convert (CppApp fn [dict', x, y, z])
271+ | isFnCompose dict' fn = return $ CppApp x [CppApp y [z]]
272+ | isFnComposeFlipped dict' fn = return $ CppApp y [CppApp x [z]]
270273 convert (CppApp (CppApp (CppApp (CppApp fn [dict']) [x]) [y]) [z])
271274 | isFnCompose dict' fn = return $ CppApp x [CppApp y [z]]
272275 | isFnComposeFlipped dict' fn = return $ CppApp y [CppApp x [z]]
273− convert (CppApp (CppApp (CppApp fn [dict']) [x]) [y])
276+ convert (CppApp fn [dict', x, y])
274277 | isFnCompose dict' fn = do
275278 arg <- freshName
276279 return $ CppLambda [CppCaptureAll] [(arg, constAnyRef)] Nothing (CppBlock [CppReturn $ CppApp x [CppApp y [CppVar arg]]])