mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Refactored IrType construction to use static get() method.
This also allows us to enable the assert in IrType::IrType. Unfortunately, this is mostly a "peace of mind" commit, there doesn't seem to have been a bug actually caused by the transitory duplicate IrTypePointer/IrTypeStruct instances. The remaining xyz2llvm static methods are not exactly pretty, they should probably just be folded into get.
This commit is contained in:
@@ -23,18 +23,17 @@ class IrTypeFunction : public IrType
|
||||
{
|
||||
public:
|
||||
///
|
||||
IrTypeFunction(Type* dt);
|
||||
static IrTypeFunction* get(Type* dt);
|
||||
|
||||
///
|
||||
IrTypeFunction* isFunction() { return this; }
|
||||
|
||||
///
|
||||
llvm::Type* buildType();
|
||||
|
||||
IrFuncTy* fty() { return irfty; }
|
||||
|
||||
protected:
|
||||
llvm::Type* func2llvm(Type* dt);
|
||||
///
|
||||
IrTypeFunction(Type* dt, llvm::Type* lt);
|
||||
|
||||
///
|
||||
IrFuncTy* irfty;
|
||||
};
|
||||
@@ -44,15 +43,14 @@ class IrTypeDelegate : public IrType
|
||||
{
|
||||
public:
|
||||
///
|
||||
IrTypeDelegate(Type* dt);
|
||||
static IrTypeDelegate* get(Type* dt);
|
||||
|
||||
///
|
||||
IrTypeDelegate* isDelegate() { return this; }
|
||||
|
||||
///
|
||||
llvm::Type* buildType();
|
||||
protected:
|
||||
llvm::Type* delegate2llvm(Type* dt);
|
||||
///
|
||||
IrTypeDelegate(Type* dt, llvm::Type* lt);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user