Skip to content

Commit

Permalink
make room for more types
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jan 7, 2012
1 parent 58c7689 commit 69d545f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 55 deletions.
16 changes: 0 additions & 16 deletions src/backend/optabgen.c
Expand Up @@ -929,15 +929,9 @@ void dotytab()
/* Repeat everything 4 times to account for the mTYconst and mTYvolatile bits */
#define T1(arr,mask) for (i=0; i<arraysize(arr); i++) \
{ tytab[arr[i]] |= mask; \
tytab[arr[i] + 64] |= mask; \
tytab[arr[i] + 128] |= mask; \
tytab[arr[i] + 192] |= mask; \
};
#define T2(arr,mask) for (i=0; i<arraysize(arr); i++) \
{ tytab[arr[i]] |= mask; \
tytab[arr[i] + 64] |= mask; \
tytab[arr[i] + 128] |= mask; \
tytab[arr[i] + 192] |= mask; \
};

T1(_ptr, TYFLptr);
Expand Down Expand Up @@ -995,10 +989,6 @@ void dotytab()

for (i = 0; i < arraysize(typetab); i++)
{ tytouns[typetab[i].ty] = typetab[i].unsty;
tytouns[typetab[i].ty | mTYconst] = typetab[i].unsty | mTYconst;
tytouns[typetab[i].ty | mTYvolatile] = typetab[i].unsty | mTYvolatile;
tytouns[typetab[i].ty | mTYconst | mTYvolatile] =
typetab[i].unsty | mTYconst | mTYvolatile;
}
fprintf(f,"const tym_t tytouns[] =\n{ ");
for (i = 0; i < arraysize(tytouns); i++)
Expand All @@ -1010,9 +1000,6 @@ void dotytab()

for (i = 0; i < arraysize(typetab); i++)
{ tysize[typetab[i].ty | 0x00] = typetab[i].size;
tysize[typetab[i].ty | 0x40] = typetab[i].size;
tysize[typetab[i].ty | 0x80] = typetab[i].size;
tysize[typetab[i].ty | 0xC0] = typetab[i].size;
/*printf("tysize[%d] = %d\n",typetab[i].ty,typetab[i].size);*/
}
fprintf(f,"signed char tysize[] =\n{ ");
Expand Down Expand Up @@ -1044,9 +1031,6 @@ void dotytab()
break;
}
tysize[typetab[i].ty | 0x00] = sz;
tysize[typetab[i].ty | 0x40] = sz;
tysize[typetab[i].ty | 0x80] = sz;
tysize[typetab[i].ty | 0xC0] = sz;
/*printf("tyalignsize[%d] = %d\n",typetab[i].ty,typetab[i].size);*/
}
fprintf(f,"signed char tyalignsize[] =\n{ ");
Expand Down
56 changes: 39 additions & 17 deletions src/backend/ty.h
Expand Up @@ -122,20 +122,20 @@ enum TYM
extern int TYptrdiff, TYsize, TYsize_t;

/* Linkage type */
#define mTYnear 0x100
#define mTYnear 0x0800
#if TARGET_SEGMENTED
#define mTYfar 0x200
#define mTYcs 0x400 // in code segment
#define mTYfar 0x1000
#define mTYcs 0x2000 // in code segment
#endif
#define mTYthread 0x800
#define mTYLINK 0xF00 // all linkage bits
#define mTYthread 0x4000
#define mTYLINK 0x7800 // all linkage bits

#define mTYloadds 0x1000
#define mTYexport 0x2000
#define mTYweak 0x0000
#define mTYimport 0x4000
#define mTYnaked 0x8000
#define mTYMOD 0xF000 // all modifier bits
#define mTYloadds 0x08000
#define mTYexport 0x10000
#define mTYweak 0x00000
#define mTYimport 0x20000
#define mTYnaked 0x40000
#define mTYMOD 0x78000 // all modifier bits

#else
#define TYTARG 0x11
Expand All @@ -148,19 +148,41 @@ extern int TYptrdiff, TYsize, TYsize_t;
/* Modifiers to basic types */

#ifdef JHANDLE
#define mTYarrayhandle 0x80
#define mTYarrayhandle 0x200
#else
#define mTYarrayhandle 0x0
#endif
#define mTYconst 0x40
#define mTYvolatile 0x80
#define mTYconst 0x100
#define mTYvolatile 0x200
#define mTYrestrict 0 // BUG: add for C99
#define mTYmutable 0 // need to add support
#define mTYunaligned 0 // non-zero for PowerPC

#define mTYimmutable 0x1000000 // immutable data
#define mTYshared 0x2000000 // shared data
#define mTYnothrow 0x4000000 // nothrow function
#define mTYimmutable 0x00080000 // immutable data
#define mTYshared 0x00100000 // shared data
#define mTYnothrow 0x00200000 // nothrow function

#if !MARS
#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
#define mTYnoret 0x01000000 // function has no return
#define mTYtransu 0x01000000 // transparent union
#else
#define mTYfar16 0x01000000
#endif
#define mTYstdcall 0x02000000
#define mTYfastcall 0x04000000
#define mTYinterrupt 0x08000000
#define mTYcdecl 0x10000000
#define mTYpascal 0x20000000
#define mTYsyscall 0x40000000
#define mTYjava 0x80000000

#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
#define mTYTFF 0xFE000000
#else
#define mTYTFF 0xFF000000
#endif
#endif

/* Flags in tytab[] array */
extern unsigned tytab[];
Expand Down
22 changes: 0 additions & 22 deletions src/backend/type.h
Expand Up @@ -48,28 +48,6 @@ struct TYPE
tym_t Tty; /* mask (TYxxx) */
unsigned short Tflags; // TFxxxxx

#if !MARS
#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
#define mTYnoret 0x010000 // function has no return
#define mTYtransu 0x010000 // transparent union
#else
#define mTYfar16 0x010000
#endif
#define mTYstdcall 0x020000
#define mTYfastcall 0x040000
#define mTYinterrupt 0x080000
#define mTYcdecl 0x100000
#define mTYpascal 0x200000
#define mTYsyscall 0x400000
#define mTYjava 0x800000

#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
#define mTYTFF 0xFE0000
#else
#define mTYTFF 0xFF0000
#endif
#endif

mangle_t Tmangle; // name mangling
// Return name mangling of type
#define type_mangle(t) ((t)->Tmangle)
Expand Down

0 comments on commit 69d545f

Please sign in to comment.