diff 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
line wrap: on
line diff
--- a/ir/irsymbol.h	Tue May 06 07:26:27 2008 +0200
+++ b/ir/irsymbol.h	Tue May 06 07:56:03 2008 +0200
@@ -1,7 +1,7 @@
 #ifndef LLVMDC_IR_IRSYMBOL_H
 #define LLVMDC_IR_IRSYMBOL_H
 
-#include "ir/ir.h"
+#include <set>
 
 struct IrModule;
 struct IrFunction;
@@ -10,9 +10,25 @@
 struct IrLocal;
 struct IrField;
 struct IrVar;
+struct Dsymbol;
+
+namespace llvm {
+    struct Value;
+}
 
 struct IrDsymbol
 {
+    static std::set<IrDsymbol*> list;
+    static void resetAll();
+
+    // overload all of these to make sure
+    // the static list is up to date
+    IrDsymbol();
+    IrDsymbol(const IrDsymbol& s);
+    ~IrDsymbol();
+
+    void reset();
+
     Module* DModule;
 
     bool resolved;
@@ -29,12 +45,8 @@
     IrGlobal* irGlobal;
     IrLocal* irLocal;
     IrField* irField;
-    IrVar* getIrVar()
-    {
-        assert(irGlobal || irLocal || irField);
-        return irGlobal ? (IrVar*)irGlobal : irLocal ? (IrVar*)irLocal : (IrVar*)irField;
-    }
-    llvm::Value*& getIrValue() { return getIrVar()->value; }
+    IrVar* getIrVar();
+    llvm::Value*& getIrValue();
 };
 
 #endif