Commit b826515a by Basile Starynkevitch Committed by Basile Starynkevitch

c-opts.c: Include plugin.h.

[gcc/c-family]
2013-11-19  Basile Starynkevitch  <basile@starynkevitch.net>

        * c-opts.c: Include plugin.h.
        (cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE.

[gcc/]
2013-11-19  Basile Starynkevitch  <basile@starynkevitch.net>

        * plugin.def (PLUGIN_INCLUDE_FILE): New event, invoked in 
        cb_file_change.

From-SVN: r205038
parent 8f1d1317
2013-11-19 Basile Starynkevitch <basile@starynkevitch.net>
* plugin.def (PLUGIN_INCLUDE_FILE): New event, invoked in
cb_file_change.
2013-11-19 Peter Bergner <bergner@vnet.ibm.com> 2013-11-19 Peter Bergner <bergner@vnet.ibm.com>
* loop-doloop.c (doloop_optimize_loops): Remove unused * loop-doloop.c (doloop_optimize_loops): Remove unused
2013-11-19 Basile Starynkevitch <basile@starynkevitch.net>
* c-opts.c: Include plugin.h.
(cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE.
2013-11-19 Marek Polacek <polacek@redhat.com> 2013-11-19 Marek Polacek <polacek@redhat.com>
* c-ubsan.c (ubsan_instrument_division): Adjust ubsan_create_data * c-ubsan.c (ubsan_instrument_division): Adjust ubsan_create_data
......
...@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h" /* For debug_hooks. */ #include "debug.h" /* For debug_hooks. */
#include "opts.h" #include "opts.h"
#include "options.h" #include "options.h"
#include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */
#include "mkdeps.h" #include "mkdeps.h"
#include "c-target.h" #include "c-target.h"
#include "tm.h" /* For BYTES_BIG_ENDIAN, #include "tm.h" /* For BYTES_BIG_ENDIAN,
...@@ -1397,6 +1398,17 @@ cb_file_change (cpp_reader * ARG_UNUSED (pfile), ...@@ -1397,6 +1398,17 @@ cb_file_change (cpp_reader * ARG_UNUSED (pfile),
else else
fe_file_change (new_map); fe_file_change (new_map);
if (new_map
&& (new_map->reason == LC_ENTER || new_map->reason == LC_RENAME))
{
/* Signal to plugins that a file is included. This could happen
several times with the same file path, e.g. because of
several '#include' or '#line' directives... */
invoke_plugin_callbacks
(PLUGIN_INCLUDE_FILE,
const_cast<char*> (ORDINARY_MAP_FILE_NAME (new_map)));
}
if (new_map == 0 || (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map))) if (new_map == 0 || (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map)))
{ {
pch_cpp_save_state (); pch_cpp_save_state ();
......
...@@ -92,6 +92,12 @@ DEFEVENT (PLUGIN_EARLY_GIMPLE_PASSES_END) ...@@ -92,6 +92,12 @@ DEFEVENT (PLUGIN_EARLY_GIMPLE_PASSES_END)
/* Called when a pass is first instantiated. */ /* Called when a pass is first instantiated. */
DEFEVENT (PLUGIN_NEW_PASS) DEFEVENT (PLUGIN_NEW_PASS)
/* Called when a file is #include-d or given thru #line directive.
Could happen many times. The event data is the included file path,
as a const char* pointer. */
DEFEVENT (PLUGIN_INCLUDE_FILE)
/* After the hard-coded events above, plugins can dynamically allocate events /* After the hard-coded events above, plugins can dynamically allocate events
at run time. at run time.
PLUGIN_EVENT_FIRST_DYNAMIC only appears as last enum element. */ PLUGIN_EVENT_FIRST_DYNAMIC only appears as last enum element. */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment