LANGUAGES revision 90075
150397SobrienRight now there is no documentation for the GCC tree -> rtl interfaces 250397Sobrien(or more generally the interfaces for adding new languages). 350397Sobrien 450397SobrienSuch documentation would be of great benefit to the project. Until such 550397Sobrientime as we can formally start documenting the interface this file will 650397Sobrienserve as a repository for information on these interface and any incompatable 750397Sobrienchanges we've made. 850397Sobrien 990075Sobrien2001-02-26: 1090075Sobrien A DECL_INITIAL of NULL_TREE or error_mark_node in a VAR_DECL is no longer 1190075Sobrien taken to signify a tentative definition which should not be emitted until 1290075Sobrien end-of-file. Frontends which want that behavior should set 1390075Sobrien DECL_DEFER_OUTPUT before calling rest_of_decl_compilation. 1490075Sobrien 1552284SobrienAug 31, 1998: 1652284Sobrien The interface to HANDLE_PRAGMA has changed. It now takes three arguments. 1752284Sobrien The first two are pointers to functions that should be used to read characters 1852284Sobrien from the input stream, and to push them back into the input stream respectively. 1952284Sobrien The third argument is a pointer to a null terminate string which is the first 2052284Sobrien word after #pragma. The expression supplied by HANDLE_PRAGMA should return 2152284Sobrien non-zero if it parsed and implemented the pragma. Otherwise it should return 2252284Sobrien zero, and leave the input stream as it was before the expression was evaluated. 2352284Sobrien 2452284Sobrien A new back-end definable macro has been added: INSERT_ATTRIBUTES. This macro 2552284Sobrien allows backend to add attributes to decls as they are created. 2652284Sobrien 2750397SobrienJun 10, 1998: 2850397Sobrien The interface to lang_decode_option has changed. It now uses and argc/argv 2950397Sobrien interface to allow for options that use more than one input string. The new 3050397Sobrien declaration is: int lang_decode_option (int argc, char** argv). It now 3150397Sobrien returns the number of input strings processed, or 0 if the option is 3250397Sobrien unknown. 3350397Sobrien 3450397SobrienJun 7, 1998: 3550397Sobrien Front-ends must now define lang_init_options. It is safe for this 3650397Sobrien function to do nothing. See c-lang.c. 3750397Sobrien 3850397SobrienApr 21, 1998: 3950397Sobrien Front ends which link with c-common or other files from the C/C++ 4050397Sobrien front-ends may need to handle TI types. Look for references to 4150397Sobrien [unsigned]int_DI_type_node in your front end. If you have references 4250397Sobrien to these variables, you'll need up update the front end. 4350397Sobrien 4450397Sobrien To update the front end you must mirror all the code which currently 4550397Sobrien deals with intDI_type_node to also handle intTI_type_node. 4650397Sobrien 4750397Sobrien 4850397SobrienApr 7, 1998: 4950397Sobrien The interface between toplev.c and the language front ends for opening the 5050397Sobrien source file has changed: 5150397Sobrien 5250397Sobrien o init_lex() has been renamed to init_parse (char *filename) where filename 5350397Sobrien is the name of the source file. 5450397Sobrien o The code in toplev.c which opened the source file should be moved to 5550397Sobrien the new init_parse function. 5650397Sobrien o toplev.c now calls finish_parse() instead of closing the source file 5750397Sobrien using fclose(). This should now be done in finish_parse, if necessary. 5850397Sobrien 5950397SobrienApr 1, 1998: 6050397Sobrien Front-ends must now define lang_print_xnode. It is safe for this 6150397Sobrien function to do nothing. See c-lang.c. 6250397Sobrien 6350397SobrienFeb 1, 1998: 6450397Sobrien 6550397Sobrien GCC used to store structure sizes & offsets to elements as bitsize 6650397Sobrien quantities. This causes problems because a structure can only be 6750397Sobrien (target memsize / 8) bytes long (this may effect arrays too). This 6850397Sobrien is particularly problematical on machines with small address spaces. 6950397Sobrien 7050397Sobrien So: 7150397Sobrien 7250397Sobrien All trees that represent sizes in bits should have a TREE_TYPE of 7350397Sobrien bitsizetype (rather than sizetype). 7450397Sobrien 7550397Sobrien Accordingly, when such values are computed / initialized, care has to 7650397Sobrien be takes to use / compute the proper type. 7750397Sobrien 7850397Sobrien When a size in bits is converted into a size in bytes, which is expressed 7950397Sobrien in trees, care should be taken to change the tree's type again to sizetype. 8050397Sobrien 8150397Sobrien We've updated C, C++, Fortran & Objective-C to work with the new 8250397Sobrien scheme. Other languages will need to be updated accordingly. 8350397Sobrien Contact amylaar@cygnus.com for additional information. 8450397Sobrien 8550397Sobrien?? 1997: 8650397Sobrien 8750397Sobrien In an effort to decrease cache thrashing and useless loads we've changed the 8850397Sobrien third argument to the DEFTREECODE macro to be a single char. This will 8990075Sobrien affect languages that defined their own tree codes (usually in a .def file). 9050397Sobrien 9150397Sobrien Old way: 9250397Sobrien 9350397Sobrien DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", "d", 0) 9450397Sobrien 9550397Sobrien New way: 9650397Sobrien 9750397Sobrien DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0) 98