@@ -42,9 +42,13 @@ typedef struct TYPE type;
4242
4343namespace dmd
4444{
45+ void Type_init ();
4546 Type *typeSemantic (Type *t, Loc loc, Scope *sc);
4647 Type *merge (Type *type);
4748 Expression *defaultInitLiteral (Type *t, Loc loc);
49+ Type *toBasetype (Type *type);
50+ Type *nextOf (Type* type);
51+ Type *baseElemOf (Type* type);
4852}
4953
5054enum class TY : uint8_t
@@ -215,6 +219,8 @@ class Type : public ASTNode
215219
216220 static Type *basic[(int )TY ::TMAX ];
217221
222+ static void _init () { return dmd::Type_init (); }
223+
218224 virtual const char *kind ();
219225 Type *copy () const ;
220226 virtual Type *syntaxCopy ();
@@ -241,6 +247,10 @@ class Type : public ASTNode
241247 bool isNaked () const { return mod == 0 ; }
242248 Type *nullAttributes () const ;
243249
250+ Type *toBasetype () { return dmd::toBasetype (this ); }
251+ Type *nextOf () { return dmd::nextOf (this ); }
252+ Type *baseElemOf () { return dmd::baseElemOf (this ); }
253+
244254 virtual ClassDeclaration *isClassHandle ();
245255 virtual int hasWild () const ;
246256
@@ -732,15 +742,13 @@ namespace dmd
732742 Type *addMod (Type *type, MOD mod);
733743 Type *addStorageClass (Type *type, StorageClass stc);
734744 Type *substWildTo (Type *type, unsigned mod);
735- Type *toBasetype (Type *type);
736745 uinteger_t size (Type *type);
737746 uinteger_t size (Type *type, Loc loc);
738747 MATCH implicitConvTo (Type* from, Type* to);
739748 MATCH constConv (Type* from, Type* to);
740749 bool hasUnsafeBitpatterns (Type* type);
741750 bool hasInvariant (Type* type);
742751 bool hasVoidInitPointers (Type* type);
743- void Type_init ();
744752 void transitive (TypeNext* type);
745753 structalign_t alignment (Type* type);
746754 Type* memType (TypeEnum* type);
@@ -754,8 +762,6 @@ namespace dmd
754762 Type *makeWildConst (Type* type);
755763 Type *makeSharedWild (Type* type);
756764 Type *makeSharedWildConst (Type* type);
757- Type *nextOf (Type* type);
758- Type *baseElemOf (Type* type);
759765 Type *isLazyArray (Parameter* param);
760766 unsigned char deduceWild (Type* type, Type* t, bool isRef);
761767 bool isIntegral (Type* type);
0 commit comments