xref: /netbsd-src/external/gpl3/gdb/dist/sim/common/sim-inline.h (revision 88241920d21b339bf319c0e979ffda80c49a2936)
1 /* The common simulator framework for GDB, the GNU Debugger.
2 
3    Copyright 2002-2024 Free Software Foundation, Inc.
4 
5    Contributed by Andrew Cagney and Red Hat.
6 
7    This file is part of GDB.
8 
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
21 
22 
23 #ifndef SIM_INLINE_H
24 #define SIM_INLINE_H
25 
26 #include "ansidecl.h"
27 
28 /* INLINE CODE SELECTION:
29 
30    GCC -O3 attempts to inline any function or procedure in scope.  The
31    options below facilitate finer grained control over what is and
32    what is not inlined.  In particular, it allows the selection of
33    modules for inlining.  Doing this allows the compiler to both
34    eliminate the overhead of function calls and (as a consequence)
35    also eliminate further dead code.
36 
37    On a CISC (x86) I've found that I can achieve an order of magnitude
38    speed improvement (x3-x5).  In the case of RISC (sparc) while the
39    performance gain isn't as great it is still significant.
40 
41    Each module is controled by the macro <module>_INLINE which can
42    have the values described below
43 
44        0 (ZERO)
45 
46          Do not inline any thing for the given module
47 
48    The following bit fields values can be combined:
49 
50       H_REVEALS_MODULE:
51       C_REVEALS_MODULE:
52 
53          Include the C file for the module into the file being
54          compiled.  The actual inlining is controlled separatly.
55 
56 	 While of no apparent benefit, this makes it possible for the
57 	 included module, when compiled, to inline its calls to what
58 	 would otherwize be external functions.
59 
60 	 {C_,H_} Determines where the module is inlined.  A
61 	 H_REVEALS_MODULE will be included everywhere.
62 
63       INLINE_GLOBALS:
64 
65          Make external functions within the module `inline'.  Thus if
66          the module is included into a file being compiled, calls to
67 	 the included modules funtions can be eliminated.  INLINE_MODULE
68 	 implies REVEAL_MODULE.
69 
70       INLINE_LOCALS:
71 
72          Make internal (static) functions within the module `inline'.
73 
74 
75    CODING STYLE:
76 
77    The inline ability is enabled by specifying every data and function
78    declaration and definition using one of the following methods:
79 
80 
81        GLOBAL INLINE FUNCTIONS:
82 
83           Such functions are small and used heavily.  Inlining them
84           will eliminate an unnecessary function call overhead.
85 
86 	  .h: INLINE_OURPKG (void) ourpkg_func
87 	      (int x,
88 	       int y);
89 
90 	  .c: INLINE_OURPKG (void)
91 	      ourpkg_func (int x,
92 	                   int y)
93 	      {
94 	        ...
95 	      }
96 
97 
98        GLOBAL INLINE VARIABLES:
99 
100           This doesn't make much sense.
101 
102 
103        GLOBAL NON-INLINE (EXTERN) FUNCTIONS AND VARIABLES:
104 
105           These include functions with varargs parameters.  It can
106           also include large rarely used functions that contribute
107           little when inlined.
108 
109 	  .h: extern int ourpkg_print
110 	      (char *fmt, ...);
111 	      extern int a_global_variable;
112 
113 	  .c: #if EXTERN_OURPKG_P
114 	      int
115 	      ourpkg_print (char *fmt,
116 	                    ...)
117               {
118 	         ...
119 	      }
120 	      #endif
121 	      #if EXTERN_OURPKG_P
122 	      int a_global_variable = 1;
123 	      #endif
124 
125 
126        LOCAL (STATIC) FUNCTIONS:
127 
128           These can either be marked inline or just static static vis:
129 
130 	  .h: STATIC_INLINE_OURPKG (int) ourpkg_staticf (void);
131 	  .c: STATIC_INLINE_OURPKG (int)
132 	      ourpkg_staticf (void)
133 	      {
134 	        ..
135 	      }
136 
137 	  .h: STATIC_OURPKG (int) ourpkg_staticf (void);
138 	  .c: STATIC_OURPKG (int)
139 	      ourpkg_staticf (void)
140 	      {
141 	        ..
142 	      }
143 
144 
145        All .h files:
146 
147 
148           All modules must wrap their .h code in the following:
149 
150 	  #ifndef OURPKG_H
151 	  #define OURPKG_H
152 	  ... code proper ...
153 	  #endif
154 
155           In addition, modules that want to allow global inlining must
156           include the lines (below) at the end of the .h file. (FIXME:
157           Shouldn't be needed).
158 
159           #if H_REVEALS_MODULE_P (OURPKG_INLINE)
160           #include "ourpkg.c"
161           #endif
162 
163 
164        All .c files:
165 
166           All modules must wrap their .c code in the following
167 
168 	  #ifndef OURPKG_C
169 	  #define OURPKG_C
170 	  ... code proper ...
171 	  #endif
172 
173 
174    NOW IT WORKS:
175 
176       0:
177 
178       Since no inlining is defined. All macro's get standard defaults
179       (extern, static, ...).
180 
181 
182 
183       H_REVEALS_MODULE (alt includes our):
184 
185 
186       altprog.c defines ALTPROG_C and then includes sim-inline.h.
187 
188       In sim-inline.h the expression `` H_REVEALS_MODULE_P
189       (OURPROG_INLINE) && !  defined (OURPROG_C) && REVEAL_MODULE_P
190       (OURPROG_INLINE) '' is TRUE so it defines *_OURPROG as static
191       and EXTERN_OURPROG_P as FALSE.
192 
193       altprog.c includes ourprog.h.
194 
195       In ourprog.h the expression ``H_REVEALS_MODULE_P
196       (OURPROG_INLINE)'' is TRUE so it includes ourprog.c.
197 
198       Consequently, all the code in ourprog.c is visible and static in
199       the file altprog.c
200 
201 
202 
203       H_REVEALS_MODULE (our includes our):
204 
205 
206       ourprog.c defines OURPROG_C and then includes sim-inline.h.
207 
208       In sim-inline.h the term `` ! defined (OURPROG_C) '' is FALSE so
209       it defines *_OURPROG as non-static and EXTERN_OURPROG_P as TRUE.
210 
211       ourprog.c includes ourprog.h.
212 
213       In ourprog.h the expression ``H_REVEALS_MODULE_P
214       (OURPROG_INLINE)'' is true so it includes ourprog.c.
215 
216       In ourprog.c (second include) the expression defined (OURPROG_C)
217       and so the body is not re-included.
218 
219       Consequently, ourprog.o will contain a non-static copy of all
220       the exported symbols.
221 
222 
223 
224       C_REVEALS_MODULE (alt includes our):
225 
226 
227       altprog.c defines ALTPROG_C and then includes sim-inline.c
228 
229       sim-inline.c defines C_INLINE_C and then includes sim-inline.h
230 
231       In sim-inline.h the expression `` defined (SIM_INLINE) && !
232       defined (OURPROG_C) && REVEAL_MODULE_P (OURPROG_INLINE) '' is
233       true so it defines *_OURPROG as static and EXTERN_OURPROG_P as
234       FALSE.
235 
236       In sim-inline.c the expression ``C_REVEALS_MODULE_P
237       (OURPROG_INLINE)'' is true so it includes ourprog.c.
238 
239       Consequently, all the code in ourprog.c is visible and static in
240       the file altprog.c.
241 
242 
243 
244       C_REVEALS_MODULE (our includes our):
245 
246 
247       ourprog.c defines OURPROG_C and then includes sim-inline.c
248 
249       sim-inline.c defines C_INLINE_C and then includes sim-inline.h
250 
251       In sim-inline.h the term `` !  defined (OURPROG_C) '' is FALSE
252       so it defines *_OURPROG as non-static and EXTERN_OURPROG_P as
253       TRUE.
254 
255       Consequently, ourprog.o will contain a non-static copy of all
256       the exported symbols.
257 
258 
259 
260    REALITY CHECK:
261 
262    This is not for the faint hearted.  I've seen GCC get up to 500mb
263    trying to compile what this can create. */
264 
265 #define H_REVEALS_MODULE		1
266 #define C_REVEALS_MODULE		2
267 #define INLINE_GLOBALS			4
268 #define INLINE_LOCALS			8
269 
270 #define ALL_H_INLINE (H_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
271 #define ALL_C_INLINE (C_REVEALS_MODULE | INLINE_GLOBALS | INLINE_LOCALS)
272 
273 
274 /* Default macro to simplify control several of key the inlines */
275 
276 #ifndef DEFAULT_INLINE
277 #define	DEFAULT_INLINE			INLINE_LOCALS
278 #endif
279 
280 #define REVEAL_MODULE_P(X) (X & (H_REVEALS_MODULE | C_REVEALS_MODULE))
281 #define H_REVEALS_MODULE_P(X) ((X & H_REVEALS_MODULE))
282 #define C_REVEALS_MODULE_P(X) ((X & C_REVEALS_MODULE))
283 
284 
285 #ifndef HAVE_INLINE
286 #ifdef __GNUC__
287 #define HAVE_INLINE
288 #endif
289 #endif
290 
291 
292 /* Your compilers inline prefix */
293 
294 #ifndef INLINE
295 #if defined (__GNUC__) && defined (__OPTIMIZE__)
296 #define INLINE __inline__
297 #else
298 #define INLINE /*inline*/
299 #endif
300 #endif
301 
302 /* ??? Temporary, pending decision to always use extern inline and do a vast
303    cleanup of inline support.  */
304 #ifndef INLINE2
305 #if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
306 #define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
307 #elif defined (__GNUC__)
308 #define INLINE2 __inline__
309 #else
310 #define INLINE2 /*inline*/
311 #endif
312 #endif
313 
314 
315 /* Your compiler's static inline prefix */
316 
317 #ifndef STATIC_INLINE
318 #define STATIC_INLINE static INLINE
319 #endif
320 
321 
322 /* Your compiler's extern inline prefix */
323 
324 #ifndef EXTERN_INLINE
325 #define EXTERN_INLINE extern INLINE2
326 #endif
327 
328 
329 /* Your compilers's unused reserved word */
330 
331 #if !defined (UNUSED)
332 #define UNUSED ATTRIBUTE_UNUSED
333 #endif
334 
335 
336 
337 
338 
339 /* sim_arange */
340 
341 #if !defined (SIM_ARANGE_INLINE) && (DEFAULT_INLINE)
342 # define SIM_ARANGE_INLINE (ALL_H_INLINE)
343 #endif
344 
345 #if ((H_REVEALS_MODULE_P (SIM_ARANGE_INLINE) || defined (SIM_INLINE_C)) \
346      && !defined (SIM_ARANGE_C) \
347      && (REVEAL_MODULE_P (SIM_ARANGE_INLINE)))
348 # if (SIM_ARANGE_INLINE & INLINE_GLOBALS)
349 #  define INLINE_SIM_ARANGE(TYPE) static INLINE UNUSED TYPE
350 #  define EXTERN_SIM_ARANGE_P 0
351 # else
352 #  define INLINE_SIM_ARANGE(TYPE) static UNUSED TYPE
353 #  define EXTERN_SIM_ARANGE_P 0
354 # endif
355 #else
356 # define INLINE_SIM_ARANGE(TYPE) TYPE
357 # define EXTERN_SIM_ARANGE_P 1
358 #endif
359 
360 #if (SIM_ARANGE_INLINE & INLINE_LOCALS)
361 # define STATIC_INLINE_SIM_ARANGE(TYPE) static INLINE TYPE
362 #else
363 # define STATIC_INLINE_SIM_ARANGE(TYPE) static TYPE
364 #endif
365 
366 #define STATIC_SIM_ARANGE(TYPE) static TYPE
367 
368 
369 
370 /* *****
371    sim-bits and sim-endian are treated differently from the rest
372    of the modules below.  Their default value is ALL_H_INLINE.
373    The rest are ALL_C_INLINE.  Don't blink, you'll miss it!
374    *****
375    */
376 
377 /* sim-bits */
378 
379 #if !defined (SIM_BITS_INLINE) && (DEFAULT_INLINE)
380 # define SIM_BITS_INLINE (ALL_H_INLINE)
381 #endif
382 
383 #if ((H_REVEALS_MODULE_P (SIM_BITS_INLINE) || defined (SIM_INLINE_C)) \
384      && !defined (SIM_BITS_C) \
385      && (REVEAL_MODULE_P (SIM_BITS_INLINE)))
386 # if (SIM_BITS_INLINE & INLINE_GLOBALS)
387 #  define INLINE_SIM_BITS(TYPE) static INLINE UNUSED TYPE
388 #  define EXTERN_SIM_BITS_P 0
389 # else
390 #  define INLINE_SIM_BITS(TYPE) static UNUSED TYPE
391 #  define EXTERN_SIM_BITS_P 0
392 # endif
393 #else
394 # define INLINE_SIM_BITS(TYPE) TYPE
395 # define EXTERN_SIM_BITS_P 1
396 #endif
397 
398 #if (SIM_BITS_INLINE & INLINE_LOCALS)
399 # define STATIC_INLINE_SIM_BITS(TYPE) static INLINE TYPE
400 #else
401 # define STATIC_INLINE_SIM_BITS(TYPE) static TYPE
402 #endif
403 
404 #define STATIC_SIM_BITS(TYPE) static TYPE
405 
406 
407 
408 /* sim-core */
409 
410 #if !defined (SIM_CORE_INLINE) && (DEFAULT_INLINE)
411 # define SIM_CORE_INLINE ALL_C_INLINE
412 #endif
413 
414 #if ((H_REVEALS_MODULE_P (SIM_CORE_INLINE) || defined (SIM_INLINE_C)) \
415      && !defined (SIM_CORE_C) \
416      && (REVEAL_MODULE_P (SIM_CORE_INLINE)))
417 # if (SIM_CORE_INLINE & INLINE_GLOBALS)
418 #  define INLINE_SIM_CORE(TYPE) static INLINE UNUSED TYPE
419 #  define EXTERN_SIM_CORE_P 0
420 #else
421 #  define INLINE_SIM_CORE(TYPE) static UNUSED TYPE
422 #  define EXTERN_SIM_CORE_P 0
423 #endif
424 #else
425 # define INLINE_SIM_CORE(TYPE) TYPE
426 # define EXTERN_SIM_CORE_P 1
427 #endif
428 
429 #if (SIM_CORE_INLINE & INLINE_LOCALS)
430 # define STATIC_INLINE_SIM_CORE(TYPE) static INLINE TYPE
431 #else
432 # define STATIC_INLINE_SIM_CORE(TYPE) static TYPE
433 #endif
434 
435 #define STATIC_SIM_CORE(TYPE) static TYPE
436 
437 
438 
439 /* sim-endian */
440 
441 #if !defined (SIM_ENDIAN_INLINE) && (DEFAULT_INLINE)
442 # define SIM_ENDIAN_INLINE ALL_H_INLINE
443 #endif
444 
445 #if ((H_REVEALS_MODULE_P (SIM_ENDIAN_INLINE) || defined (SIM_INLINE_C)) \
446      && !defined (SIM_ENDIAN_C) \
447      && (REVEAL_MODULE_P (SIM_ENDIAN_INLINE)))
448 # if (SIM_ENDIAN_INLINE & INLINE_GLOBALS)
449 #  define INLINE_SIM_ENDIAN(TYPE) static INLINE UNUSED TYPE
450 #  define EXTERN_SIM_ENDIAN_P 0
451 # else
452 #  define INLINE_SIM_ENDIAN(TYPE) static UNUSED TYPE
453 #  define EXTERN_SIM_ENDIAN_P 0
454 # endif
455 #else
456 # define INLINE_SIM_ENDIAN(TYPE) TYPE
457 # define EXTERN_SIM_ENDIAN_P 1
458 #endif
459 
460 #if (SIM_ENDIAN_INLINE & INLINE_LOCALS)
461 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE
462 #else
463 # define STATIC_INLINE_SIM_ENDIAN(TYPE) static TYPE
464 #endif
465 
466 #define STATIC_SIM_ENDIAN(TYPE) static TYPE
467 
468 
469 
470 /* sim-events */
471 
472 #if !defined (SIM_EVENTS_INLINE) && (DEFAULT_INLINE)
473 # define SIM_EVENTS_INLINE ALL_C_INLINE
474 #endif
475 
476 #if ((H_REVEALS_MODULE_P (SIM_EVENTS_INLINE) || defined (SIM_INLINE_C)) \
477      && !defined (SIM_EVENTS_C) \
478      && (REVEAL_MODULE_P (SIM_EVENTS_INLINE)))
479 # if (SIM_EVENTS_INLINE & INLINE_GLOBALS)
480 #  define INLINE_SIM_EVENTS(TYPE) static INLINE UNUSED TYPE
481 #  define EXTERN_SIM_EVENTS_P 0
482 # else
483 #  define INLINE_SIM_EVENTS(TYPE) static UNUSED TYPE
484 #  define EXTERN_SIM_EVENTS_P 0
485 # endif
486 #else
487 # define INLINE_SIM_EVENTS(TYPE) TYPE
488 # define EXTERN_SIM_EVENTS_P 1
489 #endif
490 
491 #if (SIM_EVENTS_INLINE & INLINE_LOCALS)
492 # define STATIC_INLINE_SIM_EVENTS(TYPE) static INLINE TYPE
493 #else
494 # define STATIC_INLINE_SIM_EVENTS(TYPE) static TYPE
495 #endif
496 
497 #define STATIC_SIM_EVENTS(TYPE) static TYPE
498 
499 
500 
501 /* sim-fpu */
502 
503 #if !defined (SIM_FPU_INLINE) && (DEFAULT_INLINE)
504 # define SIM_FPU_INLINE ALL_C_INLINE
505 #endif
506 
507 #if ((H_REVEALS_MODULE_P (SIM_FPU_INLINE) || defined (SIM_INLINE_C)) \
508      && !defined (SIM_FPU_C) \
509      && (REVEAL_MODULE_P (SIM_FPU_INLINE)))
510 # if (SIM_FPU_INLINE & INLINE_GLOBALS)
511 #  define INLINE_SIM_FPU(TYPE) static INLINE UNUSED TYPE
512 #  define EXTERN_SIM_FPU_P 0
513 # else
514 #  define INLINE_SIM_FPU(TYPE) static UNUSED TYPE
515 #  define EXTERN_SIM_FPU_P 0
516 # endif
517 #else
518 # define INLINE_SIM_FPU(TYPE) TYPE
519 # define EXTERN_SIM_FPU_P 1
520 #endif
521 
522 #if (SIM_FPU_INLINE & INLINE_LOCALS)
523 # define STATIC_INLINE_SIM_FPU(TYPE) static INLINE TYPE
524 #else
525 # define STATIC_INLINE_SIM_FPU(TYPE) static TYPE
526 #endif
527 
528 #define STATIC_SIM_FPU(TYPE) static TYPE
529 
530 
531 
532 /* sim-types */
533 
534 #if ((H_REVEALS_MODULE_P (SIM_TYPES_INLINE) || defined (SIM_INLINE_C)) \
535      && !defined (SIM_TYPES_C) \
536      && (REVEAL_MODULE_P (SIM_TYPES_INLINE)))
537 # if (SIM_TYPES_INLINE & INLINE_GLOBALS)
538 #  define INLINE_SIM_TYPES(TYPE) static INLINE UNUSED TYPE
539 #  define EXTERN_SIM_TYPES_P 0
540 # else
541 #  define INLINE_SIM_TYPES(TYPE) static UNUSED TYPE
542 #  define EXTERN_SIM_TYPES_P 0
543 # endif
544 #else
545 # define INLINE_SIM_TYPES(TYPE) TYPE
546 # define EXTERN_SIM_TYPES_P 1
547 #endif
548 
549 #if (SIM_TYPES_INLINE & INLINE_LOCALS)
550 # define STATIC_INLINE_SIM_TYPES(TYPE) static INLINE TYPE
551 #else
552 # define STATIC_INLINE_SIM_TYPES(TYPE) static TYPE
553 #endif
554 
555 #define STATIC_SIM_TYPES(TYPE) static TYPE
556 
557 
558 
559 /* sim_main */
560 
561 #if !defined (SIM_MAIN_INLINE) && (DEFAULT_INLINE)
562 # define SIM_MAIN_INLINE (ALL_C_INLINE)
563 #endif
564 
565 #if ((H_REVEALS_MODULE_P (SIM_MAIN_INLINE) || defined (SIM_INLINE_C)) \
566      && !defined (SIM_MAIN_C) \
567      && (REVEAL_MODULE_P (SIM_MAIN_INLINE)))
568 # if (SIM_MAIN_INLINE & INLINE_GLOBALS)
569 #  define INLINE_SIM_MAIN(TYPE) static INLINE UNUSED TYPE
570 #  define EXTERN_SIM_MAIN_P 0
571 # else
572 #  define INLINE_SIM_MAIN(TYPE) static UNUSED TYPE
573 #  define EXTERN_SIM_MAIN_P 0
574 # endif
575 #else
576 # define INLINE_SIM_MAIN(TYPE) TYPE
577 # define EXTERN_SIM_MAIN_P 1
578 #endif
579 
580 #if (SIM_MAIN_INLINE & INLINE_LOCALS)
581 # define STATIC_INLINE_SIM_MAIN(TYPE) static INLINE TYPE
582 #else
583 # define STATIC_INLINE_SIM_MAIN(TYPE) static TYPE
584 #endif
585 
586 #define STATIC_SIM_MAIN(TYPE) static TYPE
587 
588 /* engine */
589 
590 #if ((H_REVEALS_MODULE_P (ENGINE_INLINE) || defined (SIM_INLINE_C)) \
591      && !defined (ENGINE_C) \
592      && (REVEAL_MODULE_P (ENGINE_INLINE)))
593 # if (ENGINE_INLINE & INLINE_GLOBALS)
594 #  define INLINE_ENGINE(TYPE) static INLINE UNUSED TYPE
595 #  define EXTERN_ENGINE_P 0
596 # else
597 #  define INLINE_ENGINE(TYPE) static UNUSED TYPE
598 #  define EXTERN_ENGINE_P 0
599 # endif
600 #else
601 # define INLINE_ENGINE(TYPE) TYPE
602 # define EXTERN_ENGINE_P 1
603 #endif
604 
605 #if (ENGINE_INLINE & INLINE_LOCALS)
606 # define STATIC_INLINE_ENGINE(TYPE) static INLINE TYPE
607 #else
608 # define STATIC_INLINE_ENGINE(TYPE) static TYPE
609 #endif
610 
611 #define STATIC_ENGINE(TYPE) static TYPE
612 
613 
614 
615 /* icache */
616 
617 #if ((H_REVEALS_MODULE_P (ICACHE_INLINE) || defined (SIM_INLINE_C)) \
618      && !defined (ICACHE_C) \
619      && (REVEAL_MODULE_P (ICACHE_INLINE)))
620 # if (ICACHE_INLINE & INLINE_GLOBALS)
621 #  define INLINE_ICACHE(TYPE) static INLINE UNUSED TYPE
622 #  define EXTERN_ICACHE_P 0
623 #else
624 #  define INLINE_ICACHE(TYPE) static UNUSED TYPE
625 #  define EXTERN_ICACHE_P 0
626 #endif
627 #else
628 # define INLINE_ICACHE(TYPE) TYPE
629 # define EXTERN_ICACHE_P 1
630 #endif
631 
632 #if (ICACHE_INLINE & INLINE_LOCALS)
633 # define STATIC_INLINE_ICACHE(TYPE) static INLINE TYPE
634 #else
635 # define STATIC_INLINE_ICACHE(TYPE) static TYPE
636 #endif
637 
638 #define STATIC_ICACHE(TYPE) static TYPE
639 
640 
641 
642 /* idecode */
643 
644 #if ((H_REVEALS_MODULE_P (IDECODE_INLINE) || defined (SIM_INLINE_C)) \
645      && !defined (IDECODE_C) \
646      && (REVEAL_MODULE_P (IDECODE_INLINE)))
647 # if (IDECODE_INLINE & INLINE_GLOBALS)
648 #  define INLINE_IDECODE(TYPE) static INLINE UNUSED TYPE
649 #  define EXTERN_IDECODE_P 0
650 #else
651 #  define INLINE_IDECODE(TYPE) static UNUSED TYPE
652 #  define EXTERN_IDECODE_P 0
653 #endif
654 #else
655 # define INLINE_IDECODE(TYPE) TYPE
656 # define EXTERN_IDECODE_P 1
657 #endif
658 
659 #if (IDECODE_INLINE & INLINE_LOCALS)
660 # define STATIC_INLINE_IDECODE(TYPE) static INLINE TYPE
661 #else
662 # define STATIC_INLINE_IDECODE(TYPE) static TYPE
663 #endif
664 
665 #define STATIC_IDECODE(TYPE) static TYPE
666 
667 
668 
669 /* semantics */
670 
671 #if ((H_REVEALS_MODULE_P (SEMANTICS_INLINE) || defined (SIM_INLINE_C)) \
672      && !defined (SEMANTICS_C) \
673      && (REVEAL_MODULE_P (SEMANTICS_INLINE)))
674 # if (SEMANTICS_INLINE & INLINE_GLOBALS)
675 #  define INLINE_SEMANTICS(TYPE) static INLINE UNUSED TYPE
676 #  define EXTERN_SEMANTICS_P 0
677 #else
678 #  define INLINE_SEMANTICS(TYPE) static UNUSED TYPE
679 #  define EXTERN_SEMANTICS_P 0
680 #endif
681 #else
682 # define INLINE_SEMANTICS(TYPE) TYPE
683 # define EXTERN_SEMANTICS_P 1
684 #endif
685 
686 #if EXTERN_SEMANTICS_P
687 # define EXTERN_SEMANTICS(TYPE) TYPE
688 #else
689 # define EXTERN_SEMANTICS(TYPE) static UNUSED TYPE
690 #endif
691 
692 #if (SEMANTICS_INLINE & INLINE_LOCALS)
693 # define STATIC_INLINE_SEMANTICS(TYPE) static INLINE TYPE
694 #else
695 # define STATIC_INLINE_SEMANTICS(TYPE) static TYPE
696 #endif
697 
698 #define STATIC_SEMANTICS(TYPE) static TYPE
699 
700 
701 
702 /* support */
703 
704 #if !defined (SUPPORT_INLINE) && (DEFAULT_INLINE)
705 # define SUPPORT_INLINE ALL_C_INLINE
706 #endif
707 
708 #if ((H_REVEALS_MODULE_P (SUPPORT_INLINE) || defined (SIM_INLINE_C)) \
709      && !defined (SUPPORT_C) \
710      && (REVEAL_MODULE_P (SUPPORT_INLINE)))
711 # if (SUPPORT_INLINE & INLINE_GLOBALS)
712 #  define INLINE_SUPPORT(TYPE) static INLINE UNUSED TYPE
713 #  define EXTERN_SUPPORT_P 0
714 #else
715 #  define INLINE_SUPPORT(TYPE) static UNUSED TYPE
716 #  define EXTERN_SUPPORT_P 0
717 #endif
718 #else
719 # define INLINE_SUPPORT(TYPE) TYPE
720 # define EXTERN_SUPPORT_P 1
721 #endif
722 
723 #if (SUPPORT_INLINE & INLINE_LOCALS)
724 # define STATIC_INLINE_SUPPORT(TYPE) static INLINE TYPE
725 #else
726 # define STATIC_INLINE_SUPPORT(TYPE) static TYPE
727 #endif
728 
729 #define STATIC_SUPPORT(TYPE) static TYPE
730 
731 
732 
733 #endif
734