aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOvidiu Predescu <ovidiu@gcc.gnu.org>2000-08-06 07:54:40 +0000
committerOvidiu Predescu <ovidiu@gcc.gnu.org>2000-08-06 07:54:40 +0000
commitfda470306d65092407ba01f9aa85e1941c08eaab (patch)
treeb7cdcf9534e0abd4804ae06417c0a6e1e9575b01 /gcc
parentcf02c6b135843aa2a1ea7e95de7f2c572b7503a8 (diff)
downloadgcc-fda470306d65092407ba01f9aa85e1941c08eaab.zip
gcc-fda470306d65092407ba01f9aa85e1941c08eaab.tar.gz
gcc-fda470306d65092407ba01f9aa85e1941c08eaab.tar.bz2
New command line option -fconstant-string-class to allow specifying a user defined constant string class...
New command line option -fconstant-string-class to allow specifying a user defined constant string class, different from NXConstantString. From-SVN: r35518
Diffstat (limited to 'gcc')
-rw-r--r--gcc/objc/objc-act.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index a96533c..fd358a9 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -374,6 +374,8 @@ static void ggc_mark_hash_table PARAMS ((void *));
#define STRING_OBJECT_CLASS_NAME "NXConstantString"
#define PROTOCOL_OBJECT_CLASS_NAME "Protocol"
+static const char *constant_string_class_name = NULL;
+
static const char *TAG_GETCLASS;
static const char *TAG_GETMETACLASS;
static const char *TAG_MSGSEND;
@@ -797,6 +799,7 @@ lang_decode_option (argc, argv)
char **argv;
{
const char *p = argv[0];
+
if (!strcmp (p, "-lang-objc"))
c_language = clk_objective_c;
else if (!strcmp (p, "-gen-decls"))
@@ -819,6 +822,13 @@ lang_decode_option (argc, argv)
flag_next_runtime = 1;
else if (!strcmp (p, "-print-objc-runtime-info"))
print_struct_values = 1;
+#define CSTSTRCLASS "-fconstant-string-class="
+ else if (!strncmp (p, CSTSTRCLASS, sizeof(CSTSTRCLASS) - 2)) {
+ if (strlen (argv[0]) <= strlen (CSTSTRCLASS))
+ error ("no class name specified as argument to -fconstant-string-class");
+ constant_string_class_name = xstrdup(argv[0] + sizeof(CSTSTRCLASS) - 1);
+ }
+#undef CSTSTRCLASS
else
return c_decode_option (argc, argv);
@@ -1382,7 +1392,10 @@ synth_module_prologue ()
generate_forward_declaration_to_string_table ();
/* Forward declare constant_string_id and constant_string_type. */
- constant_string_id = get_identifier (STRING_OBJECT_CLASS_NAME);
+ if (!constant_string_class_name)
+ constant_string_class_name = STRING_OBJECT_CLASS_NAME;
+
+ constant_string_id = get_identifier (constant_string_class_name);
constant_string_type = xref_tag (RECORD_TYPE, constant_string_id);
}