12e0c41c11
* sysdep.c: Problem discovered during IA64 VMS port. [VMS] #include <unixio.h> to get proper prototypes. * adaint.c: Issues discovered/problems fixed during IA64 VMS port. [VMS] #define _POSIX_EXIT for proper semantics. [VMS] #include <unixio.h> for proper prototypes. [VMS] (fork): #define IA64 version. (__gnat_os_exit): Remove unnecessary VMS specific code. * 3vtrasym.adb: Minor reformatting Use terminology encoded/decoded name, rather than C++ specific notion of mangling (this is the terminology used throughout GNAT). * einfo.h: Regenerated * einfo.ads, einfo.adb: Add new flag Is_Thread_Body * exp_ch6.adb: (Expand_N_Subprogram_Body): Handle expansion of thread body procedure * par-prag.adb: Add dummy entry for Thread_Body pragma * rtsfind.ads: Add entries for System.Threads entities for thread body processing * sem_attr.adb: (Analyze_Pragma, Access attributes): Check these are not applied to a thread body, since this is not permitted * sem_prag.adb: Add processing for Thread_Body pragma. Minor comment fix. * sem_res.adb: (Resolve_Call): Check for incorrect attempt to call a thread body procedure with a direct call. * snames.ads, snames.adb: Add entry for Thread_Body pragma Add names associated with thread body expansion * snames.h: Add entry for Thread_Body pragma * s-thread.adb: Add entries for thread body processing These are dummy bodies so far * s-thread.ads: Add documentation on thread body handling. Add entries for thread body processing. * sem_ch10.adb: (Build_Limited_Views): Return after posting an error in case of limited with_clause on subprograms, generics, instances or generic renamings (Install_Limited_Withed_Unit): Do nothing in case of limited with_clause on subprograms, generics, instances or generic renamings * raise.c (setup_to_install): Correct mistake in last revision; two arguments out of order. * trans.c, cuintp.c, argv.c, aux-io.c, cal.c, errno.c, exit.c, gnatbl.c, init.c, stringt.h, utils.c, utils2.c: Update copyright notice, missed in previous change. Remove trailing blanks and other style errors introduced in previous change. * decl.c (gnat_to_gnu_field): Adjust the conditions under which we get rid of the wrapper for a LJM type, ensuring we don't do that if the field is addressable. This avoids potential low level type view mismatches later on, for instance in a by-reference argument passing process. * decl.c (gnat_to_gnu_field): No longer check for BLKmode being aligned at byte boundary. * decl.c (components_to_record): Do not delete the empty variants from the end of the union type. * exp_ch4.adb (Expand_N_Op_Eq): Use base type when locating primitive operation for a derived type, an explicit declaration may use a local subtype of Boolean. * make.adb (Gnatmake): Allow main sources on the command line with a library project when it is only for compilation (no binding or linking). Part of PR ada/12806: * ada-tree.h (TYPE_DIGITS_VALUE, SET_TYPE_DIGITS_VALUE): Save count as tree, not integer. * decl.c: (gnat_to_gnu_entity, case E_Floating_Point_Type): Save count as tree, not integer. * targtyps.c, decl.c, misc.c, gigi.h (fp_prec_to_size, fp_size_to_prec): Temporary routines to work around change in FP sizing semantics in GCC. * utils.c: (build_vms_descriptor): TYPE_DIGITS_VALUE is tree, not integer. * gigi.h: (enumerate_modes): New function. * Make-lang.in: (ada/misc.o): Add real.h. * misc.c: (enumerate_modes): New function. From-SVN: r73250
88 lines
4.0 KiB
C
88 lines
4.0 KiB
C
/****************************************************************************
|
|
* *
|
|
* GNAT COMPILER COMPONENTS *
|
|
* *
|
|
* S T R I N G T *
|
|
* *
|
|
* C Header File *
|
|
* *
|
|
* Copyright (C) 1992-2003 Free Software Foundation, Inc. *
|
|
* *
|
|
* GNAT is free software; you can redistribute it and/or modify it under *
|
|
* terms of the GNU General Public License as published by the Free Soft- *
|
|
* ware Foundation; either version 2, or (at your option) any later ver- *
|
|
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
|
|
* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
|
|
* for more details. You should have received a copy of the GNU General *
|
|
* Public License distributed with GNAT; see file COPYING. If not, write *
|
|
* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
|
|
* MA 02111-1307, USA. *
|
|
* *
|
|
* GNAT was originally developed by the GNAT team at New York University. *
|
|
* Extensive contributions were provided by Ada Core Technologies Inc. *
|
|
* *
|
|
****************************************************************************/
|
|
|
|
/* This file is the C file that corresponds to the Ada package spec
|
|
Stringt. It was created manually from stringt.ads and stringt.adb
|
|
|
|
Note: only the access functions are provided, since the tree transformer
|
|
is not allowed to modify the tree or its auxiliary structures.
|
|
|
|
This package contains routines for handling the strings table which is
|
|
used to store string constants encountered in the source, and also those
|
|
additional string constants generated by compile time concatenation and
|
|
other similar processing.
|
|
|
|
A string constant in this table consists of a series of Char_Code values,
|
|
so that 16-bit character codes can be properly handled if this feature is
|
|
implemented in the scanner.
|
|
|
|
There is no guarantee that hashing is used in the implementation. This
|
|
means that the caller cannot count on having the same Id value for two
|
|
identical strings stored separately.
|
|
|
|
The String_Id values reference entries in the Strings table, which
|
|
contains String_Entry records that record the length of each stored string
|
|
and its starting location in the String_Chars table. */
|
|
|
|
struct String_Entry
|
|
{
|
|
Int String_Index;
|
|
Int Length;
|
|
};
|
|
|
|
/* Pointer to string entry vector. This pointer is passed to the tree
|
|
transformer and stored in a global location. */
|
|
extern struct String_Entry *Strings_Ptr;
|
|
|
|
/* Pointer to name characters table. This pointer is passed to the tree
|
|
transformer and stored in a global location for access from here. The
|
|
String_Index values are subscripts into this array. */
|
|
extern Char_Code *String_Chars_Ptr;
|
|
|
|
|
|
/* String_Length returns the length of the specified string. */
|
|
INLINE Int String_Length (String_Id);
|
|
|
|
INLINE Int
|
|
String_Length (String_Id Id)
|
|
{
|
|
return Strings_Ptr[Id - First_String_Id].Length;
|
|
}
|
|
|
|
|
|
/* Get_String_Char obtains the specified character from a stored string. The
|
|
lower bound of stored strings is always 1, so the range of values is 1 to
|
|
String_Length (Id). */
|
|
INLINE Char_Code Get_String_Char (String_Id, Int);
|
|
|
|
INLINE Char_Code
|
|
Get_String_Char (String_Id Id, Int Index)
|
|
{
|
|
return
|
|
String_Chars_Ptr
|
|
[Strings_Ptr[Id - First_String_Id].String_Index + Index - 1];
|
|
}
|