Skip to content

Commit

Permalink
[Refactoring] Remove unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Aug 6, 2014
1 parent e2b0e6b commit db1969f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
64 changes: 0 additions & 64 deletions src/declaration.c
Expand Up @@ -285,8 +285,6 @@ TypedefDeclaration::TypedefDeclaration(Loc loc, Identifier *id, Type *basetype,
this->type = new TypeTypedef(this);
this->basetype = basetype->toBasetype();
this->init = init;
this->htype = NULL;
this->hbasetype = NULL;
this->loc = loc;
this->sinit = NULL;
}
Expand All @@ -302,25 +300,6 @@ Dsymbol *TypedefDeclaration::syntaxCopy(Dsymbol *s)
assert(!s);
TypedefDeclaration *st;
st = new TypedefDeclaration(loc, ident, basetype, init);

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
{ htype = type->syntaxCopy();
st->htype = type->syntaxCopy();
}
}
else // Make copy of original for new instance
st->htype = htype->syntaxCopy();
if (!hbasetype)
{ if (basetype)
{ hbasetype = basetype->syntaxCopy();
st->hbasetype = basetype->syntaxCopy();
}
}
else
st->hbasetype = hbasetype->syntaxCopy();

return st;
}

Expand Down Expand Up @@ -426,8 +405,6 @@ AliasDeclaration::AliasDeclaration(Loc loc, Identifier *id, Type *type)
this->type = type;
this->aliassym = NULL;
this->import = NULL;
this->htype = NULL;
this->haliassym = NULL;
this->overnext = NULL;
this->inSemantic = false;
assert(type);
Expand All @@ -442,8 +419,6 @@ AliasDeclaration::AliasDeclaration(Loc loc, Identifier *id, Dsymbol *s)
this->type = NULL;
this->aliassym = s;
this->import = NULL;
this->htype = NULL;
this->haliassym = NULL;
this->overnext = NULL;
this->inSemantic = false;
assert(s);
Expand All @@ -459,25 +434,6 @@ Dsymbol *AliasDeclaration::syntaxCopy(Dsymbol *s)
else
sa = new AliasDeclaration(loc, ident, aliassym->syntaxCopy(NULL));
sa->storage_class = storage_class;

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
{ htype = type->syntaxCopy();
sa->htype = type->syntaxCopy();
}
}
else // Make copy of original for new instance
sa->htype = htype->syntaxCopy();
if (!haliassym)
{ if (aliassym)
{ haliassym = aliassym->syntaxCopy(s);
sa->haliassym = aliassym->syntaxCopy(s);
}
}
else
sa->haliassym = haliassym->syntaxCopy(s);

return sa;
}

Expand Down Expand Up @@ -889,8 +845,6 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
assert(type || init);
this->type = type;
this->init = init;
this->htype = NULL;
this->hinit = NULL;
this->loc = loc;
offset = 0;
noscope = 0;
Expand Down Expand Up @@ -928,24 +882,6 @@ Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
sv->storage_class = storage_class;
}

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
{ htype = type->syntaxCopy();
sv->htype = type->syntaxCopy();
}
}
else // Make copy of original for new instance
sv->htype = htype->syntaxCopy();
if (!hinit)
{ if (init)
{ hinit = init->syntaxCopy();
sv->hinit = init->syntaxCopy();
}
}
else
sv->hinit = hinit->syntaxCopy();

return sv;
}

Expand Down
6 changes: 0 additions & 6 deletions src/declaration.h
Expand Up @@ -203,8 +203,6 @@ class TypedefDeclaration : public Declaration
const char *kind();
Type *getType();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
Type *htype;
Type *hbasetype;

void toObjFile(bool multiobj); // compile to .obj file

Expand Down Expand Up @@ -234,8 +232,6 @@ class AliasDeclaration : public Declaration
Type *getType();
Dsymbol *toAlias();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
Type *htype;
Dsymbol *haliassym;

AliasDeclaration *isAliasDeclaration() { return this; }
void accept(Visitor *v) { v->visit(this); }
Expand Down Expand Up @@ -299,8 +295,6 @@ class VarDeclaration : public Declaration
void semantic2(Scope *sc);
const char *kind();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
Type *htype;
Initializer *hinit;
AggregateDeclaration *isThis();
bool needThis();
bool isExport();
Expand Down

0 comments on commit db1969f

Please sign in to comment.