[PATCH] Some infrastructure work for virtual file system (now on phab)

Rafael Espíndola rafael.espindola at gmail.com
Wed Feb 12 14:32:46 PST 2014


>> Why is the reference count necessary? Given its nature I would expect the FS to outlive the file manger, in which case the FileManager could have just a pointer to the FileSystem.
>
>
> The FS is likely to get shared among a number of FileManagers in different compiler instances within a thread. Yes, we could try to establish and maintain relationships among these, but it’s simpler and costs us effectively nothing to make this ref-counted.

It costs simplicity in understanding the code. If there is a complex
logic as to when a FS needs to be created, I can understand that a
reference count might be semantically the simplest option.

But is it not the case that
* A clang process will always use a single FS.
* The decision as to which to use can happen just after parsing the
command line arguments?

Cheers,
Rafael




More information about the cfe-commits mailing list