aboutsummaryrefslogtreecommitdiff
path: root/symbol.h
blob: 454e8bc493e8424219afa58a2924c87453f9a042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "ir.h"
#include "type.h"


enum symbol_type {
	ST_VAR,
	ST_FUNC
};

struct pair_tn {
	struct type *type;
	char *name;
};

struct symbol {
	char *name;
	enum symbol_type stype;
	struct type *rtype;
	struct ref ref;

	int numparams;
	struct pair_tn *params;
};


struct symbol* symbol_make_var(char *name, struct type *rtype);
struct symbol* symbol_make_func(char *name, struct type *rtype, int numparams);