intel compilers understand. */
int
-process_pragma (finput, t)
- FILE *finput;
- tree t;
+process_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PROTO ((void));
+ void (* p_ungetc) PROTO ((int));
+ char * pname;
{
int i;
register int c;
- register char *pname;
+ char buf[20];
+ char *s = buf;
+ int align;
- if (TREE_CODE (t) != IDENTIFIER_NODE)
+ /* Should be pragma 'far' or equivalent for callx/balx here. */
+ if (strcmp (pname, "align") != 0)
return 0;
-
- pname = IDENTIFIER_POINTER (t);
-
- if (strcmp (pname, "align") == 0)
+
+ do
{
- char buf[20];
- char *s = buf;
- int align;
-
- do {
- c = getc (finput);
- } while (c == ' ' || c == '\t');
-
- if (c == '(')
- c = getc (finput);
- while (c >= '0' && c <= '9')
- {
- if (s < buf + sizeof buf - 1)
- *s++ = c;
- c = getc (finput);
- }
- *s = '\0';
-
- /* We had to read a non-numerical character to get out of the
- while loop---often a newline. So, we have to put it back to
- make sure we continue to parse everything properly. */
- ungetc (c, finput);
-
- align = atoi (buf);
- switch (align)
- {
- case 0:
- /* Return to last alignment. */
- align = i960_last_maxbitalignment / 8;
- /* Fall through. */
- case 16:
- case 8:
- case 4:
- case 2:
- case 1:
- i960_last_maxbitalignment = i960_maxbitalignment;
- i960_maxbitalignment = align * 8;
- break;
-
- default:
- /* Silently ignore bad values. */
- break;
- }
-
- /* NOTE: ic960 R3.0 pragma align definition:
-
- #pragma align [(size)] | (identifier=size[,...])
- #pragma noalign [(identifier)[,...]]
+ c = p_getc ();
+ }
+ while (c == ' ' || c == '\t');
- (all parens are optional)
+ if (c == '(')
+ c = p_getc ();
+
+ while (c >= '0' && c <= '9')
+ {
+ if (s < buf + sizeof buf - 1)
+ *s++ = c;
+ c = p_getc ();
+ }
+
+ *s = '\0';
- - size is [1,2,4,8,16]
- - noalign means size==1
- - applies only to component elements of a struct (and union?)
- - identifier applies to structure tag (only)
- - missing identifier means next struct
+ /* We had to read a non-numerical character to get out of the
+ while loop---often a newline. So, we have to put it back to
+ make sure we continue to parse everything properly. */
+
+ p_ungetc (c);
- - alignment rules for bitfields need more investigation */
+ align = atoi (buf);
- return 1;
+ switch (align)
+ {
+ case 0:
+ /* Return to last alignment. */
+ align = i960_last_maxbitalignment / 8;
+ /* Fall through. */
+ case 16:
+ case 8:
+ case 4:
+ case 2:
+ case 1:
+ i960_last_maxbitalignment = i960_maxbitalignment;
+ i960_maxbitalignment = align * 8;
+ break;
+
+ default:
+ /* Silently ignore bad values. */
+ break;
}
-
- /* Should be pragma 'far' or equivalent for callx/balx here. */
-
- return 0;
+
+ /* NOTE: ic960 R3.0 pragma align definition:
+
+ #pragma align [(size)] | (identifier=size[,...])
+ #pragma noalign [(identifier)[,...]]
+
+ (all parens are optional)
+
+ - size is [1,2,4,8,16]
+ - noalign means size==1
+ - applies only to component elements of a struct (and union?)
+ - identifier applies to structure tag (only)
+ - missing identifier means next struct
+
+ - alignment rules for bitfields need more investigation */
+
+ return 1;
}
/* Initialize variables before compiling any files. */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
- { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
- { LOCAL_INCLUDE_DIR, 0, 1 }, \
- { TOOL_INCLUDE_DIR, 0, 1 }, \
- { GCC_INCLUDE_DIR, 0, 0 }, \
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
+ { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
/* These are for fixincludes-fixed ansi/bsd headers \
which wouldn't be found otherwise. \
(The use of string catenation here is OK since \
NeXT's native compiler is derived from GCC.) */ \
- { GCC_INCLUDE_DIR "/ansi", 0, 0 }, \
- { GCC_INCLUDE_DIR "/bsd", 0, 0 }, \
- { "/NextDeveloper/Headers", 0, 0 }, \
- { "/NextDeveloper/Headers/ansi", 0, 0 }, \
- { "/NextDeveloper/Headers/bsd", 0, 0 }, \
- { "/LocalDeveloper/Headers", 0, 0 }, \
- { "/LocalDeveloper/Headers/ansi", 0, 0 }, \
- { "/LocalDeveloper/Headers/bsd", 0, 0 }, \
- { "/NextDeveloper/2.0CompatibleHeaders", 0, 0 }, \
- { STANDARD_INCLUDE_DIR, 0, 0 }, \
- { "/usr/include/bsd", 0, 0 }, \
- { 0, 0, 0 } \
+ { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
+ { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
+ { "/NextDeveloper/Headers", 0, 0, 0 }, \
+ { "/NextDeveloper/Headers/ansi", 0, 0, 0 }, \
+ { "/NextDeveloper/Headers/bsd", 0, 0, 0 }, \
+ { "/LocalDeveloper/Headers", 0, 0, 0 }, \
+ { "/LocalDeveloper/Headers/ansi", 0, 0, 0 }, \
+ { "/LocalDeveloper/Headers/bsd", 0, 0, 0 }, \
+ { "/NextDeveloper/2.0CompatibleHeaders", 0, 0, 0 }, \
+ { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
+ { "/usr/include/bsd", 0, 0, 0 }, \
+ { 0, 0, 0, 0 } \
}
#else /* CROSS_COMPILE */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
- { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
- { LOCAL_INCLUDE_DIR, 0, 1 }, \
- { GCC_INCLUDE_DIR, 0, 0 }, \
- { GCC_INCLUDE_DIR "/ansi", 0, 0 }, \
- { GCC_INCLUDE_DIR "/bsd", 0, 0 }, \
- { TOOL_INCLUDE_DIR, 0, 1 }, \
- { TOOL_INCLUDE_DIR "/ansi", 0, 0 }, \
- { TOOL_INCLUDE_DIR "/bsd", 0, 0 }, \
- { STANDARD_INCLUDE_DIR, 0, 0 }, \
- { "/usr/include/bsd", 0, 0 }, \
- { 0, 0, 0 } \
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
+ { GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 }, \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
+ { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
+ { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
+ { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
+ { TOOL_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
+ { TOOL_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
+ { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
+ { "/usr/include/bsd", 0, 0, 0 }, \
+ { 0, 0, 0, 0 } \
}
#endif /* CROSS_COMPILE */
/* How to parse #pragma's */
#undef HANDLE_PRAGMA
-#define HANDLE_PRAGMA(FINPUT, NODE) handle_pragma (FINPUT, NODE)
+#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
+extern int handle_pragma ();
/* Give methods pretty symbol names on NeXT. */
const_section (); \
} \
while (0)
+
+#ifdef ASM_COMMENT_START
+# undef ASM_COMMENT_START
+#endif
+
+#define ASM_COMMENT_START ";#"