diff options
author | Gabriel Charette <gchare@google.com> | 2011-10-13 15:40:29 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2011-10-13 15:40:29 +0000 |
commit | d3734943e0e6369f55e34120bedd13a00c22db9f (patch) | |
tree | 85421770432a8e88feb71769de2ba639ea6ac0c5 /gcc/lto-streamer-out.c | |
parent | 2c1b137dc218bcba915614cfb12b03552fa534e3 (diff) |
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: https://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); + } } |