/* 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.
/* 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. */
}
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
{
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)
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];
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)
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. */
for (ci = plugin_callbacks[event]; ci; ci = ci->next)
fprintf (file, " %s", ci->plugin_name);
- putc('\n', file);
+ putc ('\n', file);
}
}