00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 #ifndef stab_attr_INCLUDED 00037 #define stab_attr_INCLUDED 00038 /* ==================================================================== 00039 * ==================================================================== 00040 * 00041 * Module: stab_attr.h 00042 * $Revision: 1.2 $ 00043 * $Date: 02/11/07 23:41:59-00:00 $ 00044 * $Author: fchow@keyresearch.com $ 00045 * $Source: /scratch/mee/2.4-65/kpro64-pending/be/whirl2c/SCCS/s.stab_attr.h $ 00046 * 00047 * Revision history: 00048 * 07-Mar-95 - Original Version 00049 * 00050 * Description: 00051 * 00052 * Get TY and ST information, beyond that provided through 00053 * common/com/stab.h. Also, provide functions to access 00054 * and create identifier name attributes. 00055 * 00056 * Symbol table information 00057 * ------------------------ 00058 * 00059 * FILE_SCOPE_ID: 00060 * The scope_id given to TY and ST entries that are declared 00061 * with file-scope. 00062 * 00063 * Reserved names 00064 * -------------- 00065 * 00066 * Stab_Reserved_Ty: 00067 * TRUE when the given type is from a system file which will 00068 * be included anyway (e.g. through whirl2c.h). Do not declare 00069 * symbols for which this condition is TRUE, since this will 00070 * lead to non-compilable whirl2c/whirl2f output! 00071 * 00072 * Stab_Reserved_St: 00073 * TRUE when the given symbol is from a system file which will 00074 * be included anyway (e.g. through whirl2c.h). Do not declare 00075 * symbols for which this condition is TRUE, since this will 00076 * lead to non-compilable whirl2c/whirl2f output! 00077 * 00078 * Flag indicating referenced symbols 00079 * ---------------------------------- 00080 * 00081 * Stab_Reset_Referenced_Flag: 00082 * Will reset this flag for FOR_ALL_LOCAL_SYMBOLS and 00083 * FOR_ALL_CONSTANTS in the given symbol table. 00084 * 00085 * Type information 00086 * ---------------- 00087 * 00088 * MTYPE: 00089 * The name "MTYPE" is more intuitive than TYPE_ID as a 00090 * type for variables that hold elements from the MTYPE 00091 * enumeration. 00092 * 00093 * Stab_Identical_Types: 00094 * Two types are only identical if they have the same qualifiers, 00095 * compatible kinds, compatible MTYPEs, and identical substructure. 00096 * ENUM types are treated as scalars. While constructed types must 00097 * have identical substructure, we allow more lenient checks for 00098 * the top-level types: We can turn off qualifier checks 00099 * (check_quals == FALSE); we can treat all scalar values as 00100 * identical (check_scalars == FALSE); and we can treat pointers 00101 * as scalars (ptrs_as_scalars == TRUE). 00102 * 00103 * Stab_Assignment_Compatible_Types: 00104 * Similar to Stab_identical_types, but with the added leniency 00105 * for pointer types (i.e. qualifiers of pointed types) 00106 * specified in the ANSI/ISO C standard. 00107 * 00108 * Stab_Is_Element_Type_Of_Array: 00109 * True if the given etype is an element of the given a(rray) 00110 * type, or if it is an element of array elements of the array 00111 * type. 00112 * 00113 * Stab_Array_Has_Dynamic_Bounds: 00114 * This routine takes an array type [TODO: handle pointers 00115 * as arrays at every call site], and returns TRUE if all 00116 * bounds and stride information is given in terms of constant 00117 * values; otherwise FALSE will be returned. 00118 * 00119 * Stab_Get_Mload_Ty: 00120 * We have very limited information about MLOAD types, since we 00121 * only keep the base address in the WN node. This returns the 00122 * type of the first field in the given struct/union "base" struct 00123 * at the given offset and of the given (non-zero) size. 00124 * 00125 * Stab_Mtype_To_Ty: 00126 * Get the TY of an mtype. 00127 * 00128 * TY_IS_xxxxx: 00129 * Inquiries about what kind of type (TY) we are dealing with. 00130 * 00131 * Function types 00132 * -------------- 00133 * 00134 * Func_Return_Type: 00135 * The return type for a given function-type. Will be a 00136 * Void_Type for whirl2c when Func_Return_Character==TRUE, 00137 * since in C we return CHARACTER strings through an explicit 00138 * first parameter. 00139 * 00140 * Func_Return_Character: 00141 * TRUE when the given function type returns a Fortran CHARACTER 00142 * string. Can only return TRUE in Fortran mode. 00143 * 00144 * Func_Return_To_Param: 00145 * TRUE when the given function type returns a value into the 00146 * location denoted by the first parameter. 00147 * 00148 * Type creation 00149 * ------------- 00150 * Somtimes it may be necessary to create new TY entries beyond 00151 * those in the symbol-table generated by the compiler-phases, 00152 * and for these occations we provide the following facilities. 00153 * After processing of a given symbol table, we must reset any 00154 * TY fields to what they were before this translation. 00155 * 00156 * Stab_Pointer_To: 00157 * If the given TY has a TY_pointer attribute, then simply 00158 * return it; otherwise, create a new TY entry and set the 00159 * TY_pointer attribute of the pointee to point to it. 00160 * 00161 * Stab_Array_Of: 00162 * Creates a unique one-dimensional array type with the given 00163 * number of elements and the given element type. 00164 * 00165 * Stab_initialize: 00166 * Record the size of certain tables in the global symtab. This 00167 * information is then used later on in function Stab_finalize 00168 * to reset the tables back to their original size and, thus, 00169 * undo any additions made to these tables during whirl2c. 00170 * 00171 * Stab_finalize: 00172 * Reset certain tables in the global symtab back to their size 00173 * at the start of whirl2c, thereby undoing any additions made 00174 * to these tables during whirl2c. 00175 * 00176 * 00177 * Identifier naming utilities 00178 * --------------------------- 00179 * We operate with a cyclic character buffer for identifier names, 00180 * where the size of the buffer is a minimum of 1024 characters 00181 * and at a maximum of 8 times the largest name encountered. Note 00182 * that a call to any of the functions described below may allocate 00183 * a new name buffer. Name buffers are allocated from the cyclic 00184 * character buffer, and a name-buffer may be reused at every 8th 00185 * allocation. We guarantee that a name-buffer is valid up until 00186 * 7 subsequent name-buffer allocations, but no longer. After 00187 * 7 subsequent name-buffer allocations, the name buffer may be 00188 * reused (overwritten) or even freed up from dynamic memory. While 00189 * the results from the calls to the functions provided here may be 00190 * used to construct identifier names, these results should be saved 00191 * off into a more permanent buffer area once the names have been 00192 * constructed. 00193 * 00194 * Stab_Free_Namebufs: 00195 * Frees up the memory allocated for string buffers. This should 00196 * be done between processing individual PUs. 00197 * 00198 * Get_Name_Buf_Slot: 00199 * Allocate a new name-buffer slot of the given size. It is up 00200 * to the caller to ensure that no reference is made to 00201 * characters outside the allocated slot. The cyclic name 00202 * buffer will become at least 8 times the size of this slot, 00203 * so do not use this as a method for obtaining an arbitrary 00204 * temporary memory-pool! 00205 * 00206 * Number_as_String: 00207 * Convert the number into an equivalent ASCII character 00208 * string representation, using the given <stdio.h> formatting. 00209 * A maximum of 128 characters will be allocated to hold the 00210 * resultant string value. Note that the format must accept 00211 * a 64 bits integral value. 00212 * 00213 * Ptr_as_String: 00214 * Convert the pointer into an equivalent ASCII character 00215 * string representation. A maximum of 128 characters will 00216 * be allocated to hold the resultant string value. 00217 * 00218 * Concat2_Strings/Concat3_Strings: 00219 * Concatenate two and three strings, respectively, into 00220 * a new combined character string. 00221 * 00222 * Name_Hash_Idx: 00223 * Using the hash-value returned from Get_Hash_Value_For_Name, 00224 * this gets an index into the hash-table based on the log(2, 00225 * tbl_size) rightmost characters of the name. For a 00226 * tbl_size of 173, the rightmost 2 characters determines 00227 * the hash_idx. For an empty ('\0' or NULL) name, the 00228 * hash value and index will be zero 00229 * 00230 * Temporary variable information 00231 * ------------------------------ 00232 * Stab_Free_Tmpvars: 00233 * This will free up memory associated with the maintenance of 00234 * temporary variables, and should be called after processing each 00235 * PU. 00236 * 00237 * Stab_Lock_Tmpvar: 00238 * Return an identifying index for a tempvar of the given type. 00239 * If none existed before-hand, then a new one will be declared 00240 * locally to the current PU, using the subroutine provided, which 00241 * declares the temporary variable based on its type and index. 00242 * 00243 * Stab_Unlock_Tmpvar: 00244 * Given a tmpvar identifying index, this tmpvar will now become 00245 * available for other uses. 00246 * 00247 * ==================================================================== 00248 * ==================================================================== 00249 */ 00250 00251 /*------ Type Information ------*/ 00252 /*------------------------------*/ 00253 00254 typedef TYPE_ID MTYPE; 00255 00256 extern BOOL Stab_Identical_Types(TY_IDX t1, 00257 TY_IDX t2, 00258 BOOL check_quals, 00259 BOOL check_scalars, 00260 BOOL ptrs_as_scalars); 00261 00262 extern BOOL Stab_Assignment_Compatible_Types(TY_IDX t1, 00263 TY_IDX t2, 00264 BOOL check_quals, 00265 BOOL check_scalars, 00266 BOOL ptrs_as_scalars); 00267 00268 extern BOOL Stab_Is_Element_Type_Of_Array(TY_IDX atype, TY_IDX etype); 00269 00270 extern BOOL Stab_Array_Has_Dynamic_Bounds(TY_IDX ty); 00271 extern BOOL Stab_Is_Assumed_Sized_Array(TY_IDX ty); 00272 extern BOOL Stab_Is_Equivalenced_Struct(TY_IDX ty); 00273 00274 extern TY_IDX Stab_Get_Mload_Ty(TY_IDX base, 00275 STAB_OFFSET offset, 00276 STAB_OFFSET size); 00277 00278 inline TY_IDX Stab_Mtype_To_Ty(TYPE_ID mtype) { return Be_Type_Tbl(mtype); } 00279 00280 inline BOOL TY_Is_Pointer(TY_IDX ty) 00281 { 00282 return TY_kind(ty) == KIND_POINTER; 00283 } /* TY_Is_Pointer */ 00284 00285 inline BOOL TY_Is_Array(TY_IDX ty) 00286 { 00287 return TY_kind(ty) == KIND_ARRAY; 00288 } /* TY_Is_Array */ 00289 00290 inline BOOL TY_Is_Function(TY_IDX ty) 00291 { 00292 return TY_kind(ty) == KIND_FUNCTION; 00293 } /* TY_Is_Function */ 00294 00295 inline BOOL TY_Is_Struct(TY_IDX ty) 00296 { 00297 return TY_kind(ty) == KIND_STRUCT && !TY_is_union(ty); 00298 } /* TY_Is_Struct */ 00299 00300 inline BOOL TY_Is_Union(TY_IDX ty) 00301 { 00302 return TY_kind(ty) == KIND_STRUCT && TY_is_union(ty); 00303 } /* TY_Is_Union */ 00304 00305 inline BOOL TY_Is_Structured(TY_IDX ty) 00306 { 00307 return TY_kind(ty) == KIND_STRUCT; 00308 } /* TY_Is_Structured */ 00309 00310 inline BOOL TY_Is_String(TY_IDX ty) 00311 { 00312 return TY_mtype(ty) == MTYPE_STRING; 00313 } /* TY_Is_String */ 00314 00315 inline BOOL TY_Is_Integral(TY_IDX ty) 00316 { 00317 return (MTYPE_type_class(TY_mtype(ty)) & MTYPE_CLASS_INTEGER) != 0; 00318 } /* TY_Is_Integral */ 00319 00320 inline BOOL TY_Is_Quad(TY_IDX ty) 00321 { 00322 return TY_kind(ty) == KIND_SCALAR && TY_mtype(ty) == MTYPE_FQ; 00323 } /* TY_Is_Quad */ 00324 00325 inline BOOL TY_Is_Complex(TY_IDX ty) 00326 { 00327 return TY_kind(ty) == KIND_SCALAR && (TY_mtype(ty) == MTYPE_C4 || 00328 TY_mtype(ty) == MTYPE_C8 || 00329 TY_mtype(ty) == MTYPE_C10 || 00330 TY_mtype(ty) == MTYPE_CQ); 00331 } /* TY_Is_Complex */ 00332 00333 inline BOOL TY_Is_Array_Or_Function(TY_IDX ty) 00334 { 00335 return ty != 0 && (TY_Is_Function(ty) || TY_Is_Array(ty)); 00336 } /* TY_Is_Array_Or_Function */ 00337 00338 inline BOOL TY_Is_Scalar(TY_IDX ty) 00339 { 00340 return TY_kind(ty) == KIND_SCALAR; 00341 } /* TY_Is_Scalar */ 00342 00343 inline BOOL TY_Is_Pointer_Or_Scalar(TY_IDX ty) 00344 { 00345 return TY_Is_Scalar(ty) || TY_Is_Pointer(ty); 00346 } /* TY_Is_Pointer_Or_Scalar */ 00347 00348 #if (defined(BUILD_WHIRL2F) || defined(BUILD_PURPLE)) 00349 inline BOOL TY_Is_Character_Reference(TY_IDX ty) 00350 { 00351 return TY_Is_Pointer(ty) && 00352 (TY_is_character(TY_pointed(ty)) || 00353 TY_mtype(TY_pointed(ty)) == MTYPE_STR); 00354 } /* TY_Is_Character_Reference */ 00355 00356 /* The front-end is not always reliable in where it sets the is_character 00357 * flag, so we look for it both on the array and on the element type. 00358 */ 00359 inline BOOL TY_Is_Character_String(TY_IDX ty) 00360 { 00361 return TY_is_character(ty) || 00362 TY_mtype(ty) == MTYPE_STR || 00363 (TY_Is_Array(ty) && 00364 TY_Is_Integral(TY_AR_etype(ty)) && 00365 TY_size(TY_AR_etype(ty)) == 1 && 00366 TY_is_character(TY_AR_etype(ty))); 00367 } /* TY_Is_Character_String */ 00368 00369 inline BOOL TY_Is_Chararray(TY_IDX ty) 00370 { 00371 return TY_Is_Array(ty) && TY_Is_Character_String(TY_AR_etype(ty)); 00372 } /* TY_Is_Chararray */ 00373 00374 inline BOOL TY_Is_Chararray_Reference(TY_IDX ty) 00375 { 00376 return TY_Is_Pointer(ty) && TY_Is_Chararray(TY_pointed(ty)); 00377 } /* TY_Is_Chararray_Reference */ 00378 00379 #endif /*BUILD_WHIRL2F || BUILD_PURPLE*/ 00380 00381 inline BOOL TY_Is_Array_Of_Chars(TY_IDX ty) 00382 { 00383 return TY_Is_Array(ty) && 00384 TY_AR_ndims(ty) == 1 && 00385 TY_Is_Integral(TY_AR_etype(ty)) && 00386 TY_size(TY_AR_etype(ty)) == 1; 00387 } /* TY_Is_Array_Of_Chars */ 00388 00389 00390 /* fortran FEs now generate U1 arrays for chars */ 00391 00392 inline BOOL TY_Is_Array_Of_UChars(TY_IDX ty) 00393 { 00394 return TY_Is_Array(ty) && 00395 TY_AR_ndims(ty) == 1 && 00396 TY_mtype(TY_AR_etype(ty)) == MTYPE_U1 ; 00397 } /* TY_Is_Array_Of_Chars */ 00398 00399 inline BOOL TY_Is_Preg_Type(TY_IDX ty) 00400 { 00401 /* Return True if ty is a valid type for pseudo registers; 00402 return False otherwise. */ 00403 return TY_Is_Pointer_Or_Scalar(ty); 00404 } /* TY_Is_Preg_Type */ 00405 00406 inline BOOL FLD_Is_Bitfield(FLD_HANDLE fld, FLD_HANDLE next_fld, 00407 INT64 max_size) 00408 { 00409 /* fld must not be a member of a union! */ 00410 return !FLD_equivalence(fld) && 00411 (FLD_is_bit_field(fld) || 00412 (next_fld.Is_Null () && max_size < TY_size(FLD_type(fld))) || 00413 (!next_fld.Is_Null() && !FLD_equivalence(next_fld) && 00414 FLD_ofst(next_fld) - FLD_ofst(fld) < TY_size(FLD_type(fld)))); 00415 } /* FLD_Is_Bitfield */ 00416 00417 /*------ Symbol table Information ------*/ 00418 /*--------------------------------------*/ 00419 00420 inline BOOL Stab_Is_Valid_Base(const ST *st) 00421 { 00422 return (ST_base(st) != NULL && 00423 ST_base(st) != (st) && 00424 ST_sym_class(ST_base(st)) != CLASS_BLOCK /* cg generated */ ); 00425 } /* Stab_Is_Valid_Base */ 00426 00427 inline BOOL Stab_Is_Common_Block(const ST *st) 00428 { 00429 return ((ST_sclass(st) == SCLASS_COMMON || 00430 ST_sclass(st) == SCLASS_DGLOBAL) && 00431 TY_Is_Structured(ST_type(st))); 00432 } /* Stab_Is_Common_Block */ 00433 00434 inline BOOL Stab_Is_Equivalence_Block(const ST *st) 00435 { 00436 return (ST_sym_class(st) == CLASS_VAR && 00437 TY_Is_Structured(ST_type(st)) && 00438 ST_sclass(st) != SCLASS_COMMON && 00439 ! TY_flist(Ty_Table[ST_type(st)]).Is_Null () && 00440 FLD_equivalence(TY_fld(Ty_Table[ST_type(st)]))); 00441 } /* Stab_Is_Equivalence_Block */ 00442 00443 inline BOOL Stab_Is_Based_At_Common_Or_Equivalence(const ST *st) 00444 { 00445 return (Stab_Is_Valid_Base(st) && 00446 (Stab_Is_Common_Block(ST_base(st)) || 00447 Stab_Is_Equivalence_Block(ST_base(st)))); 00448 } /* Stab_Is_Based_At_Common_Or_Equivalence */ 00449 00450 inline BOOL Stab_No_Linkage(const ST *st) 00451 { 00452 return (ST_sclass(st) == SCLASS_AUTO || 00453 ST_sclass(st) == SCLASS_FORMAL || 00454 ST_sclass(st) == SCLASS_FORMAL_REF); 00455 } /* Stab_No_Linkage */ 00456 00457 inline BOOL Stab_External_Linkage(const ST *st) 00458 { 00459 return (!Stab_No_Linkage(st) && 00460 ST_sclass(st) != SCLASS_PSTATIC && 00461 ST_sclass(st) != SCLASS_FSTATIC && 00462 ST_sclass(st) != SCLASS_CPLINIT && 00463 ST_sclass(st) != SCLASS_EH_REGION && 00464 ST_sclass(st) != SCLASS_EH_REGION_SUPP && 00465 ST_sclass(st) != SCLASS_DISTR_ARRAY); 00466 } /* Stab_External_Linkage */ 00467 00468 inline BOOL Stab_External_Def_Linkage(const ST *st) 00469 { 00470 return (Stab_External_Linkage(st) && ST_sclass(st) != SCLASS_EXTERN); 00471 } /* Stab_External_Def_Linkage */ 00472 00473 inline BOOL Stab_Identical_Quals(TY_IDX t1, TY_IDX t2) 00474 { 00475 return (TY_is_volatile(t1) == TY_is_volatile(t2) && 00476 TY_is_restrict(t1) == TY_is_restrict(t2) && 00477 TY_is_const(t1) == TY_is_const(t2)); 00478 } /* Stab_Identical_Quals */ 00479 00480 inline BOOL Stab_Assign_Compatible_Pointer_Quals(TY_IDX t1, TY_IDX t2) 00481 { 00482 return ((TY_is_volatile(t2)? TY_is_volatile(t1) : TRUE) && 00483 (TY_is_restrict(t2)? TY_is_restrict(t1) : TRUE) && 00484 (TY_is_const(t2)? TY_is_const(t1) : TRUE)); 00485 } /* Stab_Assign_Compatible_Pointer_Quals */ 00486 00487 #if (defined(BUILD_WHIRL2F) || defined(BUILD_PURPLE)) 00488 /* A macro to test if a parameter is a character string, in which case 00489 * it needs an implicit length parameter. Note that in the test on the 00490 * argument (caller) side we only need to consider reference types, since 00491 * the call-by-reference always should be explicit on that side. This 00492 * macro should only be used on the subprogram definition side! This 00493 * only applies to Fortran code. 00494 */ 00495 inline BOOL STAB_PARAM_HAS_IMPLICIT_LENGTH(const ST *st) 00496 { 00497 return ((ST_sclass(st) == SCLASS_FORMAL_REF && 00498 TY_Is_Character_String(ST_type(st))) || 00499 (ST_sclass(st) == SCLASS_FORMAL && 00500 (TY_Is_Character_Reference(ST_type(st)) || 00501 TY_Is_Chararray_Reference(ST_type(st))))); 00502 } 00503 00504 /* Identify cases when a reference parameter is explicitly represented 00505 * as a pointer (as opposed to an SCLASS_FORMAL_REF). This only applies 00506 * to Fortran code. 00507 */ 00508 inline BOOL STAB_IS_POINTER_REF_PARAM(const ST *st) 00509 { 00510 return (TY_Is_Pointer(ST_type(st)) && 00511 ST_sclass(st)==SCLASS_FORMAL && 00512 !ST_is_value_parm(st)); 00513 } 00514 #endif /*BUILD_WHIRL2F || BUILD_PURPLE*/ 00515 00516 00517 /*----- Reserved Names Information -----*/ 00518 /*--------------------------------------*/ 00519 00520 extern BOOL Stab_Reserved_Ty(TY_IDX ty); 00521 extern BOOL Stab_Reserved_St(const ST *st); 00522 00523 /*------- Referenced Information -------*/ 00524 /*--------------------------------------*/ 00525 00526 extern void Stab_Reset_Referenced_Flag(SYMTAB_IDX symtab); 00527 00528 00529 /*------ Function type attributes ------*/ 00530 /*--------------------------------------*/ 00531 00532 inline BOOL Func_Return_Character(TY_IDX func_ty) 00533 { 00534 #ifdef BUILD_WHIRL2F 00535 return TY_is_character(Ty_Table[TY_ret_type(func_ty)]); 00536 #else /*BUILD_WHIRL2C*/ 00537 return FALSE; 00538 #endif /*BUILD_WHIRL2F*/ 00539 } /* Func_Return_Character */ 00540 00541 inline TY_IDX Func_Return_Type(TY_IDX func_ty) 00542 { 00543 #ifdef BUILD_WHIRL2F 00544 return TY_ret_type(func_ty); 00545 #else /*BUILD_WHIRL2C*/ 00546 return TY_is_character(Ty_Table[TY_ret_type(func_ty)]) ? 00547 Void_Type : TY_ret_type(func_ty); 00548 #endif /*BUILD_WHIRL2F*/ 00549 } /* Func_Return_Type */ 00550 00551 inline BOOL Func_Return_To_Param(TY_IDX func_ty) 00552 { 00553 #ifdef BUILD_WHIRL2F 00554 return TY_return_to_param(Ty_Table[func_ty]); 00555 #else /*BUILD_WHIRL2C*/ 00556 return TY_return_to_param(Ty_Table[func_ty]) && 00557 !TY_is_character(Ty_Table[TY_ret_type(func_ty)]); 00558 #endif /*BUILD_WHIRL2F*/ 00559 } /* Func_Return_To_Param */ 00560 00561 00562 00563 /*------ Obtaining pointer/array types ------*/ 00564 /*-------------------------------------------*/ 00565 00566 inline TY_IDX 00567 Stab_Pointer_To(TY_IDX pointee) { return Make_Pointer_Type(pointee); } 00568 00569 00570 extern TY_IDX Stab_Array_Of(TY_IDX etype, mINT64 num_elts) ; 00571 00572 extern void Stab_initialize(void); 00573 extern void Stab_finalize(void); 00574 extern void Stab_initialize_flags(void) ; 00575 extern void Stab_finalize_flags(void) ; 00576 00577 00578 /*------ Name manipulation ------*/ 00579 /*-------------------------------*/ 00580 00581 extern void Stab_Free_Namebufs(void); 00582 extern char *Get_Name_Buf_Slot(UINT size); 00583 extern const char *Number_as_String(INT64 number, const char *fmt); 00584 extern const char *Ptr_as_String(const void *ptr); 00585 extern const char *Concat2_Strings(const char *name1, const char *name2); 00586 00587 inline const char *Concat3_Strings(const char *name1, 00588 const char *name2, 00589 const char *name3) 00590 { 00591 return Concat2_Strings(name1, Concat2_Strings(name2, name3)); 00592 } /* Concat3_Strings */ 00593 00594 extern UINT64 Get_Hash_Value_For_Name(const char *name); 00595 00596 inline UINT32 Name_Hash_Idx(UINT64 hash_value, INT32 tbl_size) 00597 { 00598 return (UINT32)(hash_value % tbl_size); 00599 } /* Name_Hash_Idx */ 00600 00601 extern STAB_OFFSET Stab_Full_Split_Offset(const ST *split_out_st); 00602 00603 00604 /*---- temporary variable information -----*/ 00605 /*-----------------------------------------*/ 00606 00607 extern void Stab_Free_Tmpvars(void); 00608 extern void Stab_Unlock_All_Tmpvars(void); 00609 extern UINT Stab_Lock_Tmpvar(TY_IDX ty, void (*declare_tmpvar)(TY_IDX, UINT)); 00610 extern void Stab_Unlock_Tmpvar(UINT idx); 00611 00612 #endif /* stab_attr_INCLUDED */ 00613 00614 00615 00616 00617 00618
1.5.6