git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: fix issue with thunk inlining
commitf14293c13c46beb19d0a45a0484634fe94cd5d1d authorAndy Arvanitis <andyarvanitis@gmail.com> dateTue 9 May 2017, 23:15 (9 years ago) parent00b51f9
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
@@ -73,7 +73,10 @@ unThunk = everywhereOnCpp convert
7373 convert (CppBlock []) = CppBlock []
7474 convert (CppBlock cpps) =
7575 case last cpps of
76− CppReturn (CppApp (CppLambda _ [] _ (CppBlock body)) []) -> CppBlock $ init cpps ++ body
76+ CppReturn (CppApp (CppLambda _ [] _ (CppBlock body)) []) ->
77+ case last body of
78+ CppReturn _ -> CppBlock $ init cpps ++ [CppIfElse (CppBooleanLiteral True) (CppBlock body) Nothing]
79+ _ -> CppBlock cpps
7780 _ -> CppBlock cpps
7881 convert cpp = cpp
7982