# HG changeset patch # User Frits van Bommel # Date 1238537601 -7200 # Node ID 7562457bb7f334b55a72fae935df88906df30de4 # Parent a6dbd571d417d503b9b09f78e9160e6ff9916bd3# Parent 8baf611f000916171a9f90f33bf49616ab255ad4 Automated merge with http://hg.dsource.org/projects/ldc diff -r 8baf611f0009 -r 7562457bb7f3 dmd/mtype.h --- a/dmd/mtype.h Wed Apr 01 00:01:44 2009 +0200 +++ b/dmd/mtype.h Wed Apr 01 00:13:21 2009 +0200 @@ -23,7 +23,7 @@ #if IN_LLVM // llvm -#include "../ir/irtype.h" +#include "../ir/irdtype.h" #include "../ir/irfuncty.h" namespace llvm { class Type; } struct Ir; @@ -279,7 +279,7 @@ #if IN_LLVM // LDC - IrType ir; + IrDType ir; static Ir* sir; #endif }; diff -r 8baf611f0009 -r 7562457bb7f3 gen/toobj.cpp --- a/gen/toobj.cpp Wed Apr 01 00:01:44 2009 +0200 +++ b/gen/toobj.cpp Wed Apr 01 00:13:21 2009 +0200 @@ -96,7 +96,7 @@ // reset all IR data stored in Dsymbols and Types IrDsymbol::resetAll(); - IrType::resetAll(); + IrDType::resetAll(); sir->setState(&ir); diff -r 8baf611f0009 -r 7562457bb7f3 ir/irdtype.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ir/irdtype.cpp Wed Apr 01 00:13:21 2009 +0200 @@ -0,0 +1,34 @@ +#include "gen/llvm.h" +#include "ir/ir.h" +#include "ir/irdtype.h" + +std::set IrDType::list; + +void IrDType::resetAll() +{ + std::set::iterator it; + for(it = list.begin(); it != list.end(); ++it) + (*it)->reset(); +} + +IrDType::IrDType() +{ + assert(list.insert(this).second); + reset(); +} + +IrDType::IrDType(const IrDType& s) +{ + assert(list.insert(this).second); + type = s.type; +} + +IrDType::~IrDType() +{ + list.erase(this); +} + +void IrDType::reset() +{ + type = NULL; +} diff -r 8baf611f0009 -r 7562457bb7f3 ir/irdtype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ir/irdtype.h Wed Apr 01 00:13:21 2009 +0200 @@ -0,0 +1,26 @@ +#ifndef LDC_IR_IRTYPE_H +#define LDC_IR_IRTYPE_H + +#include + +namespace llvm { + class PATypeHolder; +} + +struct IrDType +{ + static std::set list; + static void resetAll(); + + // overload all of these to make sure + // the static list is up to date + IrDType(); + IrDType(const IrDType& s); + ~IrDType(); + + void reset(); + + llvm::PATypeHolder* type; +}; + +#endif diff -r 8baf611f0009 -r 7562457bb7f3 ir/irtype.cpp --- a/ir/irtype.cpp Wed Apr 01 00:01:44 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#include "gen/llvm.h" -#include "ir/ir.h" -#include "ir/irtype.h" - -std::set IrType::list; - -void IrType::resetAll() -{ - std::set::iterator it; - for(it = list.begin(); it != list.end(); ++it) - (*it)->reset(); -} - -IrType::IrType() -{ - assert(list.insert(this).second); - reset(); -} - -IrType::IrType(const IrType& s) -{ - assert(list.insert(this).second); - type = s.type; -} - -IrType::~IrType() -{ - list.erase(this); -} - -void IrType::reset() -{ - type = NULL; -} diff -r 8baf611f0009 -r 7562457bb7f3 ir/irtype.h --- a/ir/irtype.h Wed Apr 01 00:01:44 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#ifndef LDC_IR_IRTYPE_H -#define LDC_IR_IRTYPE_H - -#include - -namespace llvm { - class PATypeHolder; -} - -struct IrType -{ - static std::set list; - static void resetAll(); - - // overload all of these to make sure - // the static list is up to date - IrType(); - IrType(const IrType& s); - ~IrType(); - - void reset(); - - llvm::PATypeHolder* type; -}; - -#endif