diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-13 15:40:29 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-13 15:40:29 +0000 |
commit | c59bc102442d6b5d31c35d6c38ebcde244d3b380 (patch) | |
tree | 85421770432a8e88feb71769de2ba639ea6ac0c5 /gcc/lto-streamer-in.c | |
parent | 09c8d52c5b60cdd5656c16d00fe31bb1d789cfd3 (diff) | |
download | gcc-c59bc102442d6b5d31c35d6c38ebcde244d3b380.tar.gz |
2011-10-12 Gabriel Charette <gchare@google.com>
Diego Novillo <dnovillo@google.com>
* streamer-hooks.h (struct streamer_hooks): Add hooks
input_location and output_location.
* lto-streamer-in.c (lto_input_location): Use
streamer_hooks.input_location, if set.
* lto-streamer-out.c (lto_output_location): Use
streamer_hooks.output_location, if set.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179927 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r-- | gcc/lto-streamer-in.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index d4e80c79573..f18b944ef95 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see #include "lto-streamer.h" #include "tree-streamer.h" #include "tree-pass.h" +#include "streamer-hooks.h" /* The table to hold the file names. */ static htab_t file_name_hash_table; @@ -180,15 +181,23 @@ lto_input_location_bitpack (struct data_in *data_in, struct bitpack_d *bp) } -/* Read a location from input block IB. */ +/* Read a location from input block IB. + If the input_location streamer hook exists, call it. + Otherwise, proceed with reading the location from the + expanded location bitpack. */ location_t lto_input_location (struct lto_input_block *ib, struct data_in *data_in) { - struct bitpack_d bp; + if (streamer_hooks.input_location) + return streamer_hooks.input_location (ib, data_in); + else + { + struct bitpack_d bp; - bp = streamer_read_bitpack (ib); - return lto_input_location_bitpack (data_in, &bp); + bp = streamer_read_bitpack (ib); + return lto_input_location_bitpack (data_in, &bp); + } } |