History log of /llvm-project-15.0.7/llvm/lib/Support/VirtualFileSystem.cpp (Results 51 – 75 of 78)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 0caee276 16-Oct-2019 Simon Pilgrim <[email protected]>

RedirectingFileSystem::openFileForRead - replace bitwise & with boolean && to fix warning

Seems to be just a typo - now matches other instances which do something similar

llvm-svn: 374995


# 115a6ecd 16-Oct-2019 Simon Pilgrim <[email protected]>

RealFile - fix self-initialization warning in constructor.

llvm-svn: 374994


# 21703543 15-Oct-2019 Jonas Devlieghere <[email protected]>

[Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file syst

[Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file system. This prevented us from
having a working directory that only existed in the VFS mapping.

This patch adds support for a virtual working directory in the
RedirectingFileSystem. It now keeps track of its own WD in addition to
updating the WD of the external file system. This ensures that we can
still fall through for relative paths.

This change was originally motivated by the reproducer infrastructure in
LLDB where we want to deal transparently with relative paths.

Differential revision: https://reviews.llvm.org/D65677

llvm-svn: 374955

show more ...


# 409b4b5f 15-Oct-2019 Jonas Devlieghere <[email protected]>

Revert "[VirtualFileSystem] Support virtual working directory in the RedirectingFS"

This reverts the original commit and the follow up:

Revert "[VirtualFileSystem] Support virtual working director

Revert "[VirtualFileSystem] Support virtual working directory in the RedirectingFS"

This reverts the original commit and the follow up:

Revert "[VirtualFileSystem] Support virtual working directory in the RedirectingFS"
Revert "[test] Update YAML mapping in VirtualFileSystemTest"

llvm-svn: 374935

show more ...


# 0b9981b1 15-Oct-2019 Jonas Devlieghere <[email protected]>

[VirtualFileSystem] Support virtual working directory in the RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file system. Thi

[VirtualFileSystem] Support virtual working directory in the RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file system. This prevented us from
having a working directory that only existed in the VFS mapping.

This patch adds support for a virtual working directory in the
RedirectingFileSystem. It now keeps track of its own WD in addition to
updating the WD of the external file system. This ensures that we can
still fall through for relative paths.

This change was originally motivated by the reproducer infrastructure in
LLDB where we want to deal transparently with relative paths.

Differential revision: https://reviews.llvm.org/D65677

llvm-svn: 374917

show more ...


# 7ce31230 01-Oct-2019 Simon Pilgrim <[email protected]>

VirtualFileSystem - replace dyn_cast<>+assert with cast<> calls. NFCI.

Silences a number of clang static analyzer null dereference warnings.

llvm-svn: 373325


Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6
# 97fc8eb4 13-Sep-2019 Jonas Devlieghere <[email protected]>

[Reproducer] Add reproducer dump command.

This adds a reproducer dump commands which makes it possible to inspect
a reproducer from inside LLDB. Currently it supports the Files, Commands
and Version

[Reproducer] Add reproducer dump command.

This adds a reproducer dump commands which makes it possible to inspect
a reproducer from inside LLDB. Currently it supports the Files, Commands
and Version providers. I'm planning to add support for the GDB Remote
provider in a follow-up patch.

Differential revision: https://reviews.llvm.org/D67474

llvm-svn: 371909

show more ...


Revision tags: llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3
# 0eaee545 15-Aug-2019 Jonas Devlieghere <[email protected]>

[llvm] Migrate llvm::make_unique to std::make_unique

Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of

[llvm] Migrate llvm::make_unique to std::make_unique

Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013

show more ...


Revision tags: llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init
# cc418a3a 10-Jul-2019 Reid Kleckner <[email protected]>

[Support] Move llvm::MemoryBuffer to sys::fs::file_t

Summary:
On Windows, Posix integer file descriptors are a compatibility layer
over native file handles provided by the C runtime. There is a hard

[Support] Move llvm::MemoryBuffer to sys::fs::file_t

Summary:
On Windows, Posix integer file descriptors are a compatibility layer
over native file handles provided by the C runtime. There is a hard
limit on the maximum number of file descriptors that a process can open,
and the limit is 8192. LLD typically doesn't run into this limit because
it opens input files, maps them into memory, and then immediately closes
the file descriptor. This prevents it from running out of FDs.

For various reasons, I'd like to open handles to every input file and
keep them open during linking. That requires migrating MemoryBuffer over
to taking open native file handles instead of integer FDs.

Reviewers: aganea, Bigcheese

Reviewed By: aganea

Subscribers: smeenai, silvas, mehdi_amini, hiraditya, steven_wu, dexonsmith, dang, llvm-commits, zturner

Tags: #llvm

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

llvm-svn: 365588

show more ...


Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2
# cfe6fe06 22-May-2019 Simon Pilgrim <[email protected]>

[VirtualFileSystem] Fix uninitialized variable warning. NFCI.

llvm-svn: 361371


Revision tags: llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3
# e7b94649 23-Feb-2019 Duncan P. N. Exon Smith <[email protected]>

VFS: Avoid some unnecessary std::string copies

Thread Twine a little deeper through the VFS to avoid unnecessarily
constructing the same std::string twice in a parameter sequence:

Twine -> std:

VFS: Avoid some unnecessary std::string copies

Thread Twine a little deeper through the VFS to avoid unnecessarily
constructing the same std::string twice in a parameter sequence:

Twine -> std::string -> StringRef -> std::string

Changing a few parameters from StringRef to Twine avoids the early call
to `Twine::str()`.

llvm-svn: 354739

show more ...


# 15e475e2 14-Feb-2019 Sam McCall <[email protected]>

Reapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.

This reverts commit r351091.
The original mac breakages are addressed by ensuring the root directory
we're working from i

Reapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.

This reverts commit r351091.
The original mac breakages are addressed by ensuring the root directory
we're working from is fully symlink-resolved before starting.

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

llvm-svn: 354026

show more ...


Revision tags: llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1
# 2946cd70 19-Jan-2019 Chandler Carruth <[email protected]>

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the ne

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636

show more ...


# 1ad53ca2 16-Jan-2019 Pavel Labath <[email protected]>

[Support] Remove error return value from one overload of fs::make_absolute

Summary:
The version of make_absolute which accepted a specific directory to use
as the "base" for the computation could ne

[Support] Remove error return value from one overload of fs::make_absolute

Summary:
The version of make_absolute which accepted a specific directory to use
as the "base" for the computation could never fail, even though it
returned a std::error_code. The reason for that seems to be historical
-- the CWD flavour (which can fail due to failure to retrieve CWD) was
there first, and the new version was implemented by extending that.

This removes the error return value from the non-CWD overload and
reimplements the CWD version on top of that. This enables us to remove
some dead code where people were pessimistically trying to handle the
errors returned from this function.

Reviewers: zturner, sammccall

Subscribers: hiraditya, kristina, llvm-commits

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

llvm-svn: 351317

show more ...


# 1a0ce65a 15-Jan-2019 Jonas Devlieghere <[email protected]>

[VFS] Move RedirectingFileSystem interface into header (NFC)

This moves the RedirectingFileSystem into the header so it can be
extended. This is needed in LLDB we need a way to obtain the external
p

[VFS] Move RedirectingFileSystem interface into header (NFC)

This moves the RedirectingFileSystem into the header so it can be
extended. This is needed in LLDB we need a way to obtain the external
path to deal with FILE* and file descriptor APIs.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-November/127755.html

Differential revision: https://reviews.llvm.org/D54277

llvm-svn: 351265

show more ...


# e07cdb10 14-Jan-2019 Amara Emerson <[email protected]>

Revert "[VFS] Allow multiple RealFileSystem instances with independent CWDs."
This reverts commit r351079, r351069 and r351050 as it broken the greendragon bots on macOS.

llvm-svn: 351091


# 7a99727c 14-Jan-2019 Sam McCall <[email protected]>

[VFS] Fix unused variable warning. NFC

llvm-svn: 351069


# c2b310ae 14-Jan-2019 Sam McCall <[email protected]>

[VFS] Allow multiple RealFileSystem instances with independent CWDs.

Summary:
Previously only one RealFileSystem instance was available, and its working
directory is shared with the process. This do

[VFS] Allow multiple RealFileSystem instances with independent CWDs.

Summary:
Previously only one RealFileSystem instance was available, and its working
directory is shared with the process. This doesn't work well for multithreaded
programs that want to work with relative paths - the vfs::FileSystem is assumed
to provide the working directory, but a thread cannot control this exclusively.

The new vfs::createPhysicalFileSystem() factory copies the process's working
directory initially, and then allows it to be independently modified.

This implementation records the working directory path, and glues it to relative
paths to provide the correct absolute path to the sys::fs:: functions.
This will give different results in unusual situations (e.g. the CWD is moved).

The main alternative is the use of openat(), fstatat(), etc to ask the OS to
resolve paths relative to a directory handle which can be kept open. This is
more robust. There are two reasons not to do this initially:
1. these functions are not available on all supported Unixes, and are somewhere
between difficult and unavailable on Windows. So we need a path-based
fallback anyway.
2. this would mean also adding support at the llvm::sys::fs level, which is a
larger project. My clearest idea is an OS-specific `BaseDirectory` object
that can be optionally passed to functions there. Eventually this could be
backed by either paths or a fd where openat() is supported.
This is a large project, and demonstrating here that a path-based fallback
works is a useful prerequisite.

There is some subtlety to the path-manipulation mechanism:
- when setting the working directory, both Specified=makeAbsolute(path) and
Resolved=realpath(path) are recorded. These may differ in the presence of
symlinks.
- getCurrentWorkingDirectory() and makeAbsolute() use Specified - this is
similar to the behavior of $PWD and sys::path::current_path
- IO operations like openFileForRead use Resolved. This is similar to the
behavior of an openat() based implementation, that doesn't see changes
in symlinks.
There may still be combinations of operations and FS states that yield unhelpful
behavior. This is hard to avoid with symlinks and FS abstractions :(

The caching behavior of the current working directory is removed in this patch.
getRealFileSystem() is now specified to link to the process CWD, so the caching
is incorrect.
The user who needed this so far is clangd, which will immediately switch to
createPhysicalFileSystem().

Reviewers: ilya-biryukov, bkramer, labath

Subscribers: ioeric, kadircet, kristina, llvm-commits

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

llvm-svn: 351050

show more ...


# a87b70d1 29-Dec-2018 Richard Trieu <[email protected]>

Add vtable anchor to classes.

llvm-svn: 350142


Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3
# 7610033f 16-Nov-2018 Volodymyr Sapsai <[email protected]>

[VFS] Implement `RedirectingFileSystem::getRealPath`.

It fixes the case when Objective-C framework is added as a subframework
through a symlink. When parent framework infers a module map and fails
t

[VFS] Implement `RedirectingFileSystem::getRealPath`.

It fixes the case when Objective-C framework is added as a subframework
through a symlink. When parent framework infers a module map and fails
to detect a symlink, it would add a subframework as a submodule. And
when we parse module map for the subframework, we would encounter an
error like

> error: umbrella for module 'WithSubframework.Foo' already covers this directory

By implementing `getRealPath` "an egregious but useful hack" in
`ModuleMap::inferFrameworkModule` works as expected.

rdar://problem/45821279

Reviewers: bruno, benlangmuir, erik.pilkington

Reviewed By: bruno

Subscribers: hiraditya, dexonsmith, JDevlieghere, cfe-commits, llvm-commits

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

llvm-svn: 347009

show more ...


# 99538e89 09-Nov-2018 Sam McCall <[email protected]>

Revert "[VFS] Add "expand tilde" argument to getRealPath."

This reverts commit r346453.
This is a complex change to a widely-used interface, and was not reviewed.

llvm-svn: 346500


# f5b6d11c 09-Nov-2018 Jonas Devlieghere <[email protected]>

[VFS] Add "expand tilde" argument to getRealPath.

Add an optional argument to expand tildes in the path to mirror llvm's
implementation of the corresponding function.

llvm-svn: 346453


# cbb5c868 08-Nov-2018 Jonas Devlieghere <[email protected]>

Extend virtual file system with `isLocal` method

Expose the `llvm::sys::fs::is_local` function through the VFS.

Differential revision: https://reviews.llvm.org/D54127

llvm-svn: 346372


Revision tags: llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1
# 41fb951f 31-Oct-2018 Jonas Devlieghere <[email protected]>

[VFS] Add support for "no_push" to VFS recursive iterators.

The "regular" file system has a useful feature that makes it possible to
stop recursing when using the recursive directory iterators. This

[VFS] Add support for "no_push" to VFS recursive iterators.

The "regular" file system has a useful feature that makes it possible to
stop recursing when using the recursive directory iterators. This
functionality was missing for the VFS recursive iterator and this patch
adds that.

Differential revision: https://reviews.llvm.org/D53465

llvm-svn: 345793

show more ...


# f1d3061e 29-Oct-2018 Erich Keane <[email protected]>

Add parens to fix incorrect assert check.

&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.

Change-Id: I3abe1361ee0694462190c5015779db6

Add parens to fix incorrect assert check.

&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.

Change-Id: I3abe1361ee0694462190c5015779db664012f3d4
llvm-svn: 345543

show more ...


1234