]> gcc.gnu.org Git - gcc.git/commitdiff
New command line option -fconstant-string-class to allow specifying a user defined...
authorOvidiu Predescu <ovidiu@gcc.gnu.org>
Sun, 6 Aug 2000 07:54:40 +0000 (07:54 +0000)
committerOvidiu Predescu <ovidiu@gcc.gnu.org>
Sun, 6 Aug 2000 07:54:40 +0000 (07:54 +0000)
New command line option -fconstant-string-class to allow specifying a
user defined constant string class, different from NXConstantString.

From-SVN: r35518

gcc/objc/objc-act.c

index a96533c728cba17e635a0e48d5f8300d8b4583c2..fd358a981b5b131d6f1f62728629311fcb91dfca 100644 (file)
@@ -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);
 }
 
This page took 0.073045 seconds and 5 git commands to generate.