mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 10:33:14 +01:00
Moved ir/irtype.* into ir/irdtype.*.
Renamed IrType to IrDType, analogous to IrDSymbol.
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user