Skip to content

Commit

Permalink
Rename Type::typeinfo to _typeinfo so it can be accessed from the glu…
Browse files Browse the repository at this point in the history
…e layer
  • Loading branch information
yebblies committed Jul 29, 2013
1 parent e0eefaf commit 9d9a70c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/class.c
Expand Up @@ -78,7 +78,7 @@ ClassDeclaration::ClassDeclaration(Loc loc, Identifier *id, BaseClasses *basecla
if (id == Id::TypeInfo)
{ if (!inObject)
error("%s", msg);
Type::typeinfo = this;
Type::dtypeinfo = this;
}

if (id == Id::TypeInfo_Class)
Expand Down
4 changes: 2 additions & 2 deletions src/ctfeexpr.c
Expand Up @@ -548,8 +548,8 @@ TypeAArray *toBuiltinAAType(Type *t)
bool isTypeInfo_Class(Type *type)
{
return type->ty == Tclass &&
(( Type::typeinfo == ((TypeClass*)type)->sym)
|| Type::typeinfo->isBaseOf(((TypeClass*)type)->sym, NULL));
(( Type::dtypeinfo == ((TypeClass*)type)->sym)
|| Type::dtypeinfo->isBaseOf(((TypeClass*)type)->sym, NULL));
}

/************** Pointer operations ************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/declaration.c
Expand Up @@ -2345,7 +2345,7 @@ void ClassInfoDeclaration::semantic(Scope *sc)
/********************************* TypeInfoDeclaration ****************************/

TypeInfoDeclaration::TypeInfoDeclaration(Type *tinfo, int internal)
: VarDeclaration(Loc(), Type::typeinfo->type, tinfo->getTypeInfoIdent(internal), NULL)
: VarDeclaration(Loc(), Type::dtypeinfo->type, tinfo->getTypeInfoIdent(internal), NULL)
{
this->tinfo = tinfo;
storage_class = STCstatic | STCgshared;
Expand Down
2 changes: 1 addition & 1 deletion src/func.c
Expand Up @@ -1028,7 +1028,7 @@ void FuncDeclaration::semantic3(Scope *sc)
v_arguments->parent = this;

//t = Type::typeinfo->type->constOf()->arrayOf();
t = Type::typeinfo->type->arrayOf();
t = Type::dtypeinfo->type->arrayOf();
_arguments = new VarDeclaration(Loc(), t, Id::_arguments, NULL);
_arguments->semantic(sc2);
sc2->insert(_arguments);
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.c
Expand Up @@ -59,7 +59,7 @@ int Tptrdiff_t = Tint32;

/***************************** Type *****************************/

ClassDeclaration *Type::typeinfo;
ClassDeclaration *Type::dtypeinfo;
ClassDeclaration *Type::typeinfoclass;
ClassDeclaration *Type::typeinfointerface;
ClassDeclaration *Type::typeinfostruct;
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.h
Expand Up @@ -189,7 +189,7 @@ class Type : public RootObject
static Type *thash_t; // matches hash_t alias
static Type *tindex; // array/ptr index

static ClassDeclaration *typeinfo;
static ClassDeclaration *dtypeinfo;
static ClassDeclaration *typeinfoclass;
static ClassDeclaration *typeinfointerface;
static ClassDeclaration *typeinfostruct;
Expand Down
6 changes: 3 additions & 3 deletions src/typinf.c
Expand Up @@ -111,7 +111,7 @@ Expression *Type::getInternalTypeInfo(Scope *sc)
Expression *Type::getTypeInfo(Scope *sc)
{
//printf("Type::getTypeInfo() %p, %s\n", this, toChars());
if (!Type::typeinfo)
if (!Type::dtypeinfo)
{
error(Loc(), "TypeInfo not found. object.d may be incorrectly installed or corrupt, compile with -v switch");
fatal();
Expand Down Expand Up @@ -234,9 +234,9 @@ TypeInfoDeclaration *TypeTuple::getTypeInfoDeclaration()
void TypeInfoDeclaration::toDt(dt_t **pdt)
{
//printf("TypeInfoDeclaration::toDt() %s\n", toChars());
verifyStructSize(Type::typeinfo, 2 * Target::ptrsize);
verifyStructSize(Type::dtypeinfo, 2 * Target::ptrsize);

dtxoff(pdt, Type::typeinfo->toVtblSymbol(), 0); // vtbl for TypeInfo
dtxoff(pdt, Type::dtypeinfo->toVtblSymbol(), 0); // vtbl for TypeInfo
dtsize_t(pdt, 0); // monitor
}

Expand Down

0 comments on commit 9d9a70c

Please sign in to comment.