diff ir/irsymbol.h @ 156:ccd07d9f2ce9 trunk

[svn r172] moving all IR state previously stored in Dsymbol into IrDsymbol and a Dsymbol->IrDsymbol map
author ChristianK
date Thu, 01 May 2008 13:05:53 +0200
parents
children db9890b3fb64
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ir/irsymbol.h	Thu May 01 13:05:53 2008 +0200
@@ -0,0 +1,40 @@
+#ifndef LLVMDC_IR_IRSYMBOL_H
+#define LLVMDC_IR_IRSYMBOL_H
+
+#include "ir/ir.h"
+
+struct IrModule;
+struct IrFunction;
+struct IrStruct;
+struct IrGlobal;
+struct IrLocal;
+struct IrField;
+struct IrVar;
+
+struct IrDsymbol
+{
+    Module* DModule;
+
+    bool resolved;
+    bool declared;
+    bool initialized;
+    bool defined;
+
+    IrModule* irModule;
+
+    IrStruct* irStruct;
+
+    IrFunction* irFunc;
+
+    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; }
+};
+
+#endif