Made sure that non-top-level specs still have forward declarations in the .c file (and not in the .h file)

This commit is contained in:
Neil Brown 2009-04-02 15:43:49 +00:00
parent dbd315abd6
commit 350057c314

View File

@ -165,8 +165,15 @@ cgenTopLevel headerName s
tell ["#include <tock_support_cif.h>\n"]
cs <- getCompState
let isTopLevelSpec (A.Specification _ n _)
= A.nameName n `elem` (csOriginalTopLevelProcs cs)
tellToHeader $ sequence_ $ map (call genForwardDeclaration)
(listify (const True :: A.Specification -> Bool) s)
(listify isTopLevelSpec s)
-- Things like lifted wrapper_procs we still need to forward-declare,
-- but we do it in the C file, not in the header:
sequence_ $ map (call genForwardDeclaration)
(listify (not . isTopLevelSpec) s)
tell ["#include \"", dropPath headerName, "\"\n"]