[arm] Reduce usage of arm_selected_cpu.
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 15 Dec 2016 15:44:01 +0000 (15:44 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Thu, 15 Dec 2016 15:44:01 +0000 (15:44 +0000)
Make more use of the new data structure for initializing existing
variables.

* arm.c (arm_option_override): Use arm_active_target as source of
information for arm_base_arch and arm_arch_name.
* (arm_file_start): Use arm_active_target for core name.

From-SVN: r243700

gcc/ChangeLog
gcc/config/arm/arm.c

index 004d26842f93775cdf40e3211011fc213caf00f0..4202c77b4146a9673c7e8b508e31d3d41a43afcc 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-15  Richard Earnshaw  <rearnsha@arm.com>
+
+       * arm.c (arm_option_override): Use arm_active_target as source of
+       information for arm_base_arch and arm_arch_name.
+       * (arm_file_start): Use arm_active_target for core name.
+
 2016-12-15  Richard Earnshaw  <rearnsha@arm.com>
 
        * arm.c (arm_selected_tune): Delete static variable.
index a4d370c735d19ba57a3f45c15b53306ab8f992b1..3806226c2d52fecc491ccaf32abe175af2709757 100644 (file)
@@ -3276,9 +3276,9 @@ arm_option_override (void)
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif
 
-  sprintf (arm_arch_name, "__ARM_ARCH_%s__", arm_selected_cpu->arch);
+  sprintf (arm_arch_name, "__ARM_ARCH_%s__", arm_active_target.arch_pp_name);
   insn_flags = arm_selected_cpu->flags;
-  arm_base_arch = arm_selected_cpu->base_arch;
+  arm_base_arch = arm_active_target.base_arch;
 
   arm_tune = arm_active_target.tune_core;
   tune_flags = arm_active_target.tune_flags;
@@ -26012,12 +26012,13 @@ arm_file_start (void)
                             arm_active_target.arch_name);
            }
         }
-      else if (strncmp (arm_selected_cpu->name, "generic", 7) == 0)
-       asm_fprintf (asm_out_file, "\t.arch %s\n", arm_selected_cpu->name + 8);
+      else if (strncmp (arm_active_target.core_name, "generic", 7) == 0)
+       asm_fprintf (asm_out_file, "\t.arch %s\n",
+                    arm_active_target.core_name + 8);
       else
        {
          const char* truncated_name
-           = arm_rewrite_selected_cpu (arm_selected_cpu->name);
+           = arm_rewrite_selected_cpu (arm_active_target.core_name);
          asm_fprintf (asm_out_file, "\t.cpu %s\n", truncated_name);
        }