summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/FileSystemStatCache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [FileSystemStatCache] Return std::error_code from stat cache methodsHarlan Haskins2019-04-161-20/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we would return true/false signifying if the cache/lookup succeeded or failed. Instead, provide clients with the underlying error that was thrown while attempting to look up in the cache. Since clang::FileManager doesn't make use of this information, it discards the error that's received and casts away to bool. This change is NFC. Reviewers: benlangmuir, arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60735 llvm-svn: 358509
* Replace clang::FileData with llvm::vfs::StatusHarlan Haskins2019-03-051-25/+15
| | | | | | | | | | | | | | | | Summary: FileData was only ever used as a container for the values in llvm::vfs::Status, so they might as well be consolidated. The `InPCH` member was also always set to false, and unused. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58924 llvm-svn: 355368
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Remove stat cache chaining as it's no longer needed after PTH support has beenAlex Lorenz2018-12-211-9/+8
| | | | | | | | | | | | | removed Stat cache chaining was implemented for a StatListener in the PTH writer so that it could write out the stat information to PTH. r348266 removed support for PTH, and it doesn't seem like there are other uses of stat cache chaining. We can remove the chaining support. Differential Revision: https://reviews.llvm.org/D55455 llvm-svn: 349942
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-7/+9
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* Remove trailing spaceFangrui Song2018-07-301-4/+4
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-281-2/+5
| | | | | | other minor fixes (NFC). llvm-svn: 328735
* [VFS] Replace TimeValue usage with std::chronoPavel Labath2016-11-091-1/+1
| | | | | | | | | | | | Summary: NFCI Reviewers: benlangmuir, zturner Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25948 llvm-svn: 286356
* Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)Mehdi Amini2016-10-111-2/+2
| | | | llvm-svn: 283856
* [cleanup] Remove some unused #ifdef'sSean Silva2015-06-111-11/+0
| | | | | | | This is all going through the VFS layer now, so there's nothing platform-specific here. llvm-svn: 239573
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-261-5/+4
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie2014-07-081-8/+5
| | | | | | | | | std::unique_ptr Spotted after a memory leak (due to the complexities of manual memory management) was fixed in 212466. llvm-svn: 212541
* Fix memory leak in FileSystemStatCache.Manuel Klimek2014-07-071-0/+1
| | | | | | Patch by Guochun Shi. llvm-svn: 212466
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210780
* Stopgap fix for finding module for a file mapped in the VFSBen Langmuir2014-05-231-0/+1
| | | | | | | | | | | | | | | | 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
* [C++11] Use 'nullptr'.Craig Topper2014-05-081-2/+2
| | | | llvm-svn: 208280
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-1/+1
| | | | | | 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
* Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-281-0/+1
| | | | | | | | | | | | | | | | Was r202442 There were two issues with the original patch that have now been fixed. 1. We were memset'ing over a FileEntry in a test case. After adding a std::string to FileEntry, this still happened to not break for me. 2. I didn't pass the FileManager into the new compiler instance in compileModule. This was hidden in some cases by the fact I didn't clear the module cache in the test. Also, I changed the copy constructor for FileEntry, which was memcpy'ing in a (now) unsafe way. llvm-svn: 202539
* Revert "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-271-1/+0
| | | | | | Revert r202442, which broke the buildbots. llvm-svn: 202443
* Honour 'use-external-names' in FileManagerBen Langmuir2014-02-271-0/+1
| | | | | | | | Pass through the externally-visible names that we got from the VFS down to FileManager, and test that this is the name showing up in __FILE__, diagnostics, and debug information. llvm-svn: 202442
* Recommit virtual file systemBen Langmuir2014-02-201-21/+23
| | | | | | | | | | | Previously reverted in r201755 due to causing an assertion failure. I've removed the offending assertion, and taught the CompilerInstance to create a default virtual file system inside createFileManager. In the future, we should be able to reach into the CompilerInvocation to customize this behaviour without breaking clients that don't care. llvm-svn: 201818
* Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka2014-02-201-23/+21
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
* Initial implementation of virtual file systemBen Langmuir2014-02-191-21/+23
| | | | | | | | | | | | This adds the minimum virtual file system support to start migrating FileManager onto the VFS. Originally discussed here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035188.html Differential Revision: http://llvm-reviews.chandlerc.com/D2745 llvm-svn: 201618
* Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola2013-08-011-16/+32
| | | | | | | | | | | | | | | | | | | This unifies the unix and windows versions of FileManager::UniqueDirContainer and FileManager::UniqueFileContainer by using UniqueID. We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we want to be able to construct fake ones, and file_status has different members on unix and windows. What the patch does is: * Record only the information that clang is actually using. * Use llvm::sys::fs::status instead of stat and fstat. * Use llvm::sys::fs::UniqueID * Delete the old windows versions of UniqueDirContainer and UniqueFileContainer since the "unix" one now works on windows too. llvm-svn: 187619
* Update for llvm API change.Rafael Espindola2013-07-161-8/+4
| | | | llvm-svn: 186448
* Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis2012-12-111-9/+11
| | | | | | | | | | a file or directory, allowing just a stat call if a file descriptor is not needed. Doing just 'stat' is faster than 'open/fstat/close'. This has the effect of cutting down system time for validating the input files of a PCH. llvm-svn: 169831
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer2010-12-171-1/+1
| | | | llvm-svn: 122087
* attempt to fix a buildbot failure, apparently apache fails to build.Chris Lattner2010-12-021-1/+1
| | | | llvm-svn: 120688
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120297
* Fix 2 problems with Chris Lattner's FileManager redesign on Windows.Francois Pichet2010-11-241-1/+1
| | | | | | | - FileEntry::operator= is needed on Win32. - There was an error in the S_ISDIR() macro. llvm-svn: 120079
* The final result of all this refactoring: instead of doing stat immediatelyChris Lattner2010-11-231-3/+38
| | | | | | | | | | | | | followed by an open for every source file we open, probe the file system with 'open' and then do an fstat when it succeeds. open+fstat is faster than stat+open because the kernel only has to perform the string->inode mapping once. Presumably it gets faster the deeper in your filesystem a lookup happens. For -Eonly on cocoa.h, this reduces system time from 0.042s to 0.039s on my machine, a 7.7% speedup. llvm-svn: 120066
* if we succeed in opening a directory but expected a file, ensure we don'tChris Lattner2010-11-231-1/+22
| | | | | | leak a filedescriptor if a client ever starts returning one. llvm-svn: 120062
* change the 'is directory' indicator to be a null-or-notChris Lattner2010-11-231-2/+28
| | | | | | | | | pointer that is passed down through the APIs, and make FileSystemStatCache::get be the one that filters out directory lookups that hit files. This also paves the way to have stat queries be able to return opened files. llvm-svn: 120060
* replicate a terrible hack to fix a build error on VC++Chris Lattner2010-11-231-0/+4
| | | | llvm-svn: 120039
* simplify the cache miss handling code, eliminating CacheMissing.Chris Lattner2010-11-231-6/+1
| | | | llvm-svn: 120038
* r120013 dropped passing in the precomputed file size to Chris Lattner2010-11-231-1/+0
| | | | | | | MemoryBuffer::getFile, causing us to pick up a fstat for every file. Restore the optimization. llvm-svn: 120032
* PCH files only cache successful stats. Remove the code that reads/writes Chris Lattner2010-11-231-1/+1
| | | | | | the result code of the stat to/from the PCH file since it is always 0. llvm-svn: 120031
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-231-0/+40
its own header and giving it some more structure. No functionality change. llvm-svn: 120030
OpenPOWER on IntegriCloud