History log of /llvm-project/llvm/lib/Support/Path.cpp (Results 76 – 100 of 208)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3
# 20569e96 05-Dec-2017 Rafael Espindola <rafael.espindola@gmail.com>

Delete temp file if rename fails.

Without this when lld failed to replace the output file it would leave
the temporary behind. The problem is that the existing logic is

- cancel the delete flag
- r

Delete temp file if rename fails.

Without this when lld failed to replace the output file it would leave
the temporary behind. The problem is that the existing logic is

- cancel the delete flag
- rename

We have to cancel first to avoid renaming and then crashing and
deleting the old version. What is missing then is deleting the
temporary file if the rename fails.

This can be an issue on both unix and windows, but I am not sure how
to cause the rename to fail reliably on unix. I think it can be done
on ZFS since it has an ACL system similar to what windows uses, but
adding support for checking that in llvm-lit is probably not worth it.

llvm-svn: 319786

show more ...


Revision tags: llvmorg-5.0.1-rc2
# 3ecd2043 28-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Use FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.

We won't see the temp file no more.

llvm-svn: 319137


# 2c4e920f 28-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Move code. NFC.

This moves the TempFile implementation so that it can use system
specific code.

llvm-svn: 319134


# d19c2e81 27-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Add OpenFlags to the create(Unique|Temporary)File interfaces.

This will allow a future F_Delete flag to be specified when we want
the file to be automatically deleted on close.

llvm-svn: 319117


# fe161b9d 22-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Allow TempFile::discard to be called twice.

We already allowed keep+discard. It is important to be able to discard
a temporary if a rename fail. It is also convenient as it allows the
use of RAII fo

Allow TempFile::discard to be called twice.

We already allowed keep+discard. It is important to be able to discard
a temporary if a rename fail. It is also convenient as it allows the
use of RAII for discarding.

Allow discarding twice for similar reasons.

llvm-svn: 318867

show more ...


# b60bb690 16-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Convert another use of createUniqueFile to TempFile::create.

This one requires a new small feature in TempFile: the ability to keep
the temporary file with the temporary name.

llvm-svn: 318458


# a17fca06 15-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Use TempFile in lto caching.

This requires a small change to TempFile: allowing a discard after a
failed keep.

With this the cache now handles signals and reuses a fd instead of
reopening the file.

Use TempFile in lto caching.

This requires a small change to TempFile: allowing a discard after a
failed keep.

With this the cache now handles signals and reuses a fd instead of
reopening the file.

llvm-svn: 318322

show more ...


# e4115196 14-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Add a move assignment operator to TempFile. NFC.

llvm-svn: 318122


# 58fe67a9 13-Nov-2017 Rafael Espindola <rafael.espindola@gmail.com>

Create a TempFile class.

This just adds a TempFile class and replaces the use in
FileOutputBuffer with it.

The only difference for now is better error handling. Followup work includes:

- Convert o

Create a TempFile class.

This just adds a TempFile class and replaces the use in
FileOutputBuffer with it.

The only difference for now is better error handling. Followup work includes:

- Convert other user of temporary files to it.
- Add support for automatically deleting on windows.
- Add a createUnnamed method that returns a potentially unnamed
file. It would be actually unnamed on modern linux and have a
unknown name on windows.

llvm-svn: 318069

show more ...


Revision tags: llvmorg-5.0.1-rc1
# 0dfdb447 10-Oct-2017 Peter Collingbourne <peter@pcc.me.uk>

Support: Have directory_iterator::status() return FindFirstFileEx/FindNextFile results on Windows.

This allows clients to avoid an unnecessary fs::status() call on each
directory entry. Because the

Support: Have directory_iterator::status() return FindFirstFileEx/FindNextFile results on Windows.

This allows clients to avoid an unnecessary fs::status() call on each
directory entry. Because the information returned by FindFirstFileEx
is a subset of the information returned by a regular status() call,
I needed to extract a base class from file_status that contains only
that information.

On my machine, this reduces the time required to enumerate a ThinLTO
cache directory containing 520k files from almost 4 minutes to less
than 2 seconds.

Differential Revision: https://reviews.llvm.org/D38716

llvm-svn: 315378

show more ...


Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2
# 324d96b8 09-Aug-2017 Benjamin Kramer <benny.kra@googlemail.com>

[Path] Sink predicate computations to their uses. NFCI.

llvm-svn: 310531


Revision tags: llvmorg-5.0.0-rc1
# ae5c5df8 17-Jul-2017 NAKAMURA Takumi <geek4civic@gmail.com>

Support/Path.cpp: Prune unused "llvm/BinaryFormat".

llvm-svn: 308160


Revision tags: llvmorg-4.0.1, llvmorg-4.0.1-rc3
# 264b5d9e 07-Jun-2017 Zachary Turner <zturner@google.com>

Move Object format code to lib/BinaryFormat.

This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various type

Move Object format code to lib/BinaryFormat.

This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

Differential Revision: https://reviews.llvm.org/D33843

llvm-svn: 304864

show more ...


Revision tags: llvmorg-4.0.1-rc2
# fb9476ee 23-May-2017 Galina Kistanova <gkistanova@gmail.com>

Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.

llvm-svn: 303595


Revision tags: llvmorg-4.0.1-rc1
# 82a0c97b 20-Mar-2017 Zachary Turner <zturner@google.com>

Add a function to MD5 a file's contents.

In doing so, clean up the MD5 interface a little. Most
existing users only care about the lower 8 bytes of an MD5,
but for some users that care about the up

Add a function to MD5 a file's contents.

In doing so, clean up the MD5 interface a little. Most
existing users only care about the lower 8 bytes of an MD5,
but for some users that care about the upper and lower,
there wasn't a good interface. Furthermore, consumers
of the MD5 checksum were required to handle endianness
details on their own, so it seems reasonable to abstract
this into a nicer interface that just gives you the right
value.

Differential Revision: https://reviews.llvm.org/D31105

llvm-svn: 298322

show more ...


# 5c5091fc 16-Mar-2017 Zachary Turner <zturner@google.com>

[Support] Support both Windows and Posix paths on both platforms.

Previously which path syntax we supported dependend on what
platform we were compiling LLVM on. While this is normally
desirable, t

[Support] Support both Windows and Posix paths on both platforms.

Previously which path syntax we supported dependend on what
platform we were compiling LLVM on. While this is normally
desirable, there are situations where we need to be able to
handle a path that we know was generated on a remote host.
Remote debugging, for example, or parsing debug info.

99% of the code in LLVM for handling paths was platform
agnostic and literally just a few branches were gated behind
pre-processor checks, so this changes those sites to use
runtime checks instead, and adds a flag to every path
API that allows one to override the host native syntax.

Differential Revision: https://reviews.llvm.org/D30858

llvm-svn: 298004

show more ...


# 566fdf4a 16-Mar-2017 James Henderson <jh7370@my.bristol.ac.uk>

[Support] Add support for getting file system permissions on Windows and implement sys::fs::set/getPermissions to work with them

This change adds support for functions to set and get file permission

[Support] Add support for getting file system permissions on Windows and implement sys::fs::set/getPermissions to work with them

This change adds support for functions to set and get file permissions, in a similar manner to the C++17 permissions() function in <filesystem>. The setter uses chmod on Unix systems and SetFileAttributes on Windows, setting the permissions as passed in. The getter simply uses the existing status() function.

Prior to this change, status() would always return an unknown value for the permissions on a Windows file, making it impossible to test the new function on Windows. I have therefore added support for this as well. On Linux, prior to this change, the permissions included the file type, which should actually be accessed via a different member of the file_status class.

Note that on Windows, only the *_write permission bits have any affect - if any are set, the file is writable, and if not, the file is read-only. This is in common with what MSDN describes for their behaviour of std::filesystem::permissions(), and also what boost::filesystem does.

The motivation behind this change is so that we can easily test behaviour on read-only files in LLVM unit tests, but I am sure that others may find it useful in some situations.

Reviewers: zturner, amccarth, aaron.ballman

Differential Revision: https://reviews.llvm.org/D30736

llvm-svn: 297945

show more ...


# 345012df 13-Mar-2017 Aaron Ballman <aaron@aaronballman.com>

Reverting r297617 because it broke some bots:

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/49970

llvm-svn: 297618


# f5cba915 13-Mar-2017 Aaron Ballman <aaron@aaronballman.com>

Add support for getting file system permissions and implement sys::fs::permissions to set them.

Patch by James Henderson.

llvm-svn: 297617


# 260bda3f 08-Mar-2017 Zachary Turner <zturner@google.com>

[Support] Add llvm::sys::fs::remove_directories.

We already have a function create_directories() which can create
an entire tree, and remove() which can remove an empty directory,
but we do not have

[Support] Add llvm::sys::fs::remove_directories.

We already have a function create_directories() which can create
an entire tree, and remove() which can remove an empty directory,
but we do not have remove_directories() which can remove an entire
tree. This patch adds such a function.

Because removing a directory tree can have dangerous consequences
when the tree contains a directory symlink, the patch here updates
the existing directory_iterator construct to optionally not follow
symlinks (previously it would always follow symlinks). The delete
algorithm uses this flag so that for symlinks, only the links are
removed, and not the targets.

On Windows this is implemented with SHFileOperation, which also
does not recurse into symbolic links or junctions.

Differential Revision: https://reviews.llvm.org/D30676

llvm-svn: 297314

show more ...


# 7d86ee5a 08-Mar-2017 Zachary Turner <zturner@google.com>

Resubmit FileSystem changes.

This was originall reverted due to some test failures in
ModuleCache and TestCompDirSymlink. These issues have all
been resolved and the code now passes all tests.

Dif

Resubmit FileSystem changes.

This was originall reverted due to some test failures in
ModuleCache and TestCompDirSymlink. These issues have all
been resolved and the code now passes all tests.

Differential Revision: https://reviews.llvm.org/D30698

llvm-svn: 297300

show more ...


Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4
# 82dd5421 07-Mar-2017 Zachary Turner <zturner@google.com>

[Support] Add the option to not follow symlinks on stat.

llvm-svn: 297154


# 990e3cd8 07-Mar-2017 Zachary Turner <zturner@google.com>

Use LLVM for all stat-related functionality.

This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls

Use LLVM for all stat-related functionality.

This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls to LLVM.

Differential Revision: https://reviews.llvm.org/D30624

llvm-svn: 297116

show more ...


Revision tags: llvmorg-4.0.0-rc3
# 9c761a36 01-Mar-2017 Serge Pavlov <sepavloff@gmail.com>

Process tilde in llvm::sys::path::native

Windows does not treat `~` as a reference to home directory, so the call
to `llvm::sys::path::native` on, say, `~/somedir` produces `~\somedir`,
which has di

Process tilde in llvm::sys::path::native

Windows does not treat `~` as a reference to home directory, so the call
to `llvm::sys::path::native` on, say, `~/somedir` produces `~\somedir`,
which has different meaning than the original path. With this change
tilde is expanded on Windows to user profile directory. Such behavior
keeps original meaning of the path and is consistent with the algorithm
of `llvm::sys::path::home_directory`.

Differential Revision: https://reviews.llvm.org/D27527

llvm-svn: 296590

show more ...


Revision tags: llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1
# 3e649039 09-Jan-2017 Rui Ueyama <ruiu@google.com>

Define sys::path::convert_to_slash

This patch moves convertToUnixPathSeparator from LLD to LLVM.

Differential Revision: https://reviews.llvm.org/D28444

llvm-svn: 291414


123456789