diff ir/irtype.cpp @ 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
children 16e676ae5ab4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ir/irtype.cpp	Tue May 06 07:56:03 2008 +0200
@@ -0,0 +1,36 @@
+#include "gen/llvm.h"
+#include "ir/ir.h"
+#include "ir/irtype.h"
+
+std::set<IrType*> IrType::list;
+
+void IrType::resetAll()
+{
+    std::set<IrType*>::iterator it;
+    for(it = list.begin(); it != list.end(); ++it)
+        (*it)->reset();
+}
+
+IrType::IrType()
+{
+    list.insert(this);
+    reset();
+}
+
+IrType::IrType(const IrType& s)
+{
+    list.insert(this);
+    type = s.type;
+    vtblType = s.type;
+}
+
+IrType::~IrType()
+{
+    list.erase(this);
+}
+
+void IrType::reset()
+{
+    type = NULL;
+    vtblType = NULL;
+}