-
Notifications
You must be signed in to change notification settings - Fork 1
/
var.h
57 lines (49 loc) · 1.12 KB
/
var.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* -*-Mode: c++;-*-
Copyright (c) 2003-2010 John Plevyak, All Rights Reserved
*/
#ifndef _var_H_
#define _var_H_
class AVar;
class CreationSet;
class AType;
class Sym;
class PNode;
class SSUVar;
class CreationSet;
namespace llvm {
class Value;
class Type;
} // namespace llvm
typedef MapElem<void *, AVar *> AVarMapElem;
typedef Map<void *, AVar *> AVarMap;
typedef Map<Var *, Var *> VarMap;
extern int var_id;
class Var : public gc {
public:
Sym *sym;
int id;
Sym *type;
int mark; // used by ssu.cpp
PNode *def;
Vec<PNode *> uses;
AVarMap avars; // used by fa.cpp
CreationSet *as_CreationSet; // used by fa.cpp
unsigned int is_internal : 1;
unsigned int is_filtered : 1;
unsigned int is_formal : 1;
unsigned int live : 1;
Sym *constant; // valid after dead code elimination
cchar *cg_string; // used by cg.cpp
llvm::Value *llvm_value;
llvm::Type *llvm_type;
// Temporary Space
union {
SSUVar *ssu;
};
Var *copy();
Var(Sym *s);
};
#define forv_Var(_p, _v) forv_Vec(Var, _p, _v)
#define form_AVarMapElem(_p, _v) form_Map(AVarMapElem, _p, _v)
void pp(Var *);
#endif