malaperle added a comment.

I'm not sure it's better to use the InclusionDirective callback for this. We 
need to get the includes in two places: in the preamble and non-preamble. In 
the preamble we use the callback, have to store some temporary stuff because we 
don't have a SourceManager in InclusionDirective, then in finish we use the 
SourceManager to convert everything. In the non-preamble, we cannot use the 
callback so we use the SourceManager to go through the includes. Therefore, we 
have to maintain two different ways of getting the inclusion map. Without using 
the InclusionDirective callback, we use the SourceManager in both cases and can 
use the same code to iterate through inclusions, just on two different 
SourceManagers at different moments. We also don't need to make another patch 
to modify the PreambleCallbacks. I also double this is much slower but I think 
this simplifies the code nicely.
What do you think?


https://reviews.llvm.org/D38639



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to