mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-09 21:39:02 +02: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:
@@ -28,9 +28,6 @@ struct TypeStruct;
|
||||
class IrTypeAggr : public IrType
|
||||
{
|
||||
public:
|
||||
///
|
||||
IrTypeAggr(AggregateDeclaration* ad);
|
||||
|
||||
///
|
||||
IrTypeAggr* isAggr() { return this; }
|
||||
|
||||
@@ -44,6 +41,9 @@ public:
|
||||
iterator def_end() { return default_fields.end(); }
|
||||
|
||||
protected:
|
||||
///
|
||||
IrTypeAggr(AggregateDeclaration* ad);
|
||||
|
||||
/// AggregateDeclaration this type represents.
|
||||
AggregateDeclaration* aggr;
|
||||
|
||||
@@ -61,7 +61,7 @@ class IrTypeStruct : public IrTypeAggr
|
||||
{
|
||||
public:
|
||||
///
|
||||
IrTypeStruct(StructDeclaration* sd);
|
||||
static IrTypeStruct* get(StructDeclaration* sd);
|
||||
|
||||
///
|
||||
IrTypeStruct* isStruct() { return this; }
|
||||
@@ -70,6 +70,9 @@ public:
|
||||
llvm::Type* buildType();
|
||||
|
||||
protected:
|
||||
///
|
||||
IrTypeStruct(StructDeclaration* sd);
|
||||
|
||||
/// StructDeclaration this type represents.
|
||||
StructDeclaration* sd;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user