summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/VirtualFileSystem.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [VFS] Rename RedirectingFS internals to avoid collisions with public clang ↵Benjamin Kramer2015-10-091-24/+29
| | | | | | | | classes Hopefully fixes the MSVC build. NFC intended. llvm-svn: 249832
* [VFS] Just normalize away .. and . in paths for in-memory file systems.Benjamin Kramer2015-10-091-17/+10
| | | | | | This simplifies the code and gets us support for .. for free. llvm-svn: 249830
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-071-0/+5
| | | | | | | There are still some loose ends here but it's sufficient so we can detect GCC headers that are inside of a VFS. llvm-svn: 249556
* [VFS] Refactor VFSFromYAML a bit.Benjamin Kramer2015-10-071-60/+57
| | | | | | | | | | - Rename it to RedirectingFileSystem. This is what it does, YAML is just a serialization format for it. - Consistently use unique_ptr for memory management. No functional change intended. llvm-svn: 249532
* [VFS] Also drop '.' when adding files to an in-memory FS.Benjamin Kramer2015-10-071-0/+7
| | | | | | Otherwise we won't be able to find them later. llvm-svn: 249525
* [VFS] Put the incoming name in the file status to make InMemoryFS behave ↵Benjamin Kramer2015-10-061-1/+1
| | | | | | more like a real FS. llvm-svn: 249409
* [VFS] Transition clang-format to use an in-memory FS.Benjamin Kramer2015-10-061-0/+16
| | | | | | | | | | | Apart from being cleaner this also means that clang-format no longer has access to the host file system. This isn't necessary because clang-format never reads includes :) Includes minor tweaks and bugfixes found in the VFS implementation while running clang-format tests. llvm-svn: 249385
* Remove duplicated default arguments. NFC.Benjamin Kramer2015-10-051-10/+8
| | | | llvm-svn: 249355
* [VFS] Fix the windows build by including the right headers.Benjamin Kramer2015-10-051-0/+8
| | | | llvm-svn: 249319
* [VFS] Fix compilation on systems where time_t is not int64_t.Benjamin Kramer2015-10-051-4/+4
| | | | | | No functional change intended. llvm-svn: 249318
* [VFS] Add working directories to every virtual file system.Benjamin Kramer2015-10-051-8/+65
| | | | | | | | | | | | For RealFileSystem this is getcwd()/chdir(), the synthetic file systems can make up one for themselves. OverlayFileSystem now synchronizes the working directories when a new FS is added to the overlay or the overlay working directory is set. This allows purely artificial file systems that have zero ties to the underlying disks. Differential Revision: http://reviews.llvm.org/D13430 llvm-svn: 249316
* [VFS] Add an in-memory file system implementation.Benjamin Kramer2015-10-051-0/+246
| | | | | | | | | | This is a simple file system tree of memory buffers that can be filled by a client. In conjunction with an OverlayFS it can be used to make virtual files accessible right next to physical files. This can be used as a replacement for the virtual file handling in FileManager and which I intend to remove eventually. llvm-svn: 249315
* [VFS] Move class out of method so it looks less like Java.Benjamin Kramer2015-10-051-26/+28
| | | | | | No functionality change. llvm-svn: 249314
* [VFS] Remove setName from the file interface.Benjamin Kramer2015-10-051-36/+62
| | | | | | | This streamlines the interface a bit and makes Status more immutable. No functional change intended. llvm-svn: 249310
* Remove a limited and somewhat questionable DenseMapInfo specializationChandler Carruth2015-06-241-14/+0
| | | | | | for StringRef now that the core DenseMap library provides this facility. llvm-svn: 240530
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-2/+2
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-2/+2
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-3/+3
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-2/+2
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+1
| | | | | | | | | | Sorry for the noise, I managed to miss a bunch of recent regressions of include orderings here. This should actually sort all the includes for Clang. Again, no functionality changed, this is just a mechanical cleanup that I try to run periodically to keep the #include lines as regular as possible across the project. llvm-svn: 225979
* Update for LLVM API changeDavid Blaikie2014-11-191-1/+1
| | | | llvm-svn: 222303
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-261-49/+34
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Update for llvm API change.Rafael Espindola2014-08-271-1/+1
| | | | llvm-svn: 216576
* Update for llvm api changes.Rafael Espindola2014-08-171-1/+1
| | | | llvm-svn: 215856
* Convert a few ownership comments with std::unique_ptr.Rafael Espindola2014-08-171-8/+7
| | | | llvm-svn: 215853
* VirtualFileSystem: Correctly generate the mapping for an empty VFSJustin Bogner2014-07-151-23/+22
| | | | | | | In r209332 I accidentally broke generation of empty VFS maps. This fixes the issue and adds a test. llvm-svn: 213028
* Update for llvm api change.Rafael Espindola2014-07-061-3/+8
| | | | llvm-svn: 212408
* Add vfs::recursive_directory_iteratorBen Langmuir2014-06-251-0/+35
| | | | | | | | | For now, this is only used by its unit tests. It is similar to the API in llvm::sys::fs::recursive_directory_iterator, but without some of the more complex features like requesting that the iterator not recurse into the next directory, for example. llvm-svn: 211732
* Add directory_iterator for (non-recursive) iteration of VFS directoriesBen Langmuir2014-06-241-7/+191
| | | | | | | | The API is based on sys::fs::directory_iterator, but it allows iterating over overlays and the yaml-based VFS. For now, it isn't used by anything (except its tests). llvm-svn: 211623
* Update for llvm api change.Rafael Espindola2014-06-131-12/+13
| | | | llvm-svn: 210921
* Refer to error_code with the std prefix.Rafael Espindola2014-06-121-39/+41
| | | | llvm-svn: 210817
* Add a std:: prefix in cases where ADL would have failed on windows.Rafael Espindola2014-06-121-8/+8
| | | | | | This is in preparation for removing make_error_code from the llvm namespace. llvm-svn: 210745
* Use generic_category from the std namespace.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210736
* Errno should use generic_category.Rafael Espindola2014-06-121-1/+1
| | | | | | Sorry, no testcase, just noticed while trying to remove llvm's system_error.h llvm-svn: 210727
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-12/+12
| | | | | | This is an update for a llvm api change. llvm-svn: 210688
* Use make_error_code in preparation for making errc an enum class.Rafael Espindola2014-05-311-8/+8
| | | | llvm-svn: 209956
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-3/+3
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209949
* Stopgap fix for finding module for a file mapped in the VFSBen Langmuir2014-05-231-2/+4
| | | | | | | | | | | | | | | | If we lookup a path using its 'real' path first, we need to ensure that when we run header search we still use the VFS-mapped path or we will not be able to find the corresponding module for the header. The real problem is that we tie the name of a file to its underlying FileEntry, which is uniqued by inode, so we only ever get the first name it is looked up by. This doesn't work with modules, which rely on a specific file system structure. I'm hoping to have time to write up a proposal for fixing this more permanently soon, but as a stopgap this patch updates the name of the file's directory if it comes from a VFS mapping. llvm-svn: 209534
* VirtualFileSystem: Fix a few directory traversal bugs in VFSWriterJustin Bogner2014-05-211-81/+92
| | | | | | | | | | | There are a couple of issues with writing VFS maps that are awkward to fix within the current mutually recursive approach. Instead, replace the algorithm with an iterative version that uses an explicit stack of directories. Includes tests for cases the old approach was tripping on. llvm-svn: 209332
* VirtualFileSystem: Fix false positives in YAMLVFSWriter::containedInJustin Bogner2014-05-201-1/+10
| | | | | | | | Checking if a path starts with another path isn't sufficient for determining if one is contained within the heirarchy of the other. We need to ensure that the substring ends at a directory boundary. llvm-svn: 209250
* VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping filesJustin Bogner2014-05-201-0/+116
| | | | | | | | | This moves the logic to write a JSON VFS mapping from the C api into VirtualFileSystem, so that we can use it internally. No functional change. llvm-svn: 209241
* [C++11] Use 'nullptr'.Craig Topper2014-05-081-19/+19
| | | | llvm-svn: 208280
* [Basic/FileManager] Propagate whether a file 'IsVolatile' to the file ↵Argyrios Kyrtzidis2014-05-051-5/+9
| | | | | | | | opening functions. Needs llvm r208007. llvm-svn: 208008
* [C++11] Avoid implicit conversion of ArrayRef to std::vector and use move ↵Benjamin Kramer2014-03-101-5/+1
| | | | | | semantics where appropriate. llvm-svn: 203477
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-10/+10
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-1/+1
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Attempt to re-enable the VFS unittests on WindowsBen Langmuir2014-03-051-2/+4
| | | | | | | Using a //net/ path to hopefully avoid problems with non-absolute paths on Windows. llvm-svn: 203010
* Support relative paths in VFSFromYAMLBen Langmuir2014-03-041-3/+10
| | | | | | | | | Use llvm::sys::fs::make_absolute to get an absolute path before matching. Also, allow "." directories to enable testing. ".." is still not supported, and will require crossing file system boundaries to implement correctly. llvm-svn: 202903
* [C++11] Use std::atomic instead of LLVM's.Benjamin Kramer2014-03-021-3/+3
| | | | | | No intended functionality change. llvm-svn: 202652
OpenPOWER on IntegriCloud