OSDN Git Service

Change TARGET_ALTIVEC to TARGET_ALTIVEC_ABI.
[pf3gnuchains/gcc-fork.git] / gcc / c-opts.c
index 462ca24..b15f31c 100644 (file)
@@ -475,6 +475,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       warn_format_zero_length = value;
       break;
 
+    case OPT_Winit_self:
+      warn_init_self = value;
+      break;
+
     case OPT_Wimplicit:
       set_Wimplicit (value);
       break;
@@ -546,6 +550,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       warn_nonnull = value;
       break;
 
+    case OPT_Wold_style_definition:
+      warn_old_style_definition = value;
+      break;
+
     case OPT_Wold_style_cast:
       warn_old_style_cast = value;
       break;
@@ -839,10 +847,18 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       flag_next_runtime = value;
       break;
 
+    case OPT_fnil_receivers:
+      flag_nil_receivers = value;
+      break;
+
     case OPT_fnonansi_builtins:
       flag_no_nonansi_builtin = !value;
       break;
 
+    case OPT_fobjc_exceptions:
+      flag_objc_exceptions = value;
+      break;
+
     case OPT_foperator_names:
       cpp_opts->operator_names = value;
       break;
@@ -863,6 +879,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       cpp_opts->preprocessed = value;
       break;
 
+    case OPT_freplace_objc_classes:
+      flag_replace_objc_classes = value;
+      break;
+      
     case OPT_frepo:
       flag_use_repository = value;
       if (value)
@@ -907,6 +927,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
       flag_weak = value;
       break;
 
+    case OPT_fzero_link:
+      flag_zero_link = value;
+      break;
+
     case OPT_gen_decls:
       flag_gen_declaration = 1;
       break;
@@ -1036,7 +1060,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
 
 /* Post-switch processing.  */
 bool
-c_common_post_options (const char **pfilename)
+c_common_post_options (const char **pfilename ATTRIBUTE_UNUSED)
 {
   /* Canonicalize the input and output filenames.  */
   if (in_fnames == NULL)
@@ -1128,9 +1152,6 @@ c_common_post_options (const char **pfilename)
   cpp_get_callbacks (parse_in)->file_change = cb_file_change;
   cpp_post_options (parse_in);
 
-  /* NOTE: we use in_fname here, not the one supplied.  */
-  *pfilename = cpp_read_main_file (parse_in, in_fnames[0]);
-
   saved_lineno = input_line;
   input_line = 0;
 
@@ -1197,7 +1218,6 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
 
          /* Reset cpplib's macros and start a new file.  */
          cpp_undef_all (parse_in);
-         cpp_read_main_file (parse_in, in_fnames[file_index]);
        }
 
       finish_options(in_fnames[file_index]);
@@ -1375,7 +1395,7 @@ finish_options (const char *tif)
     {
       size_t i;
 
-      cpp_change_file (parse_in, LC_RENAME, _("<built-in>"));
+      cpp_change_file (parse_in, LC_ENTER, _("<built-in>"));
       cpp_init_builtins (parse_in, flag_hosted);
       c_cpp_builtins (parse_in);
 
@@ -1421,6 +1441,7 @@ finish_options (const char *tif)
 
   include_cursor = 0;
   this_input_filename = tif;
+  cpp_find_main_file (parse_in, this_input_filename);
   push_command_line_include ();
 }
 
@@ -1428,24 +1449,24 @@ finish_options (const char *tif)
 static void
 push_command_line_include (void)
 {
-  if (cpp_opts->preprocessed)
-    return;
-
   while (include_cursor < deferred_count)
     {
       struct deferred_opt *opt = &deferred_opts[include_cursor++];
 
-      if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg))
+      if (! cpp_opts->preprocessed && opt->code == OPT_include
+         && cpp_push_include (parse_in, opt->arg))
        return;
     }
 
   if (include_cursor == deferred_count)
     {
+      include_cursor++;
       /* Restore the line map from <command line>.  */
-      cpp_change_file (parse_in, LC_RENAME, this_input_filename);
+      if (! cpp_opts->preprocessed)
+       cpp_change_file (parse_in, LC_LEAVE, NULL);
       /* -Wunused-macros should only warn about macros defined hereafter.  */
       cpp_opts->warn_unused_macros = warn_unused_macros;
-      include_cursor++;
+      cpp_push_main_file (parse_in);
     }
 }
 
@@ -1459,7 +1480,7 @@ cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED,
   else
     fe_file_change (new_map);
 
-  if (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map))
+  if (new_map == 0 || (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map)))
     push_command_line_include ();
 }