summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Path.inc
Commit message (Collapse)AuthorAgeFilesLines
...
* Use const ref instead of value for Twine in the disk_space() APIMehdi Amini2016-03-311-1/+1
| | | | | | | Thanks Rui for noticing! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265074
* Add disk_space() to llvm::fsMehdi Amini2016-03-311-1/+31
| | | | | | | | | | Summary: Adapted from Boost::filesystem. (This is a reapply by reverting commit r265062 and fixing the WinAPI part) Differential Revision: http://reviews.llvm.org/D18467 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265068
* Revert "Add disk_space() to llvm::fs"Mehdi Amini2016-03-311-31/+1
| | | | | | | | | Breaks windows bot. This reverts commit r265050. This reverts commit r265055. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265062
* Add disk_space() to llvm::fsMehdi Amini2016-03-311-1/+31
| | | | | | | | | | | | | Summary: Adapted from Boost::filesystem. Reviewers: bruno, silvas Subscribers: tberghammer, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D18467 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265050
* Add lastAccessedTime to file_statusMehdi Amini2016-03-251-2/+9
| | | | | | | | | Differential Revision: http://reviews.llvm.org/D18456 This is a re-commit of r264387 and r264388 after fixing a typo. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264392
* Revert "Add lastAccessedTime to file_status"Mehdi Amini2016-03-251-9/+2
| | | | | | | | This reverts commit r264387. Bots are broken in various ways, I need to take one commit at a time... From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264390
* Add lastAccessedTime to file_statusMehdi Amini2016-03-251-2/+9
| | | | | | | | | | | Reviewers: silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18456 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264387
* Fix typo: XDS -> XDGSean Silva2016-03-241-3/+3
| | | | | | Patch by Robert Ma <bob1211@gmail.com>! llvm-svn: 264352
* Use static instead of anonymous namespace for helper functions. NFC.Pawel Bylica2015-11-021-5/+2
| | | | llvm-svn: 251801
* [Support] Extend sys::path with user_cache_directory function.Pawel Bylica2015-11-021-21/+53
| | | | | | | | | | | | | | | | | | | | Summary: The new function sys::path::user_cache_directory tries to discover a directory suitable for cache storage for current system user. On Windows and Darwin it returns a path to system-specific user cache directory. On Linux it follows XDG Base Directory Specification, what is: - use non-empty $XDG_CACHE_HOME env var, - use $HOME/.cache. Reviewers: chapuni, aaron.ballman, rafael Subscribers: rafael, aaron.ballman, llvm-commits Differential Revision: http://reviews.llvm.org/D13801 llvm-svn: 251784
* Fix Clang-tidy modernize-use-nullptr warnings in source directories and ↵Hans Wennborg2015-10-061-20/+20
| | | | | | | | | | generated files; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13321 llvm-svn: 249482
* ScanDirForExecutable on Windows fails to find executables with the "exe" ↵Reid Kleckner2015-09-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Thread premissions through sys::fs::create_director{y|ies}Frederic Riss2015-08-061-2/+3
| | | | llvm-svn: 244268
* Remove unnecessary StringRef->std::string conversion.Alexey Samsonov2014-12-291-1/+1
| | | | llvm-svn: 224953
* MAP_FILE is the default. We don't need to add it.Rafael Espindola2014-12-121-3/+0
| | | | llvm-svn: 224144
* Move the resize file feature from mapped_file_region to the only user.Rafael Espindola2014-12-121-13/+1
| | | | | | This removes a duplicated stat on every file that llvm-ar looks at. llvm-svn: 224138
* Pass a FD to resise_file and add a testcase.Rafael Espindola2014-12-121-5/+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-46/+6
| | | | | | As a bonus we can actually check the return value. llvm-svn: 224046
* Remove dead code. NFC.Rafael Espindola2014-12-111-33/+0
| | | | llvm-svn: 224029
* Remove dead code. NFC.Rafael Espindola2014-12-041-1/+1
| | | | | | This interface was added 2 years ago but users never developed. llvm-svn: 223368
* Misc cleanups to the FileSytem api.Rafael Espindola2014-09-111-26/+23
| | | | | | | | | | | | | | | | 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
* Add an explicit cast to pacify implicit boolean conversion warnings.Benjamin Kramer2014-08-271-1/+1
| | | | llvm-svn: 216539
* Merge TempDir and system_temp_directory.Rafael Espindola2014-08-261-16/+60
| | | | | | | | | We had two functions for finding the temp or cache directory. Each had a different set of smarts about OS specific APIs. With this patch system_temp_directory becomes the only way to do it. llvm-svn: 216460
* Remove dead code. Fixes pr20544.Rafael Espindola2014-08-081-13/+0
| | | | llvm-svn: 215243
* Build fix for systems without futimes/futimensAlp Toker2014-06-301-1/+1
| | | | | | | | | 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
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-131-5/+5
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. llvm-svn: 210920
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-63/+65
| | | | llvm-svn: 210871
* Don't put generic_category in the llvm namespace.Rafael Espindola2014-06-121-19/+19
| | | | llvm-svn: 210737
* Implement get_magic with generic tools and inline it.Rafael Espindola2014-06-111-31/+0
| | | | llvm-svn: 210716
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* Uses generic_category instead of system_category.Rafael Espindola2014-06-111-21/+21
| | | | | | | Some c++ libraries (libstdc++ at least) don't seem to map to the generic category in in the system_category's default_error_condition. llvm-svn: 210635
* Turn errc and windows_error into enum classes.Rafael Espindola2014-05-311-5/+5
| | | | llvm-svn: 209957
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-21/+21
| | | | | | | 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-29/+0
| | | | llvm-svn: 209938
* [C++] Use 'nullptr'.Craig Topper2014-04-281-11/+11
| | | | llvm-svn: 207394
* [Support] Make sure sys::fs::remove can remove symbolic links and make sure ↵Argyrios Kyrtzidis2014-03-211-2/+2
| | | | | | LockFileManager can handle a symbolic link that points nowhere. llvm-svn: 204422
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-111-0/+13
| | | | | | | | 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-2/+4
| | | | | | | | | | | | 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-13/+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/+13
| | | | llvm-svn: 203136
* [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
* Share a createUniqueEntity implementation between unix and windows.Rafael Espindola2014-02-241-71/+6
| | | | | | | The only extra bit of functionality that had to be exposed for this be be implemented in Path.cpp is opening a file in rw mode. llvm-svn: 202005
* Use static instead of an anonymous namespace.Rafael Espindola2014-02-231-14/+12
| | | | llvm-svn: 201983
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-231-17/+11
| | | | | | | | | | | | | | | Before this patch they would take an boolean argument to say if the path already existed. This was redundant with the returned error_code which is able to represent that. This allowed for callers to incorrectly check only the existed flag instead of first checking the error code. Instead, pass in a boolean flag to say if the previous (non-)existence should be an error or not. Callers of the of the old simple versions are not affected. They still ignore the previous (non-)existence as they did before. llvm-svn: 201979
* Remove dead code.Rafael Espindola2014-02-131-13/+0
| | | | llvm-svn: 201327
* Remove TimeValue::toPosixTime() -- it is buggy, semantics are unclear, and itsDmitri Gribenko2014-02-111-2/+2
| | | | | | only current user should be using toEpochTime() instead. llvm-svn: 201136
* Using the helper API for random number generation.Aaron Ballman2014-02-111-1/+0
| | | | llvm-svn: 201125
* Introduce llvm::sys::path::home_directory.Peter Collingbourne2014-01-311-0/+15
| | | | | | | | | This will be used by the line editor library to derive a default path to the history file. Differential Revision: http://llvm-reviews.chandlerc.com/D2199 llvm-svn: 200594
* Build fix for Android NDK which has neither futimes nor futimensAlp Toker2013-12-111-3/+6
| | | | | | Based on a patch by Neil Henning! llvm-svn: 197045
* Improve the detection of the pathSylvestre Ledru2013-12-091-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When clang is used under GNU/Linux in a chroot without /proc mount, it falls back on the BSD method. However, since the buf variable is used twice and fails with snprintf to produce the correct path. When called as relatived (ie ./clang), it was failing with: "" -cc1 [...] -x c++ x.cc error: unable to execute command: Executable "" doesn't exist! I also took the opportunity to simply the code (the first arg of test_dir was useless). Reviewers: rafael Reviewed By: rafael CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2361 llvm-svn: 196791
OpenPOWER on IntegriCloud