[llvm] r327851 - Changed createTemporaryFile without FD to actually create a file.

Ilya Biryukov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 03:21:38 PDT 2018


Hi Rafael,

Good point.
There's only one usage in clang's ToolingTest.cpp:
https://reviews.llvm.org/source/clang/browse/cfe/trunk/unittests/Tooling/ToolingTest.cpp;327962$322
.
And it should be easy to remove it. Will come up with a change that removes
those functions, we shouldn't need them.


On Mon, Mar 19, 2018 at 10:16 PM Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Ilya Biryukov via llvm-commits <llvm-commits at lists.llvm.org> writes:
>
> > +/// @brief Get a unique name, not currently exisiting in the
> filesystem. Subject
> > +/// to race conditions, prefer to use createUniqueFile instead.
> > +///
> > +/// Similar to createUniqueFile, but instead of creating a file only
> > +/// checks if it exists. This function is subject to race conditions,
> if you
> > +/// want to use the returned name to actually create a file, use
> > +/// createUniqueFile instead.
> > +std::error_code getPotentiallyUniqueFileName(const Twine &Model,
> > +                                             SmallVectorImpl<char>
> &ResultPath);
> > +
> > +/// @brief Get a unique temporary file name, not currently exisiting in
> the
> > +/// filesystem. Subject to race conditions, prefer to use
> createTemporaryFile
> > +/// instead.
> > +///
> > +/// Similar to createTemporaryFile, but instead of creating a file only
> > +/// checks if it exists. This function is subject to race conditions,
> if you
> > +/// want to use the returned name to actually create a file, use
> > +/// createTemporaryFile instead.
> > +std::error_code
> > +getPotentiallyUniqueTempFileName(const Twine &Prefix, StringRef Suffix,
> > +                                 SmallVectorImpl<char> &ResultPath);
> > +
>
> Do we have any use for these?
>
> Cheers,
> Rafael
>


-- 
Regards,
Ilya Biryukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180320/35f7f509/attachment.html>


More information about the llvm-commits mailing list