2 Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
3 2003, 2004, 2005, 2006, 2007, 2008, 2010
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 /* Associates PTR (which can be a string, etc.) with the file location
30 specified by FILENAME and LINENO. */
37 /* A singly-linked list of filenames. */
38 struct file_name_list
{
39 struct file_name_list
*next
;
43 /* Obstack used for allocating MD strings. */
44 struct obstack string_obstack
;
46 /* A table of ptr_locs, hashed on the PTR field. */
47 static htab_t ptr_locs
;
49 /* An obstack for the above. Plain xmalloc is a bit heavyweight for a
50 small structure like ptr_loc. */
51 static struct obstack ptr_loc_obstack
;
53 /* A hash table of triples (A, B, C), where each of A, B and C is a condition
54 and A is equivalent to "B && C". This is used to keep track of the source
55 of conditions that are made up of separate MD strings (such as the split
56 condition of a define_insn_and_split). */
57 static htab_t joined_conditions
;
59 /* An obstack for allocating joined_conditions entries. */
60 static struct obstack joined_conditions_obstack
;
62 /* The file we are reading. */
65 /* The filename of READ_MD_FILE. */
66 const char *read_md_filename
;
68 /* The current line number in READ_MD_FILE. */
71 /* The name of the toplevel file that indirectly included READ_MD_FILE. */
74 /* The directory part of IN_FNAME. NULL if IN_FNAME is a bare filename. */
75 static char *base_dir
;
77 /* The first directory to search. */
78 static struct file_name_list
*first_dir_md_include
;
80 /* A pointer to the null terminator of the md include chain. */
81 static struct file_name_list
**last_dir_md_include_ptr
= &first_dir_md_include
;
83 /* This callback will be invoked whenever an md include directive is
84 processed. To be used for creation of the dependency file. */
85 void (*include_callback
) (const char *);
87 /* The current maximum length of directory names in the search path
88 for include files. (Altered as we get more of them.) */
89 static size_t max_include_len
;
91 /* A table of md_constant structures, hashed by name. Null if no
92 constant expansion should occur. */
93 static htab_t md_constants
;
95 /* A table of enum_type structures, hashed by name. */
96 static htab_t enum_types
;
98 static void handle_file (directive_handler_t
);
100 /* Given an object that starts with a char * name field, return a hash
101 code for its name. */
104 leading_string_hash (const void *def
)
106 return htab_hash_string (*(const char *const *) def
);
109 /* Given two objects that start with char * name fields, return true if
110 they have the same name. */
113 leading_string_eq_p (const void *def1
, const void *def2
)
115 return strcmp (*(const char *const *) def1
,
116 *(const char *const *) def2
) == 0;
119 /* Return a hash value for the pointer pointed to by DEF. */
122 leading_ptr_hash (const void *def
)
124 return htab_hash_pointer (*(const void *const *) def
);
127 /* Return true if DEF1 and DEF2 are pointers to the same pointer. */
130 leading_ptr_eq_p (const void *def1
, const void *def2
)
132 return *(const void *const *) def1
== *(const void *const *) def2
;
135 /* Associate PTR with the file position given by FILENAME and LINENO. */
138 set_md_ptr_loc (const void *ptr
, const char *filename
, int lineno
)
142 loc
= (struct ptr_loc
*) obstack_alloc (&ptr_loc_obstack
,
143 sizeof (struct ptr_loc
));
145 loc
->filename
= filename
;
146 loc
->lineno
= lineno
;
147 *htab_find_slot (ptr_locs
, loc
, INSERT
) = loc
;
150 /* Return the position associated with pointer PTR. Return null if no
153 static const struct ptr_loc
*
154 get_md_ptr_loc (const void *ptr
)
156 return (const struct ptr_loc
*) htab_find (ptr_locs
, &ptr
);
159 /* Associate NEW_PTR with the same file position as OLD_PTR. */
162 copy_md_ptr_loc (const void *new_ptr
, const void *old_ptr
)
164 const struct ptr_loc
*loc
= get_md_ptr_loc (old_ptr
);
166 set_md_ptr_loc (new_ptr
, loc
->filename
, loc
->lineno
);
169 /* If PTR is associated with a known file position, print a #line
173 print_md_ptr_loc (const void *ptr
)
175 const struct ptr_loc
*loc
= get_md_ptr_loc (ptr
);
177 printf ("#line %d \"%s\"\n", loc
->lineno
, loc
->filename
);
180 /* Return a condition that satisfies both COND1 and COND2. Either string
181 may be null or empty. */
184 join_c_conditions (const char *cond1
, const char *cond2
)
189 if (cond1
== 0 || cond1
[0] == 0)
192 if (cond2
== 0 || cond2
[0] == 0)
195 if (strcmp (cond1
, cond2
) == 0)
198 result
= concat ("(", cond1
, ") && (", cond2
, ")", NULL
);
199 obstack_ptr_grow (&joined_conditions_obstack
, result
);
200 obstack_ptr_grow (&joined_conditions_obstack
, cond1
);
201 obstack_ptr_grow (&joined_conditions_obstack
, cond2
);
202 entry
= XOBFINISH (&joined_conditions_obstack
, const void **);
203 *htab_find_slot (joined_conditions
, entry
, INSERT
) = entry
;
207 /* Print condition COND, wrapped in brackets. If COND was created by
208 join_c_conditions, recursively invoke this function for the original
209 conditions and join the result with "&&". Otherwise print a #line
210 directive for COND if its original file position is known. */
213 print_c_condition (const char *cond
)
215 const char **halves
= (const char **) htab_find (joined_conditions
, &cond
);
219 print_c_condition (halves
[1]);
221 print_c_condition (halves
[2]);
227 print_md_ptr_loc (cond
);
228 printf ("(%s)", cond
);
232 /* A vfprintf-like function for reporting an error against line LINENO
233 of the current MD file. */
235 static void ATTRIBUTE_PRINTF(2,0)
236 message_with_line_1 (int lineno
, const char *msg
, va_list ap
)
238 fprintf (stderr
, "%s:%d: ", read_md_filename
, lineno
);
239 vfprintf (stderr
, msg
, ap
);
240 fputc ('\n', stderr
);
243 /* A printf-like function for reporting an error against line LINENO
244 in the current MD file. */
247 message_with_line (int lineno
, const char *msg
, ...)
252 message_with_line_1 (lineno
, msg
, ap
);
256 /* Like message_with_line, but treat the condition as an error. */
259 error_with_line (int lineno
, const char *msg
, ...)
264 message_with_line_1 (lineno
, msg
, ap
);
269 /* A printf-like function for reporting an error against the current
270 position in the MD file. */
273 fatal_with_file_and_line (const char *msg
, ...)
282 fprintf (stderr
, "%s:%d: ", read_md_filename
, read_md_lineno
);
283 vfprintf (stderr
, msg
, ap
);
286 /* Gather some following context. */
287 for (i
= 0; i
< sizeof (context
)-1; ++i
)
292 if (c
== '\r' || c
== '\n')
301 fprintf (stderr
, "%s:%d: following context is `%s'\n",
302 read_md_filename
, read_md_lineno
, context
);
308 /* Report that we found character ACTUAL when we expected to find
309 character EXPECTED. */
312 fatal_expected_char (int expected
, int actual
)
315 fatal_with_file_and_line ("expected character `%c', found EOF",
318 fatal_with_file_and_line ("expected character `%c', found `%c'",
322 /* Read chars from the MD file until a non-whitespace char and return that.
323 Comments, both Lisp style and C style, are treated as whitespace. */
326 read_skip_spaces (void)
335 case ' ': case '\t': case '\f': case '\r': case '\n':
341 while (c
!= '\n' && c
!= EOF
);
351 fatal_with_file_and_line ("stray '/' in file");
355 while ((c
= read_char ()) && c
!= EOF
)
357 if (prevc
== '*' && c
== '/')
370 /* Read an rtx code name into NAME. It is terminated by any of the
371 punctuation chars of rtx printed syntax. */
374 read_name (struct md_name
*name
)
379 c
= read_skip_spaces ();
384 if (c
== ' ' || c
== '\n' || c
== '\t' || c
== '\f' || c
== '\r'
387 if (c
== ':' || c
== ')' || c
== ']' || c
== '"' || c
== '/'
388 || c
== '(' || c
== '[')
394 if (i
== sizeof (name
->buffer
) - 1)
395 fatal_with_file_and_line ("name too long");
396 name
->buffer
[i
++] = c
;
402 fatal_with_file_and_line ("missing name or number");
405 name
->string
= name
->buffer
;
409 /* Do constant expansion. */
410 struct md_constant
*def
;
414 struct md_constant tmp_def
;
416 tmp_def
.name
= name
->string
;
417 def
= (struct md_constant
*) htab_find (md_constants
, &tmp_def
);
419 name
->string
= def
->value
;
425 /* Subroutine of the string readers. Handles backslash escapes.
426 Caller has read the backslash, but not placed it into the obstack. */
431 int c
= read_char ();
435 /* Backslash-newline is replaced by nothing, as in C. */
439 /* \" \' \\ are replaced by the second character. */
445 /* Standard C string escapes:
448 all are passed through to the output string unmolested.
449 In normal use these wind up in a string constant processed
450 by the C compiler, which will translate them appropriately.
451 We do not bother checking that \[0-7] are followed by up to
452 two octal digits, or that \x is followed by N hex digits.
453 \? \u \U are left out because they are not in traditional C. */
454 case 'a': case 'b': case 'f': case 'n': case 'r': case 't': case 'v':
455 case '0': case '1': case '2': case '3': case '4': case '5': case '6':
457 obstack_1grow (&string_obstack
, '\\');
460 /* \; makes stuff for a C string constant containing
463 obstack_grow (&string_obstack
, "\\n\\t", 4);
466 /* pass anything else through, but issue a warning. */
468 fprintf (stderr
, "%s:%d: warning: unrecognized escape \\%c\n",
469 read_md_filename
, read_md_lineno
, c
);
470 obstack_1grow (&string_obstack
, '\\');
474 obstack_1grow (&string_obstack
, c
);
477 /* Read a double-quoted string onto the obstack. Caller has scanned
478 the leading quote. */
481 read_quoted_string (void)
487 c
= read_char (); /* Read the string */
493 else if (c
== '"' || c
== EOF
)
496 obstack_1grow (&string_obstack
, c
);
499 obstack_1grow (&string_obstack
, 0);
500 return XOBFINISH (&string_obstack
, char *);
503 /* Read a braced string (a la Tcl) onto the string obstack. Caller
504 has scanned the leading brace. Note that unlike quoted strings,
505 the outermost braces _are_ included in the string constant. */
508 read_braced_string (void)
511 int brace_depth
= 1; /* caller-processed */
512 unsigned long starting_read_md_lineno
= read_md_lineno
;
514 obstack_1grow (&string_obstack
, '{');
517 c
= read_char (); /* Read the string */
529 fatal_with_file_and_line
530 ("missing closing } for opening brace on line %lu",
531 starting_read_md_lineno
);
533 obstack_1grow (&string_obstack
, c
);
536 obstack_1grow (&string_obstack
, 0);
537 return XOBFINISH (&string_obstack
, char *);
540 /* Read some kind of string constant. This is the high-level routine
541 used by read_rtx. It handles surrounding parentheses, leading star,
542 and dispatch to the appropriate string constant reader. */
545 read_string (int star_if_braced
)
551 c
= read_skip_spaces ();
555 c
= read_skip_spaces ();
558 old_lineno
= read_md_lineno
;
560 stringbuf
= read_quoted_string ();
564 obstack_1grow (&string_obstack
, '*');
565 stringbuf
= read_braced_string ();
568 fatal_with_file_and_line ("expected `\"' or `{', found `%c'", c
);
572 c
= read_skip_spaces ();
574 fatal_expected_char (')', c
);
577 set_md_ptr_loc (stringbuf
, read_md_filename
, old_lineno
);
581 /* Skip the rest of a construct that started at line LINENO and that
582 is currently nested by DEPTH levels of parentheses. */
585 read_skip_construct (int depth
, int lineno
)
592 c
= read_skip_spaces ();
595 error_with_line (lineno
, "unterminated construct");
630 /* Given a string, return the number of comma-separated elements in it.
631 Return 0 for the null string. */
634 n_comma_elts (const char *s
)
648 /* Given a pointer to a (char *), return a pointer to the beginning of the
649 next comma-separated element in the string. Advance the pointer given
650 to the end of that element. Return NULL if at end of string. Caller
651 is responsible for copying the string if necessary. White space between
652 a comma and an element is ignored. */
655 scan_comma_elt (const char **pstr
)
658 const char *p
= *pstr
;
670 while (*p
!= ',' && *p
!= '\0')
677 /* Convert STRING to uppercase. */
680 upcase_string (char *string
)
684 for (i
= 0; string
[i
]; i
++)
685 string
[i
] = TOUPPER (string
[i
]);
688 /* Add a NAME = VALUE definition to md_constants-style hash table DEFS,
689 where both NAME and VALUE are malloc()ed strings. PARENT_ENUM is the
690 enum to which NAME belongs, or null if NAME is a stand-alone constant. */
692 static struct md_constant
*
693 add_constant (htab_t defs
, char *name
, char *value
,
694 struct enum_type
*parent_enum
)
696 struct md_constant
*def
, tmp_def
;
700 entry_ptr
= htab_find_slot (defs
, &tmp_def
, INSERT
);
703 def
= (struct md_constant
*) *entry_ptr
;
704 if (strcmp (def
->value
, value
) != 0)
705 fatal_with_file_and_line ("redefinition of `%s', was `%s', now `%s'",
706 def
->name
, def
->value
, value
);
707 else if (parent_enum
|| def
->parent_enum
)
708 fatal_with_file_and_line ("redefinition of `%s'", def
->name
);
714 def
= XNEW (struct md_constant
);
717 def
->parent_enum
= parent_enum
;
723 /* Process a define_constants directive, starting with the optional space
724 after the "define_constants". */
727 handle_constants (void)
732 c
= read_skip_spaces ();
734 fatal_expected_char ('[', c
);
736 /* Disable constant expansion during definition processing. */
739 while ( (c
= read_skip_spaces ()) != ']')
741 struct md_name name
, value
;
744 fatal_expected_char ('(', c
);
748 add_constant (defs
, xstrdup (name
.string
), xstrdup (value
.string
), 0);
750 c
= read_skip_spaces ();
752 fatal_expected_char (')', c
);
757 /* For every constant definition, call CALLBACK with two arguments:
758 a pointer a pointer to the constant definition and INFO.
759 Stop when CALLBACK returns zero. */
762 traverse_md_constants (htab_trav callback
, void *info
)
764 htab_traverse (md_constants
, callback
, info
);
767 /* Return a malloc()ed decimal string that represents number NUMBER. */
770 decimal_string (int number
)
772 /* A safe overestimate. +1 for sign, +1 for null terminator. */
773 char buffer
[sizeof (int) * CHAR_BIT
+ 1 + 1];
775 sprintf (buffer
, "%d", number
);
776 return xstrdup (buffer
);
779 /* Process a define_enum or define_c_enum directive, starting with
780 the optional space after the "define_enum". LINENO is the line
781 number on which the directive started and MD_P is true if the
782 directive is a define_enum rather than a define_c_enum. */
785 handle_enum (int lineno
, bool md_p
)
787 char *enum_name
, *value_name
;
789 struct enum_type
*def
;
790 struct enum_value
*ev
;
794 enum_name
= read_string (false);
795 slot
= htab_find_slot (enum_types
, &enum_name
, INSERT
);
798 def
= (struct enum_type
*) *slot
;
799 if (def
->md_p
!= md_p
)
800 error_with_line (lineno
, "redefining `%s' as a different type of enum",
805 def
= XNEW (struct enum_type
);
806 def
->name
= enum_name
;
809 def
->tail_ptr
= &def
->values
;
814 c
= read_skip_spaces ();
816 fatal_expected_char ('[', c
);
818 while ((c
= read_skip_spaces ()) != ']')
822 error_with_line (lineno
, "unterminated construct");
828 ev
= XNEW (struct enum_value
);
832 value_name
= concat (def
->name
, "_", name
.string
, NULL
);
833 upcase_string (value_name
);
834 ev
->name
= xstrdup (name
.string
);
838 value_name
= xstrdup (name
.string
);
839 ev
->name
= value_name
;
841 ev
->def
= add_constant (md_constants
, value_name
,
842 decimal_string (def
->num_values
), def
);
845 def
->tail_ptr
= &ev
->next
;
850 /* Try to find the definition of the given enum. Return null on failure. */
853 lookup_enum_type (const char *name
)
855 return (struct enum_type
*) htab_find (enum_types
, &name
);
858 /* For every enum definition, call CALLBACK with two arguments:
859 a pointer to the constant definition and INFO. Stop when CALLBACK
863 traverse_enum_types (htab_trav callback
, void *info
)
865 htab_traverse (enum_types
, callback
, info
);
868 /* Process an "include" directive, starting with the optional space
869 after the "include". Read in the file and use HANDLE_DIRECTIVE
870 to process each unknown directive. LINENO is the line number on
871 which the "include" occured. */
874 handle_include (int lineno
, directive_handler_t handle_directive
)
876 const char *filename
;
877 const char *old_filename
;
880 FILE *input_file
, *old_file
;
882 filename
= read_string (false);
885 /* If the specified file name is absolute, skip the include stack. */
886 if (!IS_ABSOLUTE_PATH (filename
))
888 struct file_name_list
*stackp
;
890 /* Search the directory path, trying to open the file. */
891 for (stackp
= first_dir_md_include
; stackp
; stackp
= stackp
->next
)
893 static const char sep
[2] = { DIR_SEPARATOR
, '\0' };
895 pathname
= concat (stackp
->fname
, sep
, filename
, NULL
);
896 input_file
= fopen (pathname
, "r");
897 if (input_file
!= NULL
)
903 /* If we haven't managed to open the file yet, try combining the
904 filename with BASE_DIR. */
905 if (input_file
== NULL
)
908 pathname
= concat (base_dir
, filename
, NULL
);
910 pathname
= xstrdup (filename
);
911 input_file
= fopen (pathname
, "r");
914 if (input_file
== NULL
)
917 error_with_line (lineno
, "include file `%s' not found", filename
);
921 /* Save the old cursor. Note that the LINENO argument to this
922 function is the beginning of the include statement, while
923 read_md_lineno has already been advanced. */
924 old_file
= read_md_file
;
925 old_filename
= read_md_filename
;
926 old_lineno
= read_md_lineno
;
928 if (include_callback
)
929 include_callback (pathname
);
931 read_md_file
= input_file
;
932 read_md_filename
= pathname
;
933 handle_file (handle_directive
);
935 /* Restore the old cursor. */
936 read_md_file
= old_file
;
937 read_md_filename
= old_filename
;
938 read_md_lineno
= old_lineno
;
940 /* Do not free the pathname. It is attached to the various rtx
944 /* Process the current file, assuming that read_md_file and
945 read_md_filename are valid. Use HANDLE_DIRECTIVE to handle
946 unknown directives. */
949 handle_file (directive_handler_t handle_directive
)
951 struct md_name directive
;
955 while ((c
= read_skip_spaces ()) != EOF
)
957 lineno
= read_md_lineno
;
959 fatal_expected_char ('(', c
);
961 read_name (&directive
);
962 if (strcmp (directive
.string
, "define_constants") == 0)
964 else if (strcmp (directive
.string
, "define_enum") == 0)
965 handle_enum (lineno
, true);
966 else if (strcmp (directive
.string
, "define_c_enum") == 0)
967 handle_enum (lineno
, false);
968 else if (strcmp (directive
.string
, "include") == 0)
969 handle_include (lineno
, handle_directive
);
970 else if (handle_directive
)
971 handle_directive (lineno
, directive
.string
);
973 read_skip_construct (1, lineno
);
975 c
= read_skip_spaces ();
977 fatal_expected_char (')', c
);
979 fclose (read_md_file
);
982 /* Like handle_file, but for top-level files. Set up in_fname and
983 base_dir accordingly. */
986 handle_toplevel_file (directive_handler_t handle_directive
)
990 in_fname
= read_md_filename
;
991 lastsl
= strrchr (in_fname
, '/');
993 base_dir
= xstrndup (in_fname
, lastsl
- in_fname
+ 1);
997 handle_file (handle_directive
);
1000 /* Parse a -I option with argument ARG. */
1003 parse_include (const char *arg
)
1005 struct file_name_list
*dirtmp
;
1007 dirtmp
= XNEW (struct file_name_list
);
1009 dirtmp
->fname
= arg
;
1010 *last_dir_md_include_ptr
= dirtmp
;
1011 last_dir_md_include_ptr
= &dirtmp
->next
;
1012 if (strlen (dirtmp
->fname
) > max_include_len
)
1013 max_include_len
= strlen (dirtmp
->fname
);
1016 /* The main routine for reading .md files. Try to process all the .md
1017 files specified on the command line and return true if no error occured.
1019 ARGC and ARGV are the arguments to main.
1021 PARSE_OPT, if nonnull, is passed all unknown command-line arguments.
1022 It should return true if it recognizes the argument or false if a
1023 generic error should be reported.
1025 If HANDLE_DIRECTIVE is nonnull, the parser calls it for each
1026 unknown directive, otherwise it just skips such directives.
1027 See the comment above the directive_handler_t definition for
1028 details about the callback's interface. */
1031 read_md_files (int argc
, char **argv
, bool (*parse_opt
) (const char *),
1032 directive_handler_t handle_directive
)
1035 bool no_more_options
;
1036 bool already_read_stdin
;
1039 /* Initialize global data. */
1040 obstack_init (&string_obstack
);
1041 ptr_locs
= htab_create (161, leading_ptr_hash
, leading_ptr_eq_p
, 0);
1042 obstack_init (&ptr_loc_obstack
);
1043 joined_conditions
= htab_create (161, leading_ptr_hash
, leading_ptr_eq_p
, 0);
1044 obstack_init (&joined_conditions_obstack
);
1045 md_constants
= htab_create (31, leading_string_hash
,
1046 leading_string_eq_p
, (htab_del
) 0);
1047 enum_types
= htab_create (31, leading_string_hash
,
1048 leading_string_eq_p
, (htab_del
) 0);
1050 /* Unlock the stdio streams. */
1051 unlock_std_streams ();
1053 /* First we loop over all the options. */
1054 for (i
= 1; i
< argc
; i
++)
1055 if (argv
[i
][0] == '-')
1057 /* An argument consisting of exactly one dash is a request to
1058 read stdin. This will be handled in the second loop. */
1059 if (argv
[i
][1] == '\0')
1062 /* An argument consisting of just two dashes causes option
1063 parsing to cease. */
1064 if (argv
[i
][1] == '-' && argv
[i
][2] == '\0')
1067 if (argv
[i
][1] == 'I')
1069 if (argv
[i
][2] != '\0')
1070 parse_include (argv
[i
] + 2);
1071 else if (++i
< argc
)
1072 parse_include (argv
[i
]);
1074 fatal ("directory name missing after -I option");
1078 /* The program may have provided a callback so it can
1079 accept its own options. */
1080 if (parse_opt
&& parse_opt (argv
[i
]))
1083 fatal ("invalid option `%s'", argv
[i
]);
1086 /* Now loop over all input files. */
1088 no_more_options
= false;
1089 already_read_stdin
= false;
1090 for (i
= 1; i
< argc
; i
++)
1092 if (argv
[i
][0] == '-')
1094 if (argv
[i
][1] == '\0')
1097 if (already_read_stdin
)
1098 fatal ("cannot read standard input twice");
1100 read_md_file
= stdin
;
1101 read_md_filename
= "<stdin>";
1102 handle_toplevel_file (handle_directive
);
1103 already_read_stdin
= true;
1106 else if (argv
[i
][1] == '-' && argv
[i
][2] == '\0')
1108 /* No further arguments are to be treated as options. */
1109 no_more_options
= true;
1112 else if (!no_more_options
)
1116 /* If we get here we are looking at a non-option argument, i.e.
1117 a file to be processed. */
1118 read_md_filename
= argv
[i
];
1119 read_md_file
= fopen (read_md_filename
, "r");
1120 if (read_md_file
== 0)
1122 perror (read_md_filename
);
1125 handle_toplevel_file (handle_directive
);
1129 /* If we get to this point without having seen any files to process,
1130 read the standard input now. */
1131 if (num_files
== 0 && !already_read_stdin
)
1133 read_md_file
= stdin
;
1134 read_md_filename
= "<stdin>";
1135 handle_toplevel_file (handle_directive
);