summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/FileSystem.h
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Update documentation for createUniqueFile() to explain that models ↵Cameron Esfahani2015-11-061-3/+3
| | | | | | without an absolute path will be created in the current directory. llvm-svn: 252265
* Revert r250923 as config.h is not an installed header.Yaron Keren2015-10-211-1/+0
| | | | llvm-svn: 250924
* Include llvm/Config/config.h in FileSystem.h as it depends upon ↵Yaron Keren2015-10-211-0/+1
| | | | | | HAVE_SYS_STAT_H which is defined (or not) in config.h. llvm-svn: 250923
* [Support] Add a version of fs::make_absolute with a custom CWD.Benjamin Kramer2015-10-051-0/+14
| | | | | | This will be used soon from clang. llvm-svn: 249309
* ScanDirForExecutable on Windows fails to find executables with the "exe" ↵Reid Kleckner2015-09-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | extension in name When the driver tries to locate a program by its name, e.g. a linker, it scans the paths provided by the toolchain using the ScanDirForExecutable function. If the lookup fails, the driver uses llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName, ScanDirForExecutable is not aware of file extensions. If the program has the "exe" extension in its name, which is very common on Windows, ScanDirForExecutable won't find it under the toolchain-provided paths. This patch changes the Windows version of the "`can_execute`" function called by ScanDirForExecutable to respect file extensions, similarly to llvm::sys::findProgramByName. Patch by Oleg Ranevskyy Reviewers: rnk Differential Revision: http://reviews.llvm.org/D12711 llvm-svn: 247358
* Reformat headers in ADT and Support partially.NAKAMURA Takumi2015-08-101-6/+6
| | | | | | Note, I didn't reformat entirely, but partially where I touched in previous commits. llvm-svn: 244432
* Whitespace.NAKAMURA Takumi2015-08-101-6/+6
| | | | llvm-svn: 244431
* Reformat linebreaks.NAKAMURA Takumi2015-08-101-0/+1
| | | | llvm-svn: 244430
* Thread premissions through sys::fs::create_director{y|ies}Frederic Riss2015-08-061-2/+4
| | | | llvm-svn: 244268
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-2/+2
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-2/+2
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Mark empty default constructors as =default if it makes the type PODBenjamin Kramer2015-04-111-1/+1
| | | | | | NFC llvm-svn: 234694
* Object: Handle Mach-O kext bundle filesJustin Bogner2015-02-251-0/+1
| | | | | | This particular subtype of Mach-O was missing. Add it. llvm-svn: 230567
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-3/+3
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Remove the last unnecessary member variable of mapped_file_region. NFC.Rafael Espindola2014-12-161-3/+0
| | | | llvm-svn: 224312
* Convert a member variable to a local variable. NFC.Rafael Espindola2014-12-161-1/+0
| | | | llvm-svn: 224311
* Remove unused member and simplify. NFC.Rafael Espindola2014-12-161-1/+0
| | | | llvm-svn: 224309
* Fix Doxygen command misspellings.Benjamin Kramer2014-12-131-2/+2
| | | | | | Found by -Wdocumentation. llvm-svn: 224197
* Pass a FD to resise_file and add a testcase.Rafael Espindola2014-12-121-2/+2
| | | | | | I will add a real use in another commit. llvm-svn: 224136
* Remove a convoluted way of calling close by moving the call to the only caller.Rafael Espindola2014-12-111-9/+3
| | | | | | As a bonus we can actually check the return value. llvm-svn: 224046
* Remove dead code. NFC.Rafael Espindola2014-12-111-18/+0
| | | | llvm-svn: 224029
* Support ELF files of unknown type.Michael J. Spencer2014-11-181-0/+1
| | | | llvm-svn: 222208
* Move sys::fs::AccessMode out of @brief in the function. [-Wdocumentation]NAKAMURA Takumi2014-09-121-1/+2
| | | | | FIXME: Annotate sys::fs::AccessMode. llvm-svn: 217685
* sys::fs::access(): Fix @param [-Wdocumentation]NAKAMURA Takumi2014-09-121-1/+1
| | | | llvm-svn: 217684
* Misc cleanups to the FileSytem api.Rafael Espindola2014-09-111-12/+16
| | | | | | | | | | | | | | | | The main difference is the removal of std::error_code exists(const Twine &path, bool &result); It was an horribly redundant interface since a file not existing is also a valid error_code. Now we have an access function that returns just an error_code. This is the only function that has to be implemented for Unix and Windows. The functions can_write, exists and can_execute an now just wrappers. One still has to be very careful using these function to avoid introducing race conditions (Time of check to time of use). llvm-svn: 217625
* Remove dead code. Fixes pr20544.Rafael Espindola2014-08-081-8/+0
| | | | llvm-svn: 215243
* Fix 'platform-specific' hyphenationsAlp Toker2014-06-301-17/+17
| | | | llvm-svn: 212056
* Build fix for systems without futimes/futimensAlp Toker2014-06-301-2/+2
| | | | | | | | | Some versions of Android don't have futimes/futimens and this code wasn't updated during the recent errc refactoring. Patch by Luqman Aden! llvm-svn: 212055
* Support: Add llvm::sys::fs::copy_fileJustin Bogner2014-06-191-0/+6
| | | | | | A function to copy one file's contents to another. llvm-svn: 211302
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-62/+55
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-121-1/+2
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Implement get_magic with generic tools and inline it.Rafael Espindola2014-06-111-13/+0
| | | | llvm-svn: 210716
* Remove unused has_magic.Rafael Espindola2014-06-111-8/+0
| | | | | | | This will allow inlining get_magic, which should in turn fix one of the mingw build problems after the switch to std::error_code. llvm-svn: 210712
* Use an enum class now that they are available.Rafael Espindola2014-06-101-20/+12
| | | | llvm-svn: 210566
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-1/+1
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209952
* delete dead code.Rafael Espindola2014-05-311-24/+0
| | | | llvm-svn: 209938
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-1/+1
| | | | | | necessary. llvm-svn: 207593
* [Windows] Fix assertion failure when passing 'nul' in input to clang.Andrea Di Biagio2014-04-291-3/+18
| | | | | | | | | | | | | | | | | Before this patch, if 'nul' was passed in input to clang, function getStatus() (in Path.inc) always returned an instance of file_status with field 'nFileSizeHigh' and 'nFileSizeLow' left uninitialized. This was causing the triggering of an assertion failure in MemoryBuffer.cpp due to an invalid FileSize for device 'nul'. This patch fixes the assertion failure modifying the constructors of class file_status (in llvm/Support/FileSystem.h) so that every field of the class gets initialized to zero by default. A clang test will be submitted on a separate patch. llvm-svn: 207575
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-091-2/+2
| | | | | | to reduce verbosity. llvm-svn: 205829
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-3/+3
| | | | llvm-svn: 205697
* Remove dead and incorrect code.Rafael Espindola2014-03-201-17/+1
| | | | | | is_symlink was always false since it was using stat instead of lstat. llvm-svn: 204361
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-111-0/+8
| | | | | | | | Add a utility function to convert the Windows path separator to Unix style path separators. This is used by a subsequent change in clang to enable the use of Windows SDK headers on Linux. llvm-svn: 203611
* Cleanup the interface for creating soft or hard links.Rafael Espindola2014-03-111-4/+9
| | | | | | | | | | | | Before this patch the unix code for creating hardlinks was unused. The code for creating symbolic links was implemented in lib/Support/LockFileManager.cpp and the code for creating hard links in lib/Support/*/Path.inc. The only use we have for these is in LockFileManager.cpp and it can use both soft and hard links. Just have a create_link function that creates one or the other depending on the platform. llvm-svn: 203596
* Revert create_symbolic_link and both depending changesReid Kleckner2014-03-061-8/+0
| | | | | | | | | | This reverts commits r203136, r203137, and r203138. This code doesn't build on Windows. Even on Vista+, Windows requires elevated privileges to create a symlink. Therefore we can't use symlinks in the compiler. We'll have to find another approach. llvm-svn: 203143
* [Support/FileSystem] Introduce llvm::sys::fs::create_symbolic_link().Argyrios Kyrtzidis2014-03-061-0/+8
| | | | llvm-svn: 203136
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+0
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Add missing include.Benjamin Kramer2014-03-031-0/+1
| | | | | | libstdc++ and libc++ pulled this in transitively so I didn't notice. llvm-svn: 202753
* [C++11] Use std::tie to simplify compare operators.Benjamin Kramer2014-03-031-2/+1
| | | | | | No functionality change. llvm-svn: 202751
* [C++11] Remove the R-value reference #if usage from the ADT and SupportChandler Carruth2014-03-011-2/+0
| | | | | | libraries. It is now always 1 in LLVM builds. llvm-svn: 202580
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-3/+3
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
OpenPOWER on IntegriCloud