Skip to content

Commit

Permalink
Remove redundant FormalArg.asArg field
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed May 4, 2013
1 parent ac7777d commit f177c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions compiler/clay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,19 +1617,18 @@ struct FormalArg : public ANode {
ValueTempness tempness;
ExprPtr asType;
bool varArg:1;
const bool asArg:1;
FormalArg(IdentifierPtr name, ExprPtr type)
: ANode(FORMAL_ARG), name(name), type(type),
tempness(TEMPNESS_DONTCARE), varArg(false), asArg(false) {}
tempness(TEMPNESS_DONTCARE), varArg(false) {}
FormalArg(IdentifierPtr name, ExprPtr type, ValueTempness tempness)
: ANode(FORMAL_ARG), name(name), type(type),
tempness(tempness), varArg(false), asArg(false) {}
tempness(tempness), varArg(false) {}
FormalArg(IdentifierPtr name, ExprPtr type, ValueTempness tempness, bool varArg)
: ANode(FORMAL_ARG), name(name), type(type),
tempness(tempness), varArg(varArg), asArg(false) {}
tempness(tempness), varArg(varArg) {}
FormalArg(IdentifierPtr name, ExprPtr type, ValueTempness tempness, ExprPtr asType)
: ANode(FORMAL_ARG), name(name), type(type),
tempness(tempness), asType(asType), varArg(false), asArg(true) {}
tempness(tempness), asType(asType), varArg(false) {}
};

struct ReturnSpec : public ANode {
Expand Down
2 changes: 1 addition & 1 deletion compiler/desugar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ OverloadPtr desugarAsOverload(OverloadPtr &x) {
for (unsigned i = 0; i < x->code->formalArgs.size(); ++i) {
FormalArgPtr arg = clone(x->code->formalArgs[i]);
arg->tempness = TEMPNESS_FORWARD;
if (x->code->formalArgs[i]->asArg) {
if (x->code->formalArgs[i]->asType != NULL) {
arg->type = x->code->formalArgs[i]->asType;
ExprPtr typeArg = x->code->formalArgs[i]->asType;
CallPtr callArg = new Call(operator_expr_asExpression(), new ExprList());
Expand Down

0 comments on commit f177c60

Please sign in to comment.