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-out.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-out.c')
-rw-r--r-- | gcc/lto-streamer-out.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index c14b3a98df6..4d88f62d091 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -172,15 +172,21 @@ lto_output_location_bitpack (struct bitpack_d *bp, /* Emit location LOC to output block OB. - When bitpack is handy, it is more space effecient to call + If the output_location streamer hook exists, call it. + Otherwise, when bitpack is handy, it is more space efficient to call lto_output_location_bitpack with existing bitpack. */ void lto_output_location (struct output_block *ob, location_t loc) { - struct bitpack_d bp = bitpack_create (ob->main_stream); - lto_output_location_bitpack (&bp, ob, loc); - streamer_write_bitpack (&bp); + if (streamer_hooks.output_location) + streamer_hooks.output_location (ob, loc); + else + { + struct bitpack_d bp = bitpack_create (ob->main_stream); + lto_output_location_bitpack (&bp, ob, loc); + streamer_write_bitpack (&bp); + } } |