[clang] [llvm] [mlir] [polly] [llvm] Forward declare VirtualFileSystem (PR #211761)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 06:28:59 PDT 2026


vgvassilev wrote:

> > @compnerd, @Steelskin: This uncovers an annoying limitation where repeating forward declarations will need to be annotated and there is no easy way how to centralize them in a single place because of the different usage patterns. If we merge this as a way to handle repetitive patterns we will grow a jungle of fwd.h files -- is that optimal?
> 
> @vgvassilev It's not so much the forward declaration that is moved to its header, it's the addition of the template instantiation for `IntrusiveRefCntPtrInfo<::llvm::vfs::FileSystem>`. Note that it is not required to use this header everywhere, I merely thought it was cleaner to do so. I can revert probably 90% of these headers if you'd prefer.
> 
> Note that this is what the `IntrusiveRefCntPtr` documentation recommends:
> 
> https://github.com/llvm/llvm-project/blob/697f0f3b20d371d9e417891d9cdfb6a3613d7828/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h#L157

I do not have a strong opinion -- just wanted to raise a concern about creating potential precedent.

https://github.com/llvm/llvm-project/pull/211761


More information about the cfe-commits mailing list