diff options
Diffstat (limited to 'gcc-4.9/gcc/ada/types.h')
-rw-r--r-- | gcc-4.9/gcc/ada/types.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc-4.9/gcc/ada/types.h b/gcc-4.9/gcc/ada/types.h index 7d1e69624..5e19e8fe6 100644 --- a/gcc-4.9/gcc/ada/types.h +++ b/gcc-4.9/gcc/ada/types.h @@ -76,11 +76,19 @@ typedef Char *Str; /* Pointer to string of Chars */ typedef Char *Str_Ptr; -/* Types for the fat pointer used for strings and the template it - points to. */ -typedef struct {int Low_Bound, High_Bound; } String_Template; -typedef struct {const char *Array; String_Template *Bounds; } - __attribute ((aligned (sizeof (char *) * 2))) Fat_Pointer; +/* Types for the fat pointer used for strings and the template it points to. + The fat pointer is conceptually a couple of pointers, but it is wrapped + up in a special record type. On the Ada side, the record is naturally + aligned (i.e. given pointer alignment) on regular platforms, but it is + given twice this alignment on strict-alignment platforms for performance + reasons. On the C side, for the sake of portability and simplicity, we + overalign it on all platforms (so the machine mode is always the same as + on the Ada side) but arrange to pass it in an even scalar position as a + parameter to functions (so the scalar parameter alignment is always the + same as on the Ada side). */ +typedef struct { int Low_Bound, High_Bound; } String_Template; +typedef struct { const char *Array; String_Template *Bounds; } + __attribute ((aligned (sizeof (char *) * 2))) String_Pointer; /* Types for Node/Entity Kinds: */ |