X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Finterpreter%2Ffree.c;h=08d0a33e0f567cf06bcfb0500c030e3491adac09;hb=b86f4b95cb51d69a2537217132f675afa1e9519c;hp=d58635bb1898fe88fe19bf6789b8daa68abbc950;hpb=b9ad54f9b2bb99d2d3d62c61e2da71e076938f18;p=ghc-hetmet.git diff --git a/ghc/interpreter/free.c b/ghc/interpreter/free.c index d58635b..08d0a33 100644 --- a/ghc/interpreter/free.c +++ b/ghc/interpreter/free.c @@ -2,18 +2,19 @@ /* -------------------------------------------------------------------------- * Free variable analysis * - * Copyright (c) The University of Nottingham and Yale University, 1994-1997. - * All rights reserved. See NOTICE for details and conditions of use etc... - * Hugs version 1.4, December 1997 + * The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the + * Yale Haskell Group, and the Oregon Graduate Institute of Science and + * Technology, 1994-1999, All rights reserved. It is distributed as + * free software under the license in the file "License", which is + * included in the distribution. * * $RCSfile: free.c,v $ - * $Revision: 1.4 $ - * $Date: 1999/04/27 10:06:52 $ + * $Revision: 1.12 $ + * $Date: 2000/04/27 16:35:29 $ * ------------------------------------------------------------------------*/ -#include "prelude.h" +#include "hugsbasictypes.h" #include "storage.h" -#include "backend.h" #include "connect.h" #include "errors.h" @@ -22,11 +23,11 @@ * Local functions * ------------------------------------------------------------------------*/ -static List freeVarsAlt Args((List, StgCaseAlt)); -static List freeVarsPrimAlt Args((List, StgPrimAlt)); -static List freeVarsExpr Args((List, StgExpr)); -static List freeVarsAtom Args((List, StgAtom)); -static List freeVarsVar Args((List, StgVar)); +static List freeVarsAlt ( List, StgCaseAlt ); +static List freeVarsPrimAlt ( List, StgPrimAlt ); +static List freeVarsExpr ( List, StgExpr ); +static List freeVarsAtom ( List, StgAtom ); +static List freeVarsVar ( List, StgVar ); /* -------------------------------------------------------------------------- * Free variable analysis @@ -90,6 +91,9 @@ static List freeVarsPrimAlt( List acc, StgPrimAlt alt ) static List freeVarsExpr( List acc, StgExpr e ) { +#if 0 + printf( "freeVarsExpr: " );ppStgExpr(e);printf("\n"); +#endif switch (whatIs(e)) { case LETREC: mapAccum(freeVarsBind,acc,stgLetBinds(e)); @@ -114,11 +118,12 @@ static List freeVarsExpr( List acc, StgExpr e ) case STGVAR: return freeVarsVar(acc, e); case NAME: + case TUPLE: return acc; /* Names are never free vars */ default: -printf("\n\n"); -ppStgExpr(e); -printf("\n"); + printf("\n"); + ppStgExpr(e); + printf("\n"); internal("freeVarsExpr"); } }