comparison ir/irsymbol.h @ 173:db9890b3fb64 trunk

[svn r189] moving IR data back into DMD frontend nodes
author ChristianK
date Tue, 06 May 2008 07:56:03 +0200
parents ccd07d9f2ce9
children c44e6a711885
comparison
equal deleted inserted replaced
172:68a7dd38c03c 173:db9890b3fb64
1 #ifndef LLVMDC_IR_IRSYMBOL_H 1 #ifndef LLVMDC_IR_IRSYMBOL_H
2 #define LLVMDC_IR_IRSYMBOL_H 2 #define LLVMDC_IR_IRSYMBOL_H
3 3
4 #include "ir/ir.h" 4 #include <set>
5 5
6 struct IrModule; 6 struct IrModule;
7 struct IrFunction; 7 struct IrFunction;
8 struct IrStruct; 8 struct IrStruct;
9 struct IrGlobal; 9 struct IrGlobal;
10 struct IrLocal; 10 struct IrLocal;
11 struct IrField; 11 struct IrField;
12 struct IrVar; 12 struct IrVar;
13 struct Dsymbol;
14
15 namespace llvm {
16 struct Value;
17 }
13 18
14 struct IrDsymbol 19 struct IrDsymbol
15 { 20 {
21 static std::set<IrDsymbol*> list;
22 static void resetAll();
23
24 // overload all of these to make sure
25 // the static list is up to date
26 IrDsymbol();
27 IrDsymbol(const IrDsymbol& s);
28 ~IrDsymbol();
29
30 void reset();
31
16 Module* DModule; 32 Module* DModule;
17 33
18 bool resolved; 34 bool resolved;
19 bool declared; 35 bool declared;
20 bool initialized; 36 bool initialized;
27 IrFunction* irFunc; 43 IrFunction* irFunc;
28 44
29 IrGlobal* irGlobal; 45 IrGlobal* irGlobal;
30 IrLocal* irLocal; 46 IrLocal* irLocal;
31 IrField* irField; 47 IrField* irField;
32 IrVar* getIrVar() 48 IrVar* getIrVar();
33 { 49 llvm::Value*& getIrValue();
34 assert(irGlobal || irLocal || irField);
35 return irGlobal ? (IrVar*)irGlobal : irLocal ? (IrVar*)irLocal : (IrVar*)irField;
36 }
37 llvm::Value*& getIrValue() { return getIrVar()->value; }
38 }; 50 };
39 51
40 #endif 52 #endif