On Fri, Jul 1, 2011 at 21:35, Gabriel Charette <gch...@google.com> wrote: > As variables are discovered (while parsing the header) they are added to the > varpool and their RTL is built. > > We do not stream, nor the varpool, nor the RTL (and I don't think we want to > + that wouldn't > work with multiple pph).
Right. Additionally, saving RTL makes the PPH target-dependent. We don't want that. > > We want to rebuild the varpool when streaming the global variables of the pph > in so as to > redefine them in the varpool in the same order they would have been found in > a regular > #include style parse. Right. > I'm not sure whether "global variables, not externals" is specific enough or > too broad (I can't reuse the caller > of varpool_finalize_decl (rest_of_decl_compilation) to take care of this > logic because it needs some parser > state which we no longer have). I will create more tests next week with > different orderings for functions, > structs, etc. coming in from the pph. Hm, I think we actually want to call rest_of_decl_compilation here. This is also used from the LTO front end when reconstructing variables. Your patch is in the right direction, though, so I've applied it for now. Diego.