1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9#ifndef _MAL_FCN_H
10#define _MAL_FCN_H
11
12#include "mal_instruction.h"
13#include "mal_module.h"
14#include "mal_resolve.h"
15
16#define getLastUpdate(L,I) ((L)->var[I].updated)
17#define getEndScope(L,I) ((L)->var[I].eolife)
18#define getBeginScope(L,I) ((L)->var[I].declared)
19
20/* #define DEBUG_MAL_FCN */
21/* #define DEBUG_CLONE */
22
23mal_export Symbol newFunction(str mod, str nme,int kind);
24mal_export int getPC(MalBlkPtr mb, InstrPtr p);
25
26mal_export Symbol getFunctionSymbol(Module scope, InstrPtr p);
27mal_export void chkFlow(MalBlkPtr mb);
28mal_export void chkDeclarations(MalBlkPtr mb);
29mal_export void clrDeclarations(MalBlkPtr mb);
30mal_export int isLoopBarrier(MalBlkPtr mb, int pc);
31mal_export int getBlockExit(MalBlkPtr mb,int pc);
32mal_export int getBlockBegin(MalBlkPtr mb,int pc);
33mal_export void setVariableScope(MalBlkPtr mb);
34
35mal_export void printFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg);
36mal_export void fprintFunction(FILE *fd, MalBlkPtr mb, MalStkPtr stk, int flg);
37mal_export void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int first, int size);
38
39#include "mal_exception.h"
40
41#define MAXDEPTH 32
42#endif /* _MAL_FCN_H*/
43