Skip to content

Commit

Permalink
Remove remnants of bit from the compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Jun 9, 2011
1 parent cacbd0a commit 4fb6987
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 48 deletions.
3 changes: 0 additions & 3 deletions src/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ MATCH IntegerExp::implicitConvTo(Type *t)

switch (ty)
{
case Tbit:
case Tbool:
value &= 1;
ty = Tint32;
Expand Down Expand Up @@ -248,7 +247,6 @@ MATCH IntegerExp::implicitConvTo(Type *t)
// Only allow conversion if no change in value
switch (toty)
{
case Tbit:
case Tbool:
if ((value & 1) != value)
goto Lno;
Expand Down Expand Up @@ -1911,7 +1909,6 @@ Expression *Expression::integralPromotions(Scope *sc)
case Tuns8:
case Tint16:
case Tuns16:
case Tbit:
case Tbool:
case Tchar:
case Twchar:
Expand Down
5 changes: 2 additions & 3 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,6 @@ dinteger_t IntegerExp::toInteger()
{
switch (t->ty)
{
case Tbit:
case Tbool: value = (value != 0); break;
case Tint8: value = (d_int8) value; break;
case Tchar:
Expand Down Expand Up @@ -1766,7 +1765,6 @@ void IntegerExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
buf->printf("%juLU", v);
break;

case Tbit:
case Tbool:
buf->writestring((char *)(v ? "true" : "false"));
break;
Expand Down Expand Up @@ -8191,6 +8189,7 @@ Expression *CastExp::semantic(Scope *sc)
{ // Disallow unsafe casts
Type *tob = to->toBasetype();
Type *t1b = e1->type->toBasetype();

if (!t1b->isMutable() && tob->isMutable())
{ // Cast not mutable to mutable
Lunsafe:
Expand Down Expand Up @@ -9578,7 +9577,7 @@ Expression *AddAssignExp::semantic(Scope *sc)
e1->checkNoBool();
if (tb1->ty == Tpointer && tb2->isintegral())
e = scaleFactor(sc);
else if (tb1->ty == Tbit || tb1->ty == Tbool)
else if (tb1->ty == Tbool)
{
#if 0
// Need to rethink this
Expand Down
1 change: 0 additions & 1 deletion src/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ unsigned Type::totym()
case Tcomplex32: t = TYcfloat; break;
case Tcomplex64: t = TYcdouble; break;
case Tcomplex80: t = TYcldouble; break;
//case Tbit: t = TYuchar; break;
case Tbool: t = TYbool; break;
case Tchar: t = TYchar; break;
#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
Expand Down
35 changes: 0 additions & 35 deletions src/impcnvgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ int integral_promotion(int t)
{
case Tchar:
case Twchar:
//case Tbit:
case Tbool:
case Tint8:
case Tuns8:
Expand Down Expand Up @@ -51,29 +50,6 @@ void init()
impcnvType1[t1][t2] = nt1; \
impcnvType2[t1][t2] = nt2;

/* ======================= */

#if 0
X(Tbit,Tbit, Tint32,Tint32, Tint32)
X(Tbit,Tint8, Tint32,Tint32, Tint32)
X(Tbit,Tuns8, Tint32,Tint32, Tint32)
X(Tbit,Tint16, Tint32,Tint32, Tint32)
X(Tbit,Tuns16, Tint32,Tint32, Tint32)
X(Tbit,Tint32, Tint32,Tint32, Tint32)
X(Tbit,Tuns32, Tuns32,Tuns32, Tuns32)
X(Tbit,Tint64, Tint64,Tint64, Tint64)
X(Tbit,Tuns64, Tuns64,Tuns64, Tuns64)

X(Tbit,Tfloat32, Tfloat32,Tfloat32, Tfloat32)
X(Tbit,Tfloat64, Tfloat64,Tfloat64, Tfloat64)
X(Tbit,Tfloat80, Tfloat80,Tfloat80, Tfloat80)
X(Tbit,Timaginary32, Tfloat32,Timaginary32, Tfloat32)
X(Tbit,Timaginary64, Tfloat64,Timaginary64, Tfloat64)
X(Tbit,Timaginary80, Tfloat80,Timaginary80, Tfloat80)
X(Tbit,Tcomplex32, Tfloat32,Tcomplex32, Tcomplex32)
X(Tbit,Tcomplex64, Tfloat64,Tcomplex64, Tcomplex64)
X(Tbit,Tcomplex80, Tfloat80,Tcomplex80, Tcomplex80)
#endif

/* ======================= */

Expand Down Expand Up @@ -322,17 +298,6 @@ void init()

#define Y(t1,t2) impcnvWarn[t1][t2] = 1;

#if 0
Y(Tint8, Tbit)
Y(Tuns8, Tbit)
Y(Tint16, Tbit)
Y(Tuns16, Tbit)
Y(Tint32, Tbit)
Y(Tuns32, Tbit)
Y(Tint64, Tbit)
Y(Tuns64, Tbit)
#endif

Y(Tuns8, Tint8)
Y(Tint16, Tint8)
Y(Tuns16, Tint8)
Expand Down
1 change: 0 additions & 1 deletion src/lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ enum TOK
case TOKcomplex32: t = Type::tcomplex32; goto LabelX; \
case TOKcomplex64: t = Type::tcomplex64; goto LabelX; \
case TOKcomplex80: t = Type::tcomplex80; goto LabelX; \
case TOKbit: t = Type::tbit; goto LabelX; \
case TOKbool: t = Type::tbool; goto LabelX; \
case TOKchar: t = Type::tchar; goto LabelX; \
case TOKwchar: t = Type::twchar; goto LabelX; \
Expand Down
1 change: 0 additions & 1 deletion src/mtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ void Type::init()
mangleChar[Tdchar] = 'w';

// '@' shouldn't appear anywhere in the deco'd names
mangleChar[Tbit] = '@';
mangleChar[Tinstance] = '@';
mangleChar[Terror] = '@';
mangleChar[Ttypeof] = '@';
Expand Down
4 changes: 0 additions & 4 deletions src/mtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ enum ENUMTY

Tcomplex64,
Tcomplex80,
Tbit,
Tbool,
Tchar,
Twchar,
Expand Down Expand Up @@ -164,7 +163,6 @@ struct Type : Object
#define tcomplex64 basic[Tcomplex64]
#define tcomplex80 basic[Tcomplex80]

#define tbit basic[Tbit]
#define tbool basic[Tbool]
#define tchar basic[Tchar]
#define twchar basic[Twchar]
Expand Down Expand Up @@ -380,7 +378,6 @@ struct TypeBasic : Type
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
#endif
int isintegral();
int isbit();
int isfloating();
int isreal();
int isimaginary();
Expand Down Expand Up @@ -791,7 +788,6 @@ struct TypeTypedef : Type
void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
Expression *getProperty(Loc loc, Identifier *ident);
int isbit();
int isintegral();
int isfloating();
int isreal();
Expand Down

0 comments on commit 4fb6987

Please sign in to comment.