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 , genName
, genRightB , genRightB
, genStatic , genStatic
, nameString
, needStackSizes , needStackSizes
, justOnly , justOnly
, withIf , withIf

View File

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