diff ir/irstruct.cpp @ 157:5c17f81fc1c1 trunk

[svn r173] moved IR state previously stored in Type into IrType and a Type->IrType map; fixes #7
author ChristianK
date Thu, 01 May 2008 13:32:08 +0200
parents ce7b81fb957f
children db9890b3fb64
line wrap: on
line diff
--- a/ir/irstruct.cpp	Thu May 01 13:05:53 2008 +0200
+++ b/ir/irstruct.cpp	Thu May 01 13:32:08 2008 +0200
@@ -2,6 +2,7 @@
 #include "mtype.h"
 #include "aggregate.h"
 #include "ir/irstruct.h"
+#include "gen/irstate.h"
 
 IrInterface::IrInterface(BaseClass* b, const llvm::StructType* vt)
 {
@@ -26,7 +27,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 IrStruct::IrStruct(Type* t)
- : recty((t->llvmType != NULL) ? *t->llvmType : llvm::OpaqueType::get())
+ : recty((gIR && gIR->irType[t].type) ? *gIR->irType[t].type : llvm::OpaqueType::get())
 {
     type = t;
     defined = false;