Skip to content

Commit

Permalink
Merge pull request #2198 from yebblies/_object
Browse files Browse the repository at this point in the history
[DDMD] Rename Object to _Object
  • Loading branch information
AndrejMitrovic committed Jun 18, 2013
2 parents ff682c6 + bbebd89 commit b5aa808
Show file tree
Hide file tree
Showing 28 changed files with 228 additions and 228 deletions.
2 changes: 1 addition & 1 deletion src/arraytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef Array<class ClassDeclaration> ClassDeclarations;

typedef Array<class Dsymbol> Dsymbols;

typedef Array<class Object> Objects;
typedef Array<class RootObject> Objects;

typedef Array<class FuncDeclaration> FuncDeclarations;

Expand Down
2 changes: 1 addition & 1 deletion src/canthrow.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int Dsymbol_canThrow(Dsymbol *s, bool mustNotThrow)
else if ((td = s->isTupleDeclaration()) != NULL)
{
for (size_t i = 0; i < td->objects->dim; i++)
{ Object *o = (*td->objects)[i];
{ RootObject *o = (*td->objects)[i];
if (o->dyncast() == DYNCAST_EXPRESSION)
{ Expression *eo = (Expression *)o;
if (eo->op == TOKdsymbol)
Expand Down
6 changes: 3 additions & 3 deletions src/declaration.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Type *TupleDeclaration::getType()
/* It's only a type tuple if all the Object's are types
*/
for (size_t i = 0; i < objects->dim; i++)
{ Object *o = (*objects)[i];
{ RootObject *o = (*objects)[i];

if (o->dyncast() != DYNCAST_TYPE)
{
Expand Down Expand Up @@ -257,7 +257,7 @@ bool TupleDeclaration::needThis()
{
//printf("TupleDeclaration::needThis(%s)\n", toChars());
for (size_t i = 0; i < objects->dim; i++)
{ Object *o = (*objects)[i];
{ RootObject *o = (*objects)[i];
if (o->dyncast() == DYNCAST_EXPRESSION)
{ Expression *e = (Expression *)o;
if (e->op == TOKdsymbol)
Expand Down Expand Up @@ -1803,7 +1803,7 @@ void VarDeclaration::setFieldOffset(AggregateDeclaration *ad, unsigned *poffset,
TupleDeclaration *v2 = aliassym->isTupleDeclaration();
assert(v2);
for (size_t i = 0; i < v2->objects->dim; i++)
{ Object *o = (*v2->objects)[i];
{ RootObject *o = (*v2->objects)[i];
assert(o->dyncast() == DYNCAST_EXPRESSION);
Expression *e = (Expression *)o;
assert(e->op == TOKdsymbol);
Expand Down
2 changes: 1 addition & 1 deletion src/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ class FuncDeclaration : public Declaration
bool functionSemantic3();
// called from semantic3
VarDeclaration *declareThis(Scope *sc, AggregateDeclaration *ad);
bool equals(Object *o);
bool equals(RootObject *o);

void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
void bodyToCBuffer(OutBuffer *buf, HdrGenState *hgs);
Expand Down
4 changes: 2 additions & 2 deletions src/dsymbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Dsymbol::Dsymbol(Identifier *ident)
this->unittest = NULL;
}

bool Dsymbol::equals(Object *o)
bool Dsymbol::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -424,7 +424,7 @@ Dsymbol *Dsymbol::search_correct(Identifier *ident)
* symbol found, NULL if not
*/

Dsymbol *Dsymbol::searchX(Loc loc, Scope *sc, Object *id)
Dsymbol *Dsymbol::searchX(Loc loc, Scope *sc, RootObject *id)
{
//printf("Dsymbol::searchX(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars());
Dsymbol *s = toAlias();
Expand Down
8 changes: 4 additions & 4 deletions src/dsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ enum PASS

typedef int (*Dsymbol_apply_ft_t)(Dsymbol *, void *);

class Dsymbol : public Object
class Dsymbol : public RootObject
{
public:
Identifier *ident;
Expand All @@ -130,7 +130,7 @@ class Dsymbol : public Object
char *toChars();
Loc& getLoc();
char *locToChars();
bool equals(Object *o);
bool equals(RootObject *o);
bool isAnonymous();
void error(Loc loc, const char *format, ...);
void error(const char *format, ...);
Expand Down Expand Up @@ -164,7 +164,7 @@ class Dsymbol : public Object
virtual void inlineScan();
virtual Dsymbol *search(Loc loc, Identifier *ident, int flags);
Dsymbol *search_correct(Identifier *id);
Dsymbol *searchX(Loc loc, Scope *sc, Object *id);
Dsymbol *searchX(Loc loc, Scope *sc, RootObject *id);
virtual bool overloadInsert(Dsymbol *s);
virtual void toHBuffer(OutBuffer *buf, HdrGenState *hgs);
virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
Expand Down Expand Up @@ -341,7 +341,7 @@ class OverloadSet : public Dsymbol

// Table of Dsymbol's

class DsymbolTable : public Object
class DsymbolTable : public RootObject
{
public:
AA *tab;
Expand Down
2 changes: 1 addition & 1 deletion src/e2ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ elem *Dsymbol_toElem(Dsymbol *s, IRState *irs)
else if ((td = s->isTupleDeclaration()) != NULL)
{
for (size_t i = 0; i < td->objects->dim; i++)
{ Object *o = (*td->objects)[i];
{ RootObject *o = (*td->objects)[i];
if (o->dyncast() == DYNCAST_EXPRESSION)
{ Expression *eo = (Expression *)o;
if (eo->op == TOKdsymbol)
Expand Down
28 changes: 14 additions & 14 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ IntegerExp::IntegerExp(dinteger_t value)
this->value = value;
}

bool IntegerExp::equals(Object *o)
bool IntegerExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -2921,7 +2921,7 @@ int RealEquals(real_t x1, real_t x2)
memcmp(&x1, &x2, Target::realsize - Target::realpad) == 0;
}

bool RealExp::equals(Object *o)
bool RealExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -3114,7 +3114,7 @@ complex_t ComplexExp::toComplex()
return value;
}

bool ComplexExp::equals(Object *o)
bool ComplexExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -3770,7 +3770,7 @@ NullExp::NullExp(Loc loc, Type *type)
this->type = type;
}

bool NullExp::equals(Object *o)
bool NullExp::equals(RootObject *o)
{
if (o && o->dyncast() == DYNCAST_EXPRESSION)
{
Expand Down Expand Up @@ -3861,7 +3861,7 @@ Expression *StringExp::syntaxCopy()
}
#endif

bool StringExp::equals(Object *o)
bool StringExp::equals(RootObject *o)
{
//printf("StringExp::equals('%s') %s\n", o->toChars(), toChars());
if (o && o->dyncast() == DYNCAST_EXPRESSION)
Expand Down Expand Up @@ -4021,7 +4021,7 @@ StringExp *StringExp::toUTF8(Scope *sc)
return this;
}

int StringExp::compare(Object *obj)
int StringExp::compare(RootObject *obj)
{
//printf("StringExp::compare()\n");
// Used to sort case statement expressions so we can do an efficient lookup
Expand Down Expand Up @@ -4445,7 +4445,7 @@ StructLiteralExp::StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *
//printf("StructLiteralExp::StructLiteralExp(%s)\n", toChars());
}

bool StructLiteralExp::equals(Object *o)
bool StructLiteralExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -5495,7 +5495,7 @@ VarExp::VarExp(Loc loc, Declaration *var, bool hasOverloads)
this->type = var->type;
}

bool VarExp::equals(Object *o)
bool VarExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -5681,7 +5681,7 @@ TupleExp::TupleExp(Loc loc, TupleDeclaration *tup)

this->exps->reserve(tup->objects->dim);
for (size_t i = 0; i < tup->objects->dim; i++)
{ Object *o = (*tup->objects)[i];
{ RootObject *o = (*tup->objects)[i];
if (Dsymbol *s = getDsymbol(o))
{
/* If tuple element represents a symbol, translate to DsymbolExp
Expand All @@ -5708,7 +5708,7 @@ TupleExp::TupleExp(Loc loc, TupleDeclaration *tup)
}
}

bool TupleExp::equals(Object *o)
bool TupleExp::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down Expand Up @@ -6114,7 +6114,7 @@ void DeclarationExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
* typeid(int)
*/

TypeidExp::TypeidExp(Loc loc, Object *o)
TypeidExp::TypeidExp(Loc loc, RootObject *o)
: Expression(loc, TOKtypeid, sizeof(TypeidExp))
{
this->obj = o;
Expand Down Expand Up @@ -6220,7 +6220,7 @@ void TraitsExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
for (size_t i = 0; i < args->dim; i++)
{
buf->writestring(", ");;
Object *oarg = (*args)[i];
RootObject *oarg = (*args)[i];
ObjectToCBuffer(buf, hgs, oarg);
}
}
Expand Down Expand Up @@ -7600,7 +7600,7 @@ Expression *DotVarExp::semantic(Scope *sc)

exps->reserve(tup->objects->dim);
for (size_t i = 0; i < tup->objects->dim; i++)
{ Object *o = (*tup->objects)[i];
{ RootObject *o = (*tup->objects)[i];
Expression *e;
if (o->dyncast() == DYNCAST_EXPRESSION)
{
Expand Down Expand Up @@ -8415,7 +8415,7 @@ Expression *CallExp::semantic(Scope *sc)
if (tiargs && tiargs->dim)
{
for (size_t k = 0; k < tiargs->dim; k++)
{ Object *o = (*tiargs)[k];
{ RootObject *o = (*tiargs)[k];
if (isError(o))
return new ErrorExp();
}
Expand Down
24 changes: 12 additions & 12 deletions src/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ enum CtfeGoal
// Same as WANTvalue, but also expand variables as far as possible
#define WANTexpand 8

class Expression : public Object
class Expression : public RootObject
{
public:
Loc loc; // file location
Expand Down Expand Up @@ -227,7 +227,7 @@ class IntegerExp : public Expression

IntegerExp(Loc loc, dinteger_t value, Type *type);
IntegerExp(dinteger_t value);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
char *toChars();
Expand Down Expand Up @@ -264,7 +264,7 @@ class RealExp : public Expression
real_t value;

RealExp(Loc loc, real_t value, Type *type);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
char *toChars();
Expand All @@ -288,7 +288,7 @@ class ComplexExp : public Expression
complex_t value;

ComplexExp(Loc loc, complex_t value, Type *type);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
char *toChars();
Expand Down Expand Up @@ -380,7 +380,7 @@ class NullExp : public Expression
unsigned char committed; // !=0 if type is committed

NullExp(Loc loc, Type *t = NULL);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
int isBool(int result);
int isConst();
Expand Down Expand Up @@ -408,7 +408,7 @@ class StringExp : public Expression
StringExp(Loc loc, void *s, size_t len);
StringExp(Loc loc, void *s, size_t len, unsigned char postfix);
//Expression *syntaxCopy();
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
size_t length();
Expand All @@ -417,7 +417,7 @@ class StringExp : public Expression
Expression *implicitCastTo(Scope *sc, Type *t);
MATCH implicitConvTo(Type *t);
Expression *castTo(Scope *sc, Type *t);
int compare(Object *obj);
int compare(RootObject *obj);
int isBool(int result);
int isLvalue();
Expression *toLvalue(Scope *sc, Expression *e);
Expand Down Expand Up @@ -449,7 +449,7 @@ class TupleExp : public Expression
TupleExp(Loc loc, TupleDeclaration *tup);
Expression *syntaxCopy();
int apply(apply_fp_t fp, void *param);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
void checkEscape();
Expand Down Expand Up @@ -556,7 +556,7 @@ class StructLiteralExp : public Expression
// (with infinite recursion) of this expression.

StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *elements, Type *stype = NULL);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *syntaxCopy();
int apply(apply_fp_t fp, void *param);
Expression *semantic(Scope *sc);
Expand Down Expand Up @@ -706,7 +706,7 @@ class VarExp : public SymbolExp
{
public:
VarExp(Loc loc, Declaration *var, bool hasOverloads = false);
bool equals(Object *o);
bool equals(RootObject *o);
Expression *semantic(Scope *sc);
Expression *optimize(int result, bool keepLvalue = false);
Expression *interpret(InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
Expand Down Expand Up @@ -790,9 +790,9 @@ class DeclarationExp : public Expression
class TypeidExp : public Expression
{
public:
Object *obj;
RootObject *obj;

TypeidExp(Loc loc, Object *obj);
TypeidExp(Loc loc, RootObject *obj);
Expression *syntaxCopy();
Expression *semantic(Scope *sc);
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
Expand Down
2 changes: 1 addition & 1 deletion src/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ VarDeclaration *FuncDeclaration::declareThis(Scope *sc, AggregateDeclaration *ad
return NULL;
}

bool FuncDeclaration::equals(Object *o)
bool FuncDeclaration::equals(RootObject *o)
{
if (this == o)
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/iasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ STATIC OPND *asm_merge_opnds(OPND *o1, OPND *o2)
error(asmstate.loc, "tuple index %u exceeds length %u", index, tup->objects->dim);
else
{
Object *o = (*tup->objects)[index];
RootObject *o = (*tup->objects)[index];
if (o->dyncast() == DYNCAST_DSYMBOL)
{ o1->s = (Dsymbol *)o;
return o1;
Expand Down
4 changes: 2 additions & 2 deletions src/identifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ hash_t Identifier::hashCode()
return String::calcHash(string);
}

bool Identifier::equals(Object *o)
bool Identifier::equals(RootObject *o)
{
return this == o || memcmp(string,o->toChars(),len+1) == 0;
}

int Identifier::compare(Object *o)
int Identifier::compare(RootObject *o)
{
return memcmp(string, o->toChars(), len + 1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/identifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

#include "root.h"

class Identifier : public Object
class Identifier : public RootObject
{
public:
int value;
const char *string;
size_t len;

Identifier(const char *string, int value);
bool equals(Object *o);
bool equals(RootObject *o);
hash_t hashCode();
int compare(Object *o);
int compare(RootObject *o);
void print();
char *toChars();
const char *toHChars2();
Expand Down

0 comments on commit b5aa808

Please sign in to comment.