iains wrote:

> > > > Whether we re-use wrapper code or make some new code is an 
> > > > implementation detail.
> > > > It does not actually prevent you from taking the two-phase approach ( 
> > > > currently , --precompile will be unchanged in action).
> > > 
> > > 
> > > It doesn't prevent the two-phase compilation model indeed. But it 
> > > introduces a new way about how we produce BMIs.
> > 
> > 
> > It allows us to produce a new kind of BMI - that carries a minimised 
> > content, applicable to the interface, otherwise it is no different to the 
> > case where two command lines are needed to produce an object and BMI..
> 
> This is what thin BMI or interface BMI does.

Agreed - but the actual process of producing the interface BMI means taking the 
"full" AST (which is necessary to generate the object) and reducing it by 
applying suitable filters [like in my diagram].

This is done in an instance of the front end - it has either to be provided 
with the full AST or have a multiplexer that puts the full AST to code-gen and 
then applies filtering to the other path.

> > The difficulty that I have pointed out is that if we preserve the existing 
> > scheme but want an Interface BMI - we then have to produce a third compile 
> > line in the driver that takes the Implementation BMI and produces the 
> > Interface BMI from it. We cannot avoid producing the intermediate BMI here 
> > because the jobs are created by the driver and executed by the compiler and 
> > we need to Implementation BMI to produce the object.
> 
> Oh, this may be the root of the divergence here. In my mind, we can make it 
> without producing new compile jobs. I've already looked at the code. We can 
> avoid producing the intermediate BMI by skipping some phases in the drivers.

I still do not understand the point here: the driver is not doing the work; the 
driver is preparing cc1 command lines - skipping phases does not achieve 
anything unless the front end is capable of producing both the BMI and object 
at the same time (any other solution means materialising the full BMI as an 
entity).


https://github.com/llvm/llvm-project/pull/71773
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to