From a3ec0aab7f35174832fe39e32c7d0c0571cb3b88 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 7 Apr 2009 16:11:18 +0000 Subject: [PATCH] Stopped the built-in operators from being transformed into PROCs --- transformations/SimplifyExprs.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index caf9623..656ae2b 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -45,6 +45,11 @@ simplifyExprs = , transformConstr ] +-- These are a special case, and do not get pulled up, nor turned into PROCs: +builtInOperatorFunction :: A.Name -> Bool +builtInOperatorFunction = (`elem` occamBuiltInOperatorFunctions) . A.nameName + + -- | Convert FUNCTION declarations to PROCs. functionsToProcs :: Pass functionsToProcs = pass "Convert FUNCTIONs to PROCs" @@ -55,6 +60,7 @@ functionsToProcs = pass "Convert FUNCTIONs to PROCs" where doSpecification :: A.Specification -> PassM A.Specification doSpecification (A.Specification m n (A.Function mf smrm rts fs evp)) + | not (builtInOperatorFunction n) = do -- Create new names for the return values. specs <- sequence [makeNonceVariable "return_formal" mf t A.Abbrev | t <- rts] let names = [n | A.Specification mf n _ <- specs]