Skip to content

Commit

Permalink
Remove Type::tboolean
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jan 18, 2015
1 parent 57c127a commit a041582
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
25 changes: 12 additions & 13 deletions src/expression.c
Expand Up @@ -9327,7 +9327,7 @@ Expression *NotExp::semantic(Scope *sc)
if (checkNonAssignmentArrayOp(e1))
return new ErrorExp();

type = Type::tboolean;
type = Type::tbool;
return this;
}

Expand All @@ -9352,7 +9352,7 @@ Expression *BoolExp::semantic(Scope *sc)
if (e1->type == Type::terror)
return e1;

type = Type::tboolean;
type = Type::tbool;
return this;
}

Expand Down Expand Up @@ -12991,7 +12991,7 @@ Expression *OrOrExp::semantic(Scope *sc)
e1 = e1->optimize(WANTvalue);
if (e1->isBool(true))
{
return new IntegerExp(loc, 1, Type::tboolean);
return new IntegerExp(loc, 1, Type::tbool);
}
}

Expand All @@ -13005,7 +13005,7 @@ Expression *OrOrExp::semantic(Scope *sc)
else
{
e2 = e2->checkToBoolean(sc);
type = Type::tboolean;
type = Type::tbool;
}
if (e2->op == TOKtype || e2->op == TOKimport)
{
Expand Down Expand Up @@ -13049,7 +13049,7 @@ Expression *AndAndExp::semantic(Scope *sc)
e1 = e1->optimize(WANTvalue);
if (e1->isBool(false))
{
return new IntegerExp(loc, 0, Type::tboolean);
return new IntegerExp(loc, 0, Type::tbool);
}
}

Expand All @@ -13063,7 +13063,7 @@ Expression *AndAndExp::semantic(Scope *sc)
else
{
e2 = e2->checkToBoolean(sc);
type = Type::tboolean;
type = Type::tbool;
}
if (e2->op == TOKtype || e2->op == TOKimport)
{
Expand Down Expand Up @@ -13102,7 +13102,6 @@ Expression *InExp::semantic(Scope *sc)
if (e)
return e;

//type = Type::tboolean;
Type *t2b = e2->type->toBasetype();
switch (t2b->ty)
{
Expand Down Expand Up @@ -13138,7 +13137,7 @@ Expression *InExp::semantic(Scope *sc)
RemoveExp::RemoveExp(Loc loc, Expression *e1, Expression *e2)
: BinExp(loc, TOKremove, sizeof(RemoveExp), e1, e2)
{
type = Type::tboolean;
type = Type::tbool;
}

Expression *RemoveExp::semantic(Scope *sc)
Expand Down Expand Up @@ -13193,7 +13192,7 @@ Expression *CmpExp::semantic(Scope *sc)
if (Expression *ex = typeCombine(this, sc))
return ex;

type = Type::tboolean;
type = Type::tbool;

// Special handling for array comparisons
t1 = e1->type->toBasetype();
Expand Down Expand Up @@ -13351,7 +13350,7 @@ Expression *EqualExp::semantic(Scope *sc)
if (ve1->var == ve2->var)
{
// They are the same, result is 'true' for ==, 'false' for !=
return new IntegerExp(loc, (op == TOKequal), Type::tboolean);
return new IntegerExp(loc, (op == TOKequal), Type::tbool);
}
}
}
Expand Down Expand Up @@ -13435,7 +13434,7 @@ Expression *EqualExp::semantic(Scope *sc)
if (dim == 0)
{
// zero-length tuple comparison should always return true or false.
e = new IntegerExp(loc, (op == TOKequal), Type::tboolean);
e = new IntegerExp(loc, (op == TOKequal), Type::tbool);
}
else
{
Expand All @@ -13460,7 +13459,7 @@ Expression *EqualExp::semantic(Scope *sc)
if (Expression *ex = typeCombine(this, sc))
return ex;

type = Type::tboolean;
type = Type::tbool;

// Special handling for array comparisons
if (!arrayTypeCompatible(loc, e1->type, e2->type))
Expand Down Expand Up @@ -13495,7 +13494,7 @@ Expression *IdentityExp::semantic(Scope *sc)

if (Expression *ex = binSemanticProp(sc))
return ex;
type = Type::tboolean;
type = Type::tbool;

if (Expression *ex = typeCombine(this, sc))
return ex;
Expand Down
2 changes: 0 additions & 2 deletions src/mtype.c
Expand Up @@ -109,7 +109,6 @@ Type *Type::twchar;
Type *Type::tdchar;

Type *Type::tshiftcnt;
Type *Type::tboolean;
Type *Type::terror;
Type *Type::tnull;

Expand Down Expand Up @@ -271,7 +270,6 @@ void Type::init()
tdchar = basic[Tdchar];

tshiftcnt = tint32;
tboolean = tbool;
terror = basic[Terror];
tnull = basic[Tnull];
tnull = new TypeNull();
Expand Down
1 change: 0 additions & 1 deletion src/mtype.h
Expand Up @@ -184,7 +184,6 @@ class Type : public RootObject

// Some special types
static Type *tshiftcnt;
static Type *tboolean;
static Type *tvoidptr; // void*
static Type *tstring; // immutable(char)[]
static Type *twstring; // immutable(wchar)[]
Expand Down

0 comments on commit a041582

Please sign in to comment.