[PATCH] D38639: [clangd] #include statements support for Open definition

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 8 03:30:54 PST 2017


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdUnit.cpp:38
 
+class DelegatingPPCallbacks : public PPCallbacks {
+
----------------
Nebiroth wrote:
> ilya-biryukov wrote:
> > What's the purpose of this class?
> We need to be able to use a wrapper class to be able to make a unique_ptr to be sent to PrecompiledPreamble::Build in order to add the list of preprocessor Callbacks.
Could we implement an instance of `PPCallbacks` that contains  `CppFilePreambleCallbacks` and forwards to that specific method instead?

The reason is that we're not really delegating other methods in this calls(nor should we, the implementation would be too compilcated).
Having a class that contains `CppFilePreambleCallbacks &Collector` and calling `Collector.InclusionDirective` seems perfectly fine, though: its purpose is clear and the implementation is easy.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D38639





More information about the cfe-commits mailing list