156160Sru/* Header file for modules that link with gcc.c
2146515Sru   Copyright (C) 1999, 2000, 2001, 2003, 2004, 2007, 2008, 2010
321495Sjmacd   Free Software Foundation, Inc.
4146515Sru
5146515SruThis file is part of GCC.
621495Sjmacd
721495SjmacdGCC is free software; you can redistribute it and/or modify it under
821495Sjmacdthe terms of the GNU General Public License as published by the Free
921495SjmacdSoftware Foundation; either version 3, or (at your option) any later
1021495Sjmacdversion.
1121495Sjmacd
1221495SjmacdGCC is distributed in the hope that it will be useful, but WITHOUT ANY
1321495SjmacdWARRANTY; without even the implied warranty of MERCHANTABILITY or
1421495SjmacdFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1521495Sjmacdfor more details.
1621495Sjmacd
1721495SjmacdYou should have received a copy of the GNU General Public License
1821495Sjmacdalong with GCC; see the file COPYING3.  If not see
1921495Sjmacd<http://www.gnu.org/licenses/>.  */
2021495Sjmacd
2121495Sjmacd#ifndef GCC_GCC_H
2221495Sjmacd#define GCC_GCC_H
2342660Smarkm
2442660Smarkm#include "version.h"
2521495Sjmacd
2621495Sjmacd/* The mapping of a spec function name to the C function that
2721495Sjmacd   implements it.  */
2821495Sjmacdstruct spec_function
2921495Sjmacd{
3021495Sjmacd  const char *name;
3121495Sjmacd  const char *(*func) (int, const char **);
3221495Sjmacd};
3321495Sjmacd
3442660Smarkm/* This defines which switch letters take arguments.  */
3542660Smarkm
3642660Smarkm#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
3742660Smarkm  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
38146515Sru   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
3921495Sjmacd   || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \
4021495Sjmacd   || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \
4121495Sjmacd   || (CHAR) == 'V' || (CHAR) == 'B' || (CHAR) == 'b')
4221495Sjmacd
4321495Sjmacd/* This defines which multi-letter switches take arguments.  */
4421495Sjmacd
4521495Sjmacd#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR)		\
4621495Sjmacd (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext")	\
4721495Sjmacd  || !strcmp (STR, "Tbss") || !strcmp (STR, "include")	\
4821495Sjmacd  || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
4921495Sjmacd  || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
5021495Sjmacd  || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
5121495Sjmacd  || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
5221495Sjmacd  || !strcmp (STR, "isysroot") \
5321495Sjmacd  || !strcmp (STR, "cxx-isystem") || !strcmp (STR, "-iremap") \
5421495Sjmacd  || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
5521495Sjmacd  || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
5621495Sjmacd  || !strcmp (STR, "fintrinsic-modules-path") \
5721495Sjmacd  || !strcmp (STR, "dumpbase") || !strcmp (STR, "dumpdir"))
58146515Sru
5921495Sjmacd
6021495Sjmacd/* These are exported by gcc.c.  */
6121495Sjmacdextern int do_spec (const char *);
62146515Sruextern void record_temp_file (const char *, int, int);
6321495Sjmacdextern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
6421495Sjmacdextern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
6521495Sjmacdextern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
6621495Sjmacdextern void set_input (const char *);
67146515Sru
6821495Sjmacd/* Spec files linked with gcc.c must provide definitions for these.  */
6921495Sjmacd
7021495Sjmacd/* Called before processing to change/add/remove arguments.  */
7121495Sjmacdextern void lang_specific_driver (int *, const char *const **, int *);
72146515Sru
7321495Sjmacd/* Called before linking.  Returns 0 on success and -1 on failure.  */
7421495Sjmacdextern int lang_specific_pre_link (void);
7521495Sjmacd
76146515Sruextern int n_infiles;
77146515Sru
7821495Sjmacd/* Number of extra output files that lang_specific_pre_link may generate.  */
7921495Sjmacdextern int lang_specific_extra_outfiles;
8021495Sjmacd
8121495Sjmacd/* A vector of corresponding output files is made up later.  */
82146515Sru
8321495Sjmacdextern const char **outfiles;
8421495Sjmacd
8521495Sjmacd#endif /* ! GCC_GCC_H */
8621495Sjmacd