LANGUAGES revision 52284
168651SkrisRight now there is no documentation for the GCC tree -> rtl interfaces 268651Skris(or more generally the interfaces for adding new languages). 368651Skris 468651SkrisSuch documentation would be of great benefit to the project. Until such 568651Skristime as we can formally start documenting the interface this file will 668651Skrisserve as a repository for information on these interface and any incompatable 768651Skrischanges we've made. 868651Skris 968651SkrisAug 31, 1998: 1068651Skris The interface to HANDLE_PRAGMA has changed. It now takes three arguments. 1168651Skris The first two are pointers to functions that should be used to read characters 1268651Skris from the input stream, and to push them back into the input stream respectively. 1368651Skris The third argument is a pointer to a null terminate string which is the first 1468651Skris word after #pragma. The expression supplied by HANDLE_PRAGMA should return 1568651Skris non-zero if it parsed and implemented the pragma. Otherwise it should return 1668651Skris zero, and leave the input stream as it was before the expression was evaluated. 1768651Skris 1868651Skris A new back-end definable macro has been added: INSERT_ATTRIBUTES. This macro 1968651Skris allows backend to add attributes to decls as they are created. 2068651Skris 2168651SkrisJun 10, 1998: 2268651Skris The interface to lang_decode_option has changed. It now uses and argc/argv 2368651Skris interface to allow for options that use more than one input string. The new 2468651Skris declaration is: int lang_decode_option (int argc, char** argv). It now 2568651Skris returns the number of input strings processed, or 0 if the option is 2668651Skris unknown. 27109998Smarkm 28109998SmarkmJun 7, 1998: 2968651Skris Front-ends must now define lang_init_options. It is safe for this 3068651Skris function to do nothing. See c-lang.c. 3168651Skris 3268651SkrisApr 21, 1998: 3368651Skris Front ends which link with c-common or other files from the C/C++ 3468651Skris front-ends may need to handle TI types. Look for references to 3568651Skris [unsigned]int_DI_type_node in your front end. If you have references 3668651Skris to these variables, you'll need up update the front end. 3768651Skris 3868651Skris To update the front end you must mirror all the code which currently 3968651Skris deals with intDI_type_node to also handle intTI_type_node. 4068651Skris 4168651Skris 4268651SkrisApr 7, 1998: 4368651Skris The interface between toplev.c and the language front ends for opening the 4468651Skris source file has changed: 4568651Skris 4668651Skris o init_lex() has been renamed to init_parse (char *filename) where filename 4768651Skris is the name of the source file. 4868651Skris o The code in toplev.c which opened the source file should be moved to 4968651Skris the new init_parse function. 5068651Skris o toplev.c now calls finish_parse() instead of closing the source file 5168651Skris using fclose(). This should now be done in finish_parse, if necessary. 52109998Smarkm 53109998SmarkmApr 1, 1998: 54109998Smarkm Front-ends must now define lang_print_xnode. It is safe for this 55109998Smarkm function to do nothing. See c-lang.c. 5668651Skris 57109998SmarkmFeb 1, 1998: 58109998Smarkm 59109998Smarkm GCC used to store structure sizes & offsets to elements as bitsize 60109998Smarkm quantities. This causes problems because a structure can only be 61109998Smarkm (target memsize / 8) bytes long (this may effect arrays too). This 62109998Smarkm is particularly problematical on machines with small address spaces. 63109998Smarkm 64109998Smarkm So: 65109998Smarkm 66109998Smarkm All trees that represent sizes in bits should have a TREE_TYPE of 67109998Smarkm bitsizetype (rather than sizetype). 68109998Smarkm 69109998Smarkm Accordingly, when such values are computed / initialized, care has to 70109998Smarkm be takes to use / compute the proper type. 71109998Smarkm 72238405Sjkim When a size in bits is converted into a size in bytes, which is expressed 73238405Sjkim in trees, care should be taken to change the tree's type again to sizetype. 74238405Sjkim 75238405Sjkim We've updated C, C++, Fortran & Objective-C to work with the new 76109998Smarkm scheme. Other languages will need to be updated accordingly. 77109998Smarkm Contact amylaar@cygnus.com for additional information. 78109998Smarkm 79109998Smarkm?? 1997: 80109998Smarkm 81109998Smarkm In an effort to decrease cache thrashing and useless loads we've changed the 82109998Smarkm third argument to the DEFTREECODE macro to be a single char. This will 83109998Smarkm effect languages that defined their own tree codes (usually in a .def file). 84109998Smarkm 85109998Smarkm Old way: 86109998Smarkm 87109998Smarkm DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", "d", 0) 88109998Smarkm 89109998Smarkm New way: 90111147Snectar 91111147Snectar DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0) 92111147Snectar