gdb: Convert language_data::la_array_ordering to a method
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 12 Jul 2020 15:00:06 +0000 (16:00 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 16 Sep 2020 10:04:03 +0000 (11:04 +0100)
Convert language_data::la_array_ordering member variable to a virtual
method language_defn::array_ordering.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-lang.c (ada_language_data): Remove la_array_ordering
initializer.
* c-lang.c (c_language_data): Likewise.
(cplus_language_data): Likewise.
(asm_language_data): Likewise.
(minimal_language_data): Likewise.
* d-lang.c (d_language_data): Likewise.
* dwarf2/read.c (read_array_order): Update for call to
array_ordering.
* f-lang.c (f_language_data): Remove la_array_ordering
initializer.
(f_language::array_ordering): New member function.
* go-lang.c (go_language_data): Remove la_array_ordering
initializer.
* language.c (unknown_language_data): Likewise.
(auto_language_data): Likewise.
* language.h (language_data): Delete la_array_ordering field.
(language_defn::array_ordering): New member function.
* m2-lang.c (m2_language_data): Remove la_array_ordering
initializer.
* objc-lang.c (objc_language_data): Likewise.
* opencl-lang.c (opencl_language_data): Likewise.
* p-lang.c (pascal_language_data): Likewise.
* rust-lang.c (rust_language_data): Likewise.

14 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/c-lang.c
gdb/d-lang.c
gdb/dwarf2/read.c
gdb/f-lang.c
gdb/go-lang.c
gdb/language.c
gdb/language.h
gdb/m2-lang.c
gdb/objc-lang.c
gdb/opencl-lang.c
gdb/p-lang.c
gdb/rust-lang.c

index 134010d4ac53fa4dd90694416f0fff8cab49cd9c..d8988e41dd425c9deeb44e8c31e32bebb40fe5b6 100644 (file)
@@ -1,3 +1,30 @@
+2020-09-16  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * ada-lang.c (ada_language_data): Remove la_array_ordering
+       initializer.
+       * c-lang.c (c_language_data): Likewise.
+       (cplus_language_data): Likewise.
+       (asm_language_data): Likewise.
+       (minimal_language_data): Likewise.
+       * d-lang.c (d_language_data): Likewise.
+       * dwarf2/read.c (read_array_order): Update for call to
+       array_ordering.
+       * f-lang.c (f_language_data): Remove la_array_ordering
+       initializer.
+       (f_language::array_ordering): New member function.
+       * go-lang.c (go_language_data): Remove la_array_ordering
+       initializer.
+       * language.c (unknown_language_data): Likewise.
+       (auto_language_data): Likewise.
+       * language.h (language_data): Delete la_array_ordering field.
+       (language_defn::array_ordering): New member function.
+       * m2-lang.c (m2_language_data): Remove la_array_ordering
+       initializer.
+       * objc-lang.c (objc_language_data): Likewise.
+       * opencl-lang.c (opencl_language_data): Likewise.
+       * p-lang.c (pascal_language_data): Likewise.
+       * rust-lang.c (rust_language_data): Likewise.
+
 2020-09-16  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * ada-lang.c (ada_language_data): Remove la_case_sensitivity
index bb850c16055865c8f592e9c18f371f0c7af403a6..9d020d72ac84c532c0c62bdc44c227de37f7c3ff 100644 (file)
@@ -13708,7 +13708,6 @@ ada_get_symbol_name_matcher (const lookup_name_info &lookup_name)
 
 extern const struct language_data ada_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &ada_exp_descriptor,
   ada_op_print_tab,             /* expression operators for printing */
index c1aa02fb67fed76d8d541ef328465b5a483704e1..e752e50a68fa115c33046ffb10be565b2fa50dd6 100644 (file)
@@ -875,7 +875,6 @@ const struct exp_descriptor exp_descriptor_c =
 
 extern const struct language_data c_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_c,
   c_op_print_tab,              /* expression operators for printing */
@@ -983,7 +982,6 @@ enum cplus_primitive_types {
 
 extern const struct language_data cplus_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_c,
   c_op_print_tab,              /* expression operators for printing */
@@ -1189,7 +1187,6 @@ static cplus_language cplus_language_defn;
 
 extern const struct language_data asm_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_c,
   c_op_print_tab,              /* expression operators for printing */
@@ -1258,7 +1255,6 @@ static asm_language asm_language_defn;
 
 extern const struct language_data minimal_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_c,
   c_op_print_tab,              /* expression operators for printing */
index 176593f276d32234866786cabe23375380da3a19..435d77147780ba07655537b92178c6780861e94b 100644 (file)
@@ -128,7 +128,6 @@ enum d_primitive_types {
 
 extern const struct language_data d_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_c,
   d_op_print_tab,              /* Expression operators for printing.  */
index d0398ef914f3a04e88022a9744d00e482f828c32..33292b6ce22493171cbeb4581450617059fbd4a8 100644 (file)
@@ -16883,7 +16883,7 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu)
       return DW_ORD_row_major;
     }
 
-  switch (cu->language_defn->la_array_ordering)
+  switch (cu->language_defn->array_ordering ())
     {
     case array_column_major:
       return DW_ORD_col_major;
index a938d2b8b4c84d15eca33fec6bcaed29ba0ce79f..67e4e8990d7e6119877f9397a5392822a9c230b6 100644 (file)
@@ -486,7 +486,6 @@ static const struct exp_descriptor exp_descriptor_f =
 
 extern const struct language_data f_language_data =
 {
-  array_column_major,
   macro_expansion_no,
   &exp_descriptor_f,
   f_op_print_tab,              /* expression operators for printing */
@@ -730,6 +729,11 @@ public:
   enum case_sensitivity case_sensitivity () const override
   { return case_sensitive_off; }
 
+  /* See language.h.  */
+
+  enum array_ordering array_ordering () const override
+  { return array_column_major; }
+
 protected:
 
   /* See language.h.  */
index 7ac7e9455fa0427bab41d0ef8c9dbbd984ecfbe0..ceda7aff89c96b7ede5be30b74e915828460c80f 100644 (file)
@@ -508,7 +508,6 @@ enum go_primitive_types {
 
 extern const struct language_data go_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_c,
   go_op_print_tab,             /* Expression operators for printing.  */
index 41fdf357f1a1b4bbc0584c4b1345a24e8eae6215..507c51a6fee40619479e4a1dd497c982bdf9c7eb 100644 (file)
@@ -798,7 +798,6 @@ unknown_language_arch_info (struct gdbarch *gdbarch,
 
 extern const struct language_data unknown_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_standard,
   unk_op_print_tab,            /* expression operators for printing */
@@ -933,7 +932,6 @@ static unknown_language unknown_language_defn;
 
 extern const struct language_data auto_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_standard,
   unk_op_print_tab,            /* expression operators for printing */
index b6d1d15c23f41bc7626b81b535fb96d69bb9311f..5ec5daa4aef52c5c3b5e958339768359fea66b42 100644 (file)
@@ -168,9 +168,6 @@ extern const char *default_word_break_characters (void);
 
 struct language_data
   {
-    /* Multi-dimensional array ordering.  */
-    enum array_ordering la_array_ordering;
-
     /* Style of macro expansion, if any, supported by this language.  */
     enum macro_expansion la_macro_expansion;
 
@@ -559,6 +556,12 @@ struct language_defn : language_data
   virtual enum case_sensitivity case_sensitivity () const
   { return case_sensitive_on; }
 
+
+  /* Multi-dimensional array ordering.  */
+
+  virtual enum array_ordering array_ordering () const
+  { return array_row_major; }
+
 protected:
 
   /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
index 94fa01243b34e3f0d071709e48355b8015dc8262..b587242e07bbeafffca7695beefcebf1179289b6 100644 (file)
@@ -199,7 +199,6 @@ const struct exp_descriptor exp_descriptor_modula2 =
 
 extern const struct language_data m2_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_modula2,
   m2_op_print_tab,             /* expression operators for printing */
index 45936c9caec93b0f747c6a2e883b60241111720a..60e0eaddbf4422de4bd08167ee5725578ef31d5a 100644 (file)
@@ -323,7 +323,6 @@ static const struct op_print objc_op_print_tab[] =
 
 extern const struct language_data objc_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_standard,
   objc_op_print_tab,           /* Expression operators for printing */
index 2a184fd3858b53eea60c56caf37b177ac19bf04e..dffdae472f15fc4d02ab45878ce4759def3d4457 100644 (file)
@@ -1006,7 +1006,6 @@ const struct exp_descriptor exp_descriptor_opencl =
 /* Constant data representing the OpenCL language.  */
 extern const struct language_data opencl_language_data =
 {
-  array_row_major,
   macro_expansion_c,
   &exp_descriptor_opencl,
   c_op_print_tab,              /* expression operators for printing */
index fcc0eb90f5c75c34000cd86a6bf7579b6f724b19..d1e6e69cb04a0cf01771803dad04bde147664f23 100644 (file)
@@ -252,7 +252,6 @@ enum pascal_primitive_types {
 
 extern const struct language_data pascal_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_standard,
   pascal_op_print_tab,         /* expression operators for printing */
index 7b76e27f84cad86b82114a0e60e910a8252d9b36..fb248cdc4d3b53543df81a27755f1ac77e193683 100644 (file)
@@ -1901,7 +1901,6 @@ static const struct exp_descriptor exp_descriptor_rust =
 
 extern const struct language_data rust_language_data =
 {
-  array_row_major,
   macro_expansion_no,
   &exp_descriptor_rust,
   c_op_print_tab,              /* expression operators for printing */