ldc/ir/irtype.cpp
Tomas Lindquist Olsen 9f3be435b0 [svn r209] Fixed: exotic array to pointer casts were broken.
Changed: classes now have opaque vtables.
2008-05-12 18:44:11 +02:00

40 lines
584 B
C++

#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()
{
assert(list.insert(this).second);
reset();
}
IrType::IrType(const IrType& s)
{
assert(list.insert(this).second);
type = s.type;
#if OPAQUE_VTBLS
vtblType = s.type;
#endif
}
IrType::~IrType()
{
list.erase(this);
}
void IrType::reset()
{
type = NULL;
#if OPAQUE_VTBLS
vtblType = NULL;
#endif
}