Moved ir/irtype.* into ir/irdtype.*.

Renamed IrType to IrDType, analogous to IrDSymbol.
This commit is contained in:
Tomas Lindquist Olsen
2009-03-31 20:21:28 +02:00
parent aa8aad611c
commit c6e9f7f9e2
4 changed files with 16 additions and 16 deletions

View File

@@ -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 @@ struct Type : Object
#if IN_LLVM
// LDC
IrType ir;
IrDType ir;
static Ir* sir;
#endif
};

View File

@@ -96,7 +96,7 @@ llvm::Module* Module::genLLVMModule(Ir* sir)
// reset all IR data stored in Dsymbols and Types
IrDsymbol::resetAll();
IrType::resetAll();
IrDType::resetAll();
sir->setState(&ir);

View File

@@ -1,34 +1,34 @@
#include "gen/llvm.h"
#include "ir/ir.h"
#include "ir/irtype.h"
#include "ir/irdtype.h"
std::set<IrType*> IrType::list;
std::set<IrDType*> IrDType::list;
void IrType::resetAll()
void IrDType::resetAll()
{
std::set<IrType*>::iterator it;
std::set<IrDType*>::iterator it;
for(it = list.begin(); it != list.end(); ++it)
(*it)->reset();
}
IrType::IrType()
IrDType::IrDType()
{
assert(list.insert(this).second);
reset();
}
IrType::IrType(const IrType& s)
IrDType::IrDType(const IrDType& s)
{
assert(list.insert(this).second);
type = s.type;
}
IrType::~IrType()
IrDType::~IrDType()
{
list.erase(this);
}
void IrType::reset()
void IrDType::reset()
{
type = NULL;
}

View File

@@ -7,16 +7,16 @@ namespace llvm {
class PATypeHolder;
}
struct IrType
struct IrDType
{
static std::set<IrType*> list;
static std::set<IrDType*> list;
static void resetAll();
// overload all of these to make sure
// the static list is up to date
IrType();
IrType(const IrType& s);
~IrType();
IrDType();
IrDType(const IrDType& s);
~IrDType();
void reset();