[llvm] r183985 - Remove a use of PathV1.h.

Lang Hames lhames at gmail.com
Mon Jun 17 12:48:35 PDT 2013


Hi Rafael,

This broke an internal tester. The eraseFromDisk() method contains some
checks for special files to prevent it from removing anything important.

We really want to keep those checks in place. I'm not familiar with the
path library work - what is the best way to resolve this? Should this be
reverted, or can the checks be added to sys::fs::remove?

Cheers,
Lang.


On Fri, Jun 14, 2013 at 9:20 AM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:

> Author: rafael
> Date: Fri Jun 14 11:20:18 2013
> New Revision: 183985
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183985&view=rev
> Log:
> Remove a use of PathV1.h.
>
> Modified:
>     llvm/trunk/lib/Support/ToolOutputFile.cpp
>
> Modified: llvm/trunk/lib/Support/ToolOutputFile.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ToolOutputFile.cpp?rev=183985&r1=183984&r2=183985&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/ToolOutputFile.cpp (original)
> +++ llvm/trunk/lib/Support/ToolOutputFile.cpp Fri Jun 14 11:20:18 2013
> @@ -12,7 +12,7 @@
>
>  //===----------------------------------------------------------------------===//
>
>  #include "llvm/Support/ToolOutputFile.h"
> -#include "llvm/Support/PathV1.h"
> +#include "llvm/Support/FileSystem.h"
>  #include "llvm/Support/Signals.h"
>  using namespace llvm;
>
> @@ -25,8 +25,10 @@ tool_output_file::CleanupInstaller::Clea
>
>  tool_output_file::CleanupInstaller::~CleanupInstaller() {
>    // Delete the file if the client hasn't told us not to.
> -  if (!Keep && Filename != "-")
> -    sys::Path(Filename).eraseFromDisk();
> +  if (!Keep && Filename != "-") {
> +    bool Existed;
> +    sys::fs::remove(Filename, Existed);
> +  }
>
>    // Ok, the file is successfully written and closed, or deleted. There's
> no
>    // further need to clean it up on signals.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130617/6fe016ac/attachment.html>


More information about the llvm-commits mailing list