ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
[gcc.git] / gcc / plugin.c
index b269dfa3971a72d3758bbd85a553c56386e7cedf..8debc09cada18a08f961f633851a8c394f163807 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for GCC plugin mechanism.
-   Copyright (C) 2009-2013 Free Software Foundation, Inc.
+   Copyright (C) 2009-2014 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -80,7 +80,7 @@ event_hasher::equal (const value_type *s1, const compare_type *s2)
 
 /* A hash table to map event names to the position of the names in the
    plugin_event_name table.  */
-static hash_table <event_hasher> event_tab;
+static hash_table<event_hasher> *event_tab;
 
 /* Keep track of the limit of allocated events and space ready for
    allocating events.  */
@@ -241,16 +241,13 @@ parse_plugin_arg_opt (const char *arg)
         }
       else if (*ptr == '=')
         {
-          if (key_parsed)
-            {
-              error ("malformed option -fplugin-arg-%s (multiple '=' signs)",
-                    arg);
-              return;
-            }
-          key_len = len;
-          len = 0;
-          value_start = ptr + 1;
-          key_parsed = true;
+         if (!key_parsed) 
+           {
+             key_len = len;
+             len = 0;
+             value_start = ptr + 1;
+             key_parsed = true;
+           }
           continue;
         }
       else
@@ -348,19 +345,19 @@ get_named_event_id (const char *name, enum insert_option insert)
 {
   const char ***slot;
 
-  if (!event_tab.is_created ())
+  if (!event_tab)
     {
       int i;
 
-      event_tab.create (150);
+      event_tab = new hash_table<event_hasher> (150);
       for (i = 0; i < event_last; i++)
        {
-         slot = event_tab.find_slot (&plugin_event_name[i], INSERT);
+         slot = event_tab->find_slot (&plugin_event_name[i], INSERT);
          gcc_assert (*slot == HTAB_EMPTY_ENTRY);
          *slot = &plugin_event_name[i];
        }
     }
-  slot = event_tab.find_slot (&name, insert);
+  slot = event_tab->find_slot (&name, insert);
   if (slot == NULL)
     return -1;
   if (*slot != HTAB_EMPTY_ENTRY)
@@ -386,7 +383,8 @@ get_named_event_id (const char *name, enum insert_option insert)
                                         plugin_callbacks, event_horizon);
        }
       /* All the pointers in the hash table will need to be updated.  */
-      event_tab.dispose ();
+      delete event_tab;
+      event_tab = NULL;
     }
   else
     *slot = &plugin_event_name[event_last];
@@ -455,6 +453,7 @@ register_callback (const char *plugin_name,
       case PLUGIN_EARLY_GIMPLE_PASSES_START:
       case PLUGIN_EARLY_GIMPLE_PASSES_END:
       case PLUGIN_NEW_PASS:
+      case PLUGIN_INCLUDE_FILE:
         {
           struct callback_info *new_callback;
           if (!callback)
@@ -532,6 +531,7 @@ invoke_plugin_callbacks_full (int event, void *gcc_data)
       case PLUGIN_EARLY_GIMPLE_PASSES_START:
       case PLUGIN_EARLY_GIMPLE_PASSES_END:
       case PLUGIN_NEW_PASS:
+      case PLUGIN_INCLUDE_FILE:
         {
           /* Iterate over every callback registered with this event and
              call it.  */
@@ -806,7 +806,7 @@ dump_active_plugins (FILE *file)
        for (ci = plugin_callbacks[event]; ci; ci = ci->next)
          fprintf (file, " %s", ci->plugin_name);
 
-       putc('\n', file);
+       putc ('\n', file);
       }
 }