From 40b9a8b76b5c3a232986dab616458a3d586b3b48 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 2 Feb 2009 17:23:28 +0000 Subject: [PATCH] Fixed the generated PROCs for copying records not having their definition recorded --- transformations/SimplifyProcs.hs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/transformations/SimplifyProcs.hs b/transformations/SimplifyProcs.hs index cbc7533..d7870f8 100644 --- a/transformations/SimplifyProcs.hs +++ b/transformations/SimplifyProcs.hs @@ -156,6 +156,19 @@ flattenAssign = pass "Flatten assignment" (A.SubscriptedVariable m sub srcV)) | (fName, fType) <- fs] let code = A.Seq m $ A.Several m $ map (A.Only m) assigns + n' = n {A.nameName = "copy_" ++ A.nameName n} + proc = A.Proc m (A.InlineSpec, A.PlainRec) + [A.Formal A.Abbrev t nonceLHS, A.Formal A.ValAbbrev t nonceRHS] + code + defineName n' $ A.NameDef { + A.ndMeta = m, + A.ndName = A.nameName n', + A.ndOrigName = A.nameName n', + A.ndSpecType = proc, + A.ndAbbrevMode = A.Original, + A.ndNameSource = A.NameNonce, + A.ndPlacement = A.Unplaced + } + - return (A.Spec m (A.Specification m (n {A.nameName = "copy_" ++ A.nameName n}) - (A.Proc m (A.InlineSpec, A.PlainRec) [A.Formal A.Abbrev t nonceLHS, A.Formal A.ValAbbrev t nonceRHS] code))) + return (A.Spec m (A.Specification m n' proc))