aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c139
1 files changed, 139 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 99704a43090..ffda2d41c2e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -108,6 +108,8 @@ static void init_asm_output (const char *);
static void finalize (void);
static void crash_signal (int) ATTRIBUTE_NORETURN;
+/* APPLE LOCAL interrupt signal handler (radar 2941633) --ilr */
+static void interrupt_signal (int) ATTRIBUTE_NORETURN;
static void setup_core_dumping (void);
static void compile_file (void);
@@ -252,6 +254,19 @@ int flag_signed_char;
int flag_short_enums;
+/* APPLE LOCAL begin -fast */
+/* Nonzero if we should perform SPEC oriented optimizations. */
+int flag_fast = 0;
+int flag_fastf = 0;
+int flag_fastcp = 0;
+/* APPLE LOCAL end -fast */
+
+/* APPLE LOCAL begin -ffppc 2001-08-01 --sts */
+/* Nonzero if the floating point precision control pass should
+ be performed. (x86 only really, but we pretend it's generic) */
+int flag_fppc = 0;
+/* APPLE LOCAL end -ffppc 2001-08-01 --sts */
+
/* Nonzero if structures and unions should be returned in memory.
This should only be defined if compatibility with another compiler or
@@ -265,12 +280,29 @@ int flag_short_enums;
int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
+/* APPLE LOCAL begin fwritable strings */
+/* Nonzero for -fwritable-strings:
+ store string constants in data segment and don't uniquize them. */
+
+int flag_writable_strings = 0;
+/* APPLE LOCAL end fwritable strings */
+
+/* APPLE LOCAL Altivec */
+int flag_disable_opts_for_faltivec = 0;
+
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
2 means C99-like requirements for complex multiply and divide. */
int flag_complex_method = 0;
+/* APPLE LOCAL begin -fobey-inline */
+/* Nonzero for -fobey-inline: 'inline' keyword must be obeyed, regardless
+ of codesize. */
+
+int flag_obey_inline;
+/* APPLE LOCAL end -fobey-inline */
+
/* Nonzero means that we don't want inlining by virtue of -fno-inline,
not just because the tree inliner turned us off. */
@@ -325,6 +357,10 @@ rtx stack_limit_rtx;
one, unconditionally renumber instruction UIDs. */
int flag_renumber_insns = 1;
+/* APPLE LOCAL begin predictive compilation */
+int predictive_compilation = -1;
+/* APPLE LOCAL end predictive compilation */
+
/* Nonzero if we should track variables. When
flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING it will be set according
to optimize, debug_info_level and debug_hooks in process_options (). */
@@ -575,6 +611,30 @@ floor_log2 (unsigned HOST_WIDE_INT x)
return t;
}
+/* APPLE LOCAL begin interrupt signal handler (radar 2941633) --ilr */
+/* If the compilation is interrupted do some cleanup. Any files created
+ by the compilation are deleted. The compilation is terminated from
+ here. */
+static void
+interrupt_signal (int signo ATTRIBUTE_UNUSED)
+{
+ /* Close the dump files. */
+ if (flag_gen_aux_info)
+ {
+ fclose (aux_info_file);
+ unlink (aux_info_file_name);
+ }
+ if (asm_out_file)
+ {
+ fclose (asm_out_file);
+ if (asm_file_name && *asm_file_name)
+ unlink (asm_file_name);
+ }
+
+ exit (FATAL_EXIT_CODE);
+}
+/* APPLE LOCAL end interrupt signal handler */
+
/* Return the logarithm of X, base 2, considering X unsigned,
if X is a power of 2. Otherwise, returns -1. */
@@ -935,6 +995,46 @@ warn_deprecated_use (tree node)
}
}
+/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) --ilr */
+/* Warn about a use of an identifier which was marked deprecated. */
+void
+warn_unavailable_use (tree node)
+{
+ if (node == 0)
+ return;
+
+ if (DECL_P (node))
+ warning ("%qs is unavailable (declared at %s:%d)",
+ IDENTIFIER_POINTER (DECL_NAME (node)),
+ DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
+ else if (TYPE_P (node))
+ {
+ const char *what = NULL;
+ tree decl = TYPE_STUB_DECL (node);
+
+ if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
+ what = IDENTIFIER_POINTER (TYPE_NAME (node));
+ else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (node)))
+ what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
+
+ if (what)
+ {
+ if (decl)
+ warning ("%qs is unavailable (declared at %s:%d)", what,
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("%qs is unavailable", what);
+ }
+ else if (decl)
+ warning ("type is unavailable (declared at %s:%d)",
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("type is unavailable");
+ }
+}
+/* APPLE LOCAL end "unavailable" attribute (radar 2809697) --ilr */
+
/* Save the current INPUT_LOCATION on the top entry in the
INPUT_FILE_STACK. Push a new entry for FILE and LINE, and set the
INPUT_LOCATION accordingly. */
@@ -1326,6 +1426,18 @@ print_switch_values (FILE *file, int pos, int max,
continue;
if ((*p)[1] == 'd')
continue;
+ /* APPLE LOCAL begin -fast or -fastf or -fastcp */
+ if ((flag_fast || flag_fastf || flag_fastcp)
+ && (*p)[0] == '-' && (*p)[1] == 'O')
+ {
+ int optimize_val;
+ if ((*p)[2] == 's' && (*p)[3] == '\0')
+ continue;
+ optimize_val = read_integral_parameter (*p+2, 0, -1);
+ if (optimize_val != 3)
+ continue;
+ }
+ /* APPLE LOCAL end -fast or -fastf or -fastcp */
pos = print_single_switch (file, pos, max, indent, sep, term, *p, "");
}
@@ -1628,6 +1740,15 @@ general_init (const char *argv0)
#if defined SIGIOT && (!defined SIGABRT || SIGABRT != SIGIOT)
signal (SIGIOT, crash_signal);
#endif
+ /* APPLE LOCAL begin interrupt signal handler (radar 2941633) --ilr */
+ /* Handle compilation interrupts. */
+ if (signal (SIGINT, SIG_IGN) != SIG_IGN)
+ signal (SIGINT, interrupt_signal);
+ if (signal (SIGKILL, SIG_IGN) != SIG_IGN)
+ signal (SIGINT, interrupt_signal);
+ if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
+ signal (SIGTERM, interrupt_signal);
+ /* APPLE LOCAL end interrupt signal handler */
#ifdef SIGFPE
signal (SIGFPE, crash_signal);
#endif
@@ -1635,6 +1756,22 @@ general_init (const char *argv0)
/* Other host-specific signal setup. */
(*host_hooks.extra_signals)();
+ /* APPLE LOCAL begin setrlimit */
+#ifdef RLIMIT_STACK
+ /* Get rid of any avoidable limit on stack size. */
+ {
+ struct rlimit rlim;
+
+ /* Set the stack limit huge. (Compiles normally work within
+ a megabyte of stack, but the normal limit on OSX is 512K for
+ some reason.) */
+ getrlimit (RLIMIT_STACK, &rlim);
+ rlim.rlim_cur = rlim.rlim_max;
+ setrlimit (RLIMIT_STACK, &rlim);
+ }
+#endif /* RLIMIT_STACK defined */
+ /* APPLE LOCAL end setrlimit */
+
/* Initialize the garbage-collector, string pools and tree type hash
table. */
init_ggc ();
@@ -2012,6 +2149,8 @@ lang_dependent_init (const char *name)
provide a dummy function context for them. */
init_dummy_function_start ();
init_expr_once ();
+ /* APPLE LOCAL lno */
+ init_set_costs ();
expand_dummy_function_end ();
/* If dbx symbol table desired, initialize writing it and output the