changeset 161:3a891cfcd249 trunk

[svn r177] moved variable for interface info type from being local static to being within IRState
author ChristianK
date Sun, 04 May 2008 21:25:48 +0200
parents b77664331d06
children 1856c62af24b
files gen/irstate.cpp gen/irstate.h gen/tollvm.cpp
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gen/irstate.cpp	Sun May 04 04:35:27 2008 +0200
+++ b/gen/irstate.cpp	Sun May 04 21:25:48 2008 +0200
@@ -47,6 +47,7 @@
 //////////////////////////////////////////////////////////////////////////////////////////
 IRState::IRState()
 {
+    interfaceInfoType = NULL;
     dmodule = 0;
     module = 0;
     emitMain = false;
--- a/gen/irstate.h	Sun May 04 04:35:27 2008 +0200
+++ b/gen/irstate.h	Sun May 04 21:25:48 2008 +0200
@@ -77,6 +77,9 @@
     Module* dmodule;
     llvm::Module* module;
 
+    // interface info type, used in DtoInterfaceInfoType
+    llvm::StructType* interfaceInfoType;
+
     // ir data associated with DMD Dsymbol nodes 
     std::map<Dsymbol*, IrDsymbol> irDsymbol;
 
--- a/gen/tollvm.cpp	Sun May 04 04:35:27 2008 +0200
+++ b/gen/tollvm.cpp	Sun May 04 21:25:48 2008 +0200
@@ -1789,9 +1789,8 @@
 
 const llvm::StructType* DtoInterfaceInfoType()
 {
-    static const llvm::StructType* t = NULL;
-    if (t)
-        return t;
+    if (gIR->interfaceInfoType)
+        return gIR->interfaceInfoType;
 
     // build interface info type
     std::vector<const llvm::Type*> types;
@@ -1808,7 +1807,7 @@
     // int offset
     types.push_back(llvm::Type::Int32Ty);
     // create type
-    t = llvm::StructType::get(types);
+    gIR->interfaceInfoType = llvm::StructType::get(types);
 
-    return t;
+    return gIR->interfaceInfoType;
 }