[PATCH] D41594: Support `ivfsoverlay` option in Tooling

Vladimir Plyashkun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 28 02:29:43 PST 2017

vladimir.plyashkun added inline comments.

Comment at: lib/Tooling/Tooling.cpp:287
+  if (Files->getVirtualFileSystem() != VirtualFileSystem) {
+    Files = new FileManager(Invocation->getFileSystemOpts(), VirtualFileSystem);
+  }
ilya-biryukov wrote:
> `Files` is a raw pointer, so we're leaking memory here.
I can try to replace type of this field to `llvm::IntrusiveRefCntPtr<T>`  instead of raw pointer.
But if i understand correctly, this class is available during whole execution, so memory will be freed on exit. 
I saw some other usages, for example, `createFileManager` method in the `CompilerInstance` also just reassign value to raw pointer.

  rC Clang


More information about the cfe-commits mailing list