summaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorovidiu <ovidiu@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-06 07:54:40 +0000
committerovidiu <ovidiu@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-06 07:54:40 +0000
commit4411d0ab78ac0a93df1db025cd7f15eac2659534 (patch)
treeb7cdcf9534e0abd4804ae06417c0a6e1e9575b01 /gcc/objc
parent102b61ca753f4b4357468f4b9cc309f59a1b7126 (diff)
downloadgcc-4411d0ab78ac0a93df1db025cd7f15eac2659534.tar.gz
New command line option -fconstant-string-class to allow specifying a
user defined constant string class, different from NXConstantString. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-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 a96533c728c..fd358a981b5 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);
}