dstenb added inline comments.

================
Comment at: lib/Tooling/CompilationDatabase.cpp:303
+  // Remove temp files.
+  Compilation->CleanupFileList(Compilation->getTempFiles());
+
----------------
erichkeane wrote:
> It seems to me that this would be best called from the destructor of the 
> Compilation object.  I realize nothing returns before this, but IMO this 
> seems universal enough that if it doesn't break anything, putting this in the 
> destructor would be a proper place for cleanup.
That sounds cleaner (if it's viable).

I considered that initially, but I was not sure that there are no cases where 
the temporary files outlive a Compilation object, and the "/// Temporary files 
which should be removed on exit." comment for the TempFiles field did not 
really make me more confident, so I went the conservative route instead.

I'll do that change and run some tests to see where that leads.



Repository:
  rC Clang

https://reviews.llvm.org/D45686



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

Reply via email to