+2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Remove la_case_sensitivity
+ 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.
+ * f-lang.c (f_language_data): Likewise.
+ (f_language::case_sensitivity): New member function.
+ * go-lang.c (go_language_data): Remove la_case_sensitivity
+ initializer.
+ * language.c (enum case_mode): Moved here from language.h.
+ (case_mode): Make static.
+ (show_case_command): Update for case_sensitivity being a method.
+ (set_case_command): Likewise.
+ (set_range_case): Likewise.
+ (unknown_language_data): Remove la_case_sensitivity initializer.
+ (auto_language_data): Likewise.
+ * language.h (case_mode): Delete, move enum declaration to
+ language.c.
+ (language_data): Delete la_case_sensitivity field.
+ (language_defn::case_sensitivity): New member function.
+ * m2-lang.c (m2_language_data): Remove la_case_sensitivity
+ 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_range_check
extern const struct language_data ada_language_data =
{
- case_sensitive_on, /* Yes, Ada is case-insensitive, but
- that's not quite what this means. */
array_row_major,
macro_expansion_no,
&ada_exp_descriptor,
extern const struct language_data c_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
extern const struct language_data cplus_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
extern const struct language_data asm_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
extern const struct language_data minimal_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
extern const struct language_data d_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_c,
extern const struct language_data f_language_data =
{
- case_sensitive_off,
array_column_major,
macro_expansion_no,
&exp_descriptor_f,
bool range_checking_on_by_default () const override
{ return true; }
+ /* See language.h. */
+
+ enum case_sensitivity case_sensitivity () const override
+ { return case_sensitive_off; }
+
protected:
/* See language.h. */
extern const struct language_data go_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_c,
range_mode_auto, range_mode_manual
};
+/* case_mode ==
+ case_mode_auto: case_sensitivity set upon selection of scope.
+ case_mode_manual: case_sensitivity set only by user. */
+
+enum case_mode
+ {
+ case_mode_auto, case_mode_manual
+ };
+
/* The current (default at startup) state of type and range checking.
(If the modes are set to "auto", though, these are changed based
on the default language at startup, and then again based on the
static enum range_mode range_mode = range_mode_auto;
enum range_check range_check = range_check_off;
-enum case_mode case_mode = case_mode_auto;
+static enum case_mode case_mode = case_mode_auto;
enum case_sensitivity case_sensitivity = case_sensitive_on;
/* The current language and language_mode (see language.h). */
_("Case sensitivity in name search is \"%s\".\n"),
value);
- if (case_sensitivity != current_language->la_case_sensitivity)
+ if (case_sensitivity != current_language->case_sensitivity ())
warning (_("the current case sensitivity setting does not match "
"the language.\n"));
}
case_sensitive);
}
- if (case_sensitivity != current_language->la_case_sensitivity)
+ if (case_sensitivity != current_language->case_sensitivity ())
warning (_("the current case sensitivity setting does not match "
"the language.\n"));
}
? range_check_on : range_check_off);
if (case_mode == case_mode_auto)
- case_sensitivity = current_language->la_case_sensitivity;
+ case_sensitivity = current_language->case_sensitivity ();
}
/* Set current language to (enum language) LANG. Returns previous
extern const struct language_data unknown_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
extern const struct language_data auto_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
}
range_check;
-/* case_mode ==
- case_mode_auto: case_sensitivity set upon selection of scope.
- case_mode_manual: case_sensitivity set only by user. */
-
-extern enum case_mode
- {
- case_mode_auto, case_mode_manual
- }
-case_mode;
-
/* array_ordering ==
array_row_major: Arrays are in row major order.
array_column_major: Arrays are in column major order. */
struct language_data
{
- /* Default case sensitivity. */
- enum case_sensitivity la_case_sensitivity;
-
/* Multi-dimensional array ordering. */
enum array_ordering la_array_ordering;
virtual bool range_checking_on_by_default () const
{ return false; }
+ /* Is this language case sensitive? The return value from this function
+ provides the automativ setting for 'set case-sensitive', as a
+ consequence, a user is free to override this setting if they want. */
+
+ virtual enum case_sensitivity case_sensitivity () const
+ { return case_sensitive_on; }
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
extern const struct language_data m2_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_modula2,
extern const struct language_data objc_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_standard,
/* Constant data representing the OpenCL language. */
extern const struct language_data opencl_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_c,
&exp_descriptor_opencl,
extern const struct language_data pascal_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_standard,
extern const struct language_data rust_language_data =
{
- case_sensitive_on,
array_row_major,
macro_expansion_no,
&exp_descriptor_rust,