Boost logo

Boost :

From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2006-05-15 21:02:30

Felipe Magno de Almeida wrote:

> > How do you know that '...when preprocessing different
> files. Usually
> > they will
> > > contain the same dependencies...'?
> Dont have to be exactly. I'll explain better what I want.
> If I have three headers: 'a', 'b' and 'c'.
> I want to preprocess 'a' and 'b'.
> depends -> has a include directive
> 'a' depends on 'b' and 'c', and 'b' depends on 'c'.
> If I start preprocessing 'b', I want to cache all the
> analysys I created for 'b' to be used when preprocessing 'a',
> without having to preprocess 'b' all again.
> The same applies for 'c' that is include'd directly in 'a'
> and is used in 'b', so the analysys for it is already made, I
> dont need to preprocess 'c' when preprocessing 'a' *and*
> preprocessing 'b'.

You lost me here, sorry.

> > > This tool should preprocess entire subsets of boost,
> preprocessing
> > > some headers again and again should be really slow.
> > > Pragma once wouldnt help here, since I want to cache a
> preprocessing
> > > that would occur inside preprocessing two different files.
> >
> > IIUC in this case you will even have to switch off Waves
> #pragma once
> > support and the corresponding heuristics because otherwise it won't
> > even open a header file for the second time.
> No, that wouldn't be necessary. I dont care for the case
> where one header will *not* preprocess two times in the same
> translation file. I care *only* when preprocessing two
> different translation files, which I want to cache the
> preprocessing of all headers.

Ok, let's recap. You have:
- file A including file C and
- file B including file C
and you want to get all dependencies for file A and for file B

IIUC you can skip the preprocessing of file C during the analysis of file B
(given you've already analyzed file A) only if the overall preprocessing
context upto the inclusion point of file C will be the same for both file A
and B. IOW you need some kind of precompiled header support.

You can't skip the preprocessing of file C if file A and file B are
different before the inclusion point of C.

I would suggest not to put too much effort into this kind of optimization,
it's too much of a border case. Try starting with a straightforward
implementation analysing everything as it goes.

> > Anyway, it would be really helpful to know, what you're going to do
> > with Wave and how. All I've got so far is that you somehow want to
> > analyze include file dependencies. Sorry if I've missed
> this, but is
> > this project going to build an extention to the current bcp tool?
> I'm doing some research to see if Wave is really useable for
> creating a new bcp tool for handling dependencies more
> accurately. I'm writing yet the proposal for boost, it is
> done, but is *really really* weak, and I'm *very very* late
> in rewriting the proposal with details of the project. There
> are some issues, but in general I cannot see any major issue
> for writing it. This tool should, IMO, be usable for handling
> dependencies for all toolsets, which is impossible if the
> whole environment needs to be available to the tool (e.g.
> system headers).
> Hope you understood what I'm after.

Regards Hartmut

Boost list run by bdawes at, gregod at, cpdaniel at, john at