Skip to content

Commit

Permalink
catch up
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Bright committed Apr 24, 2010
1 parent e1bac62 commit 9464a60
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 73 deletions.
4 changes: 3 additions & 1 deletion src/backend/cdef.h
Expand Up @@ -137,7 +137,7 @@ One and only one of these macros must be set by the makefile:
#ifndef CDEF_H
#define CDEF_H 1

#define VERSION "8.52.1" // for banner and imbedding in .OBJ file
#define VERSION "8.52.2" // for banner and imbedding in .OBJ file
#define VERSIONHEX "0x852" // for __DMC__ macro
#define VERSIONINT 0x852 // for precompiled headers and DLL version

Expand Down Expand Up @@ -212,6 +212,7 @@ One and only one of these macros must be set by the makefile:
#define HEXFLOATS 1 // support hex floating point constants
#define OVERLOAD_CV_PARAM 1 // if int foo(int i) and int foo(const int i)
// are different
#define CPP0X 1 // support C++0x features

// Support generating code for 16 bit memory models
#define SIXTEENBIT (SCPP && TARGET_WINDOS)
Expand Down Expand Up @@ -999,6 +1000,7 @@ typedef unsigned long SYMFLGS;
X(unde, SCEXP|SCKEP|SCSCT) /* undefined */ \
X(auto, SCEXP|SCSS|SCRD ) /* automatic (stack) */ \
X(static, SCEXP|SCKEP|SCSCT) /* statically allocated */ \
X(thread, SCEXP|SCKEP ) /* thread local */ \
X(extern, SCEXP|SCKEP|SCSCT) /* external */ \
X(register, SCEXP|SCSS|SCRD ) /* registered variable */ \
X(pseudo, SCEXP ) /* pseudo register variable */ \
Expand Down
2 changes: 2 additions & 0 deletions src/backend/cgcod.c
Expand Up @@ -1493,6 +1493,7 @@ regm_t regmask(tym_t tym, tym_t tyf)
return 0;
case TYbool:
case TYwchar_t:
case TYchar16:
case TYchar:
case TYschar:
case TYuchar:
Expand All @@ -1503,6 +1504,7 @@ regm_t regmask(tym_t tym, tym_t tyf)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYsptr:
case TYcptr:
Expand Down
8 changes: 8 additions & 0 deletions src/backend/cgcv.c
Expand Up @@ -1694,6 +1694,7 @@ unsigned cv4_typidx(type *t)
case TYchar:
case TYschar:
case TYuchar:
case TYchar16:
case TYshort:
case TYushort:
case TYint:
Expand Down Expand Up @@ -1963,6 +1964,11 @@ unsigned cv4_typidx(type *t)
tym = TYnptr; // convert to C data type
goto L1; // and try again
#endif
case TYnullptr:
tym = TYnptr;
next = cv4_typidx(tsvoid); // rewrite as void*
goto L1;

default:
#ifdef DEBUG
WRTYxx(tym);
Expand Down Expand Up @@ -2380,6 +2386,7 @@ STATIC void cv4_func(Funcsym *s)
goto L1;

case TYwchar_t:
case TYchar16:
case TYshort:
case TYushort:
goto case_ax;
Expand All @@ -2389,6 +2396,7 @@ STATIC void cv4_func(Funcsym *s)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYsptr:
case TYcptr:
Expand Down
4 changes: 4 additions & 0 deletions src/backend/cgelem.c
Expand Up @@ -139,6 +139,7 @@ int elemisone(elem *e)
case TYchar:
case TYuchar:
case TYschar:
case TYchar16:
case TYshort:
case TYushort:
case TYint:
Expand All @@ -147,6 +148,7 @@ int elemisone(elem *e)
case TYulong:
case TYllong:
case TYullong:
case TYnullptr:
#if TX86
#if JHANDLE
case TYjhandle:
Expand Down Expand Up @@ -211,6 +213,7 @@ int elemisnegone(elem *e)
case TYchar:
case TYuchar:
case TYschar:
case TYchar16:
case TYshort:
case TYushort:
case TYint:
Expand All @@ -219,6 +222,7 @@ int elemisnegone(elem *e)
case TYulong:
case TYllong:
case TYullong:
case TYnullptr:
#if TX86
#if JHANDLE
case TYjhandle:
Expand Down
6 changes: 6 additions & 0 deletions src/backend/el.c
Expand Up @@ -2387,6 +2387,7 @@ int el_match(elem *n1,elem *n2)
case TYshort:
case TYwchar_t:
case TYushort:
case TYchar16:
case_short:
if (n1->EV.Vshort != n2->EV.Vshort)
goto nomatch;
Expand Down Expand Up @@ -2424,6 +2425,7 @@ int el_match(elem *n1,elem *n2)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYsptr:
case TYcptr:
Expand Down Expand Up @@ -2707,6 +2709,7 @@ targ_llong el_tolong(elem *e)
break;
case TYushort:
case TYwchar_t:
case TYchar16:
Ushort:
result = e->EV.Vushort;
break;
Expand All @@ -2721,6 +2724,7 @@ targ_llong el_tolong(elem *e)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYsptr:
case TYcptr:
Expand Down Expand Up @@ -3075,6 +3079,7 @@ void elem_print(elem *e)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYcptr:
#endif
Expand All @@ -3101,6 +3106,7 @@ void elem_print(elem *e)
case TYshort:
case TYwchar_t:
case TYushort:
case TYchar16:
L3:
#if TX86
dbg_printf("%hd ",e->EV.Vint);
Expand Down
2 changes: 2 additions & 0 deletions src/backend/evalu8.c
Expand Up @@ -120,6 +120,7 @@ HINT boolres(elem *e)
{ case TYchar:
case TYuchar:
case TYschar:
case TYchar16:
case TYshort:
case TYushort:
case TYint:
Expand All @@ -137,6 +138,7 @@ HINT boolres(elem *e)
#if JHANDLE
case TYjhandle:
#endif
case TYnullptr:
case TYnptr:
case TYsptr:
case TYcptr:
Expand Down
20 changes: 13 additions & 7 deletions src/backend/gloop.c
Expand Up @@ -2121,6 +2121,7 @@ STATIC famlist * newfamlist(tym_t ty)
break;
case TYshort:
case TYushort:
case TYchar16:
case TYwchar_t: // BUG: what about 4 byte wchar_t's?
c.Vshort = 1;
break;
Expand All @@ -2132,6 +2133,7 @@ STATIC famlist * newfamlist(tym_t ty)
#endif
case TYnptr:
#endif
case TYnullptr:
case TYfptr:
case TYvptr:
ty = TYint;
Expand All @@ -2146,6 +2148,7 @@ STATIC famlist * newfamlist(tym_t ty)
#endif
case TYlong:
case TYulong:
case TYdchar:
default:
c.Vlong = 1;
break;
Expand Down Expand Up @@ -3509,21 +3512,23 @@ STATIC famlist * flcmp(famlist *f1,famlist *f2)
break;
case TYshort:
case TYushort:
case TYchar16:
case TYwchar_t: // BUG: what about 4 byte wchar_t's?
case_short:
if (t2->Vshort == 1 ||
t1->Vshort != 1 && f2->c2->EV.Vshort == 0)
goto Lf2;
break;

#if TX86
#if JHANDLE
case TYjhandle:
#endif
case TYnptr:
case TYnullptr:
case TYnptr: // BUG: 64 bit pointers?
case TYsptr:
case TYcptr:
#endif
case_short:
if (t2->Vshort == 1 ||
t1->Vshort != 1 && f2->c2->EV.Vshort == 0)
goto Lf2;
break;

case TYint:
case TYuint:
if (intsize == SHORTSIZE)
Expand All @@ -3532,6 +3537,7 @@ STATIC famlist * flcmp(famlist *f1,famlist *f2)
goto case_long;
case TYlong:
case TYulong:
case TYdchar:
case TYfptr:
case TYvptr:
#if TX86
Expand Down
5 changes: 4 additions & 1 deletion src/backend/newman.c
Expand Up @@ -935,7 +935,6 @@ STATIC void cpp_basic_data_type(type *t)
case TYint: c = 'H'; goto dochar;
case TYuint: c = 'I'; goto dochar;
case TYlong: c = 'J'; goto dochar;
case TYdchar: assert(0);
case TYulong: c = 'K'; goto dochar;
case TYfloat: c = 'M'; goto dochar;
case TYdouble: c = 'N'; goto dochar;
Expand Down Expand Up @@ -983,6 +982,10 @@ STATIC void cpp_basic_data_type(type *t)
case TYcdouble: c = 'V'; goto dochar2;
case TYcldouble: c = 'W'; goto dochar2;

case TYchar16: c = 'X'; goto dochar2;
case TYdchar: c = 'Y'; goto dochar2;
case TYnullptr: c = 'Z'; goto dochar2;

dochar2:
CHAR('_');
goto dochar;
Expand Down
11 changes: 7 additions & 4 deletions src/backend/optabgen.c
Expand Up @@ -748,7 +748,7 @@ void fltables()
void dotytab()
{
static tym_t _ptr[] = { TYjhandle,TYnptr,TYsptr,TYcptr,TYf16ptr,TYfptr,TYhptr,
TYvptr };
TYvptr,TYnullptr };
static tym_t _real[] = { TYfloat,TYdouble,TYdouble_alias,TYldouble,
};
static tym_t _imaginary[] = {
Expand All @@ -759,7 +759,8 @@ void dotytab()
};
static tym_t _integral[] = { TYbool,TYchar,TYschar,TYuchar,TYshort,
TYwchar_t,TYushort,TYenum,TYint,TYuint,
TYlong,TYulong,TYllong,TYullong,TYdchar };
TYlong,TYulong,TYllong,TYullong,TYdchar,
TYchar16 };
static tym_t _ref[] = { TYnref,TYfref,TYref };
#if TARGET_MAC
static tym_t _func[] = { TYnfunc,TYffunc,TYnpfunc,TYfpfunc,TYpsfunc,
Expand All @@ -773,7 +774,7 @@ void dotytab()
#if MARS
TYwchar_t,
#endif
TYdchar,TYullong };
TYdchar,TYullong,TYchar16 };
static tym_t _mptr[] = { TYmemptr };
static tym_t _fv[] = { TYfptr, TYvptr };
#if TARGET_WINDOS
Expand All @@ -787,7 +788,7 @@ void dotytab()
static tym_t _revfunc[] = { TYnpfunc,TYfpfunc,TYf16func,TYjfunc };
#endif
static tym_t _short[] = { TYbool,TYchar,TYschar,TYuchar,TYshort,
TYwchar_t,TYushort };
TYwchar_t,TYushort,TYchar16 };
static tym_t _aggregate[] = { TYstruct,TYarray };

static struct
Expand All @@ -806,6 +807,7 @@ void dotytab()
"char", TYchar, TYuchar, TYchar, 1, 0x80, 0x70,
"signed char", TYschar, TYuchar, TYchar, 1, 0x80, 0x10,
"unsigned char",TYuchar, TYuchar, TYchar, 1, 0x84, 0x20,
"char16_t", TYchar16, TYchar16, TYint, 2, 0x85, 0x21,
"short", TYshort, TYushort, TYint, SHORTSIZE, 0x81,0x11,
"wchar_t", TYwchar_t, TYwchar_t, TYint, SHORTSIZE, 0x85,0x71,
"unsigned short",TYushort, TYushort, TYint, SHORTSIZE, 0x85,0x21,
Expand Down Expand Up @@ -835,6 +837,7 @@ void dotytab()

"*", TYptr, TYptr, TYptr, 2, 0x20, 0x100,
"__near *", TYjhandle, TYjhandle, TYjhandle, 2, 0x20, 0x100,
"nullptr_t", TYnullptr, TYnullptr, TYnptr, 2, 0x20, 0x100,
"*", TYnptr, TYnptr, TYnptr, 2, 0x20, 0x100,
"__ss *", TYsptr, TYsptr, TYsptr, 2, 0x20, 0x100,
"__cs *", TYcptr, TYcptr, TYcptr, 2, 0x20, 0x100,
Expand Down
1 change: 1 addition & 0 deletions src/backend/out.c
Expand Up @@ -582,6 +582,7 @@ STATIC void outelem(elem *e)

case TYbool:
case TYwchar_t:
case TYchar16:
case TYmemptr:
case TYvtshape:
tym = tym_conv(t);
Expand Down
14 changes: 13 additions & 1 deletion src/backend/token.h
Expand Up @@ -100,7 +100,6 @@ enum TK {
TKmutable,
TKnamespace,
TKnew,
TKnullptr,
TKoperator,
TKoverload,
TKprivate,
Expand All @@ -122,6 +121,18 @@ enum TK {
TK_typemask,
//#endif

#if CPP0X
TKalignof,
TKchar16_t,
TKchar32_t,
TKconstexpr,
TKdecltype,
TKnoexcept,
TKnullptr,
TKstatic_assert,
TKthread_local,
#endif

TKasm,
TK_inf,
TK_nan,
Expand Down Expand Up @@ -353,6 +364,7 @@ void removext(void);
void __near comment(void);
void __near cppcomment(void);
char *combinestrings(targ_size_t *plen);
char *combinestrings(targ_size_t *plen, tym_t *pty);
void __near inident(void);
void inidentX(char *p);
unsigned comphash(const char *p);
Expand Down

0 comments on commit 9464a60

Please sign in to comment.