Made sure that the names printed in TOCKEXTERNAL pragmas are fully munged (and thus equivalent to the exact C function name)

This commit is contained in:
Neil Brown 2009-04-03 12:22:19 +00:00
parent d6ad0ba202
commit 9bf32e339d
2 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,7 @@ module GenerateC
, genName
, genRightB
, genStatic
, nameString
, needStackSizes
, justOnly
, withIf

View File

@ -30,6 +30,7 @@ import qualified AST as A
import CompState
import EvalConstants
import EvalLiterals
import GenerateC -- For nameString
import Metadata
import OccamTypes
import Pass
@ -73,7 +74,7 @@ writeIncFile = occamOnlyPass "Write .inc file" [] []
thisProc <- sequence (
[return $ "#PRAGMA TOCKEXTERNAL \"PROC " ++ origN ++ "("
] ++ intersperse (return ",") (map showCode fs) ++
[return $ ") = " ++ A.nameName n ++ "\""
[return $ ") = " ++ nameString n ++ "\""
]) >>* concat
modify $ \cs -> cs { csOriginalTopLevelProcs =
A.nameName n : csOriginalTopLevelProcs cs }
@ -85,7 +86,7 @@ writeIncFile = occamOnlyPass "Write .inc file" [] []
] ++ intersperse (return ",") (map showCode ts) ++
[return $ " FUNCTION " ++ origN ++ "("
] ++ intersperse (return ",") (map showCode fs) ++
[return $ ") = " ++ A.nameName n ++ "\""
[return $ ") = " ++ nameString n ++ "\""
]) >>* concat
modify $ \cs -> cs { csOriginalTopLevelProcs =
A.nameName n : csOriginalTopLevelProcs cs }