summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/PathV2.inc
Commit message (Collapse)AuthorAgeFilesLines
* Rename PathV2 to just Path now that it is the only one.Rafael Espindola2013-06-261-870/+0
| | | | llvm-svn: 185015
* Use enums instead of raw octal values.Rafael Espindola2013-06-261-1/+0
| | | | | | Patch by 罗勇刚(Yonggang Luo). llvm-svn: 184971
* Remove calls to Path in #ifdefs that don't seem to be used in any of the ↵Rafael Espindola2013-06-261-3/+3
| | | | | | bots :-( llvm-svn: 184920
* Fix the build when __APPLE__ is defined.Rafael Espindola2013-06-261-1/+5
| | | | llvm-svn: 184917
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-261-0/+106
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
* Add another fixme.Rafael Espindola2013-06-201-0/+1
| | | | llvm-svn: 184488
* Remove last use of PathV1.h from Archive.cpp.Rafael Espindola2013-06-201-0/+2
| | | | llvm-svn: 184484
* make getLastModificationTime const. Move it with the other getters.Rafael Espindola2013-06-201-1/+1
| | | | llvm-svn: 184478
* Add a setLastModificationAndAccessTime to PathV2.Rafael Espindola2013-06-201-0/+10
| | | | | | With this we can remove the last use of PathV1 from llvm-ar.cpp. llvm-svn: 184464
* Add support for getting the last modification time from a file_status.Rafael Espindola2013-06-201-0/+7
| | | | | | Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus. llvm-svn: 184450
* Fix get_magic() handling of short reads.Evgeniy Stepanov2013-06-201-2/+2
| | | | | | PR16389 llvm-svn: 184434
* Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.Rafael Espindola2013-06-201-1/+1
| | | | llvm-svn: 184431
* Add a can_write function to PathV2.Rafael Espindola2013-06-181-0/+6
| | | | llvm-svn: 184233
* Add a GetUniqueID that will replace the uniqueID of PathV1.h.Rafael Espindola2013-06-181-0/+12
| | | | llvm-svn: 184217
* Only delete regular files and directories.Rafael Espindola2013-06-171-0/+16
| | | | | | | | This ports a missing feature from PathV1.h. I am not sure how to test this with the regular infrastructure, but an Apple bot should check this when r183985 is reapplied. llvm-svn: 184119
* Fix incorrectly finding 'executable' directories instead of files.Manuel Klimek2013-06-171-1/+8
| | | | | | | | | | | | | | | This broke for example the 'not' utility, if a directory called 'FileCheck' is executable and in the path before the actual 'FileCheck'. This patch steals the implementation of the "old" PathV1 canExecute implementation: - checks for R_OK (file readable): this is necessary for executing scripts; we should not regress here unless we have good reasons - checks for S_ISREG; if we want to get rid of this, we'd need to change all callers who already made the assumption when depending on Path V1. llvm-svn: 184074
* Replace use of PathV1.h in Program.cpp.Rafael Espindola2013-06-141-0/+7
| | | | llvm-svn: 183996
* <rdar://problem/13551789> Fix yet another race in unique_file.Douglas Gregor2013-04-051-3/+1
| | | | | | | | | If the directory that will contain the unique file doesn't exist when we tried to create the file, but another process creates it before we get a chance to try creating it, we would bail out rather than try to create the unique file. llvm-svn: 178908
* [Support] Fix lifetime of file descriptors when using MemoryBuffer.Michael J. Spencer2013-03-141-7/+10
| | | | | | | Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file descriptor passed in. So don't. llvm-svn: 176995
* [PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an ↵Argyrios Kyrtzidis2013-02-281-1/+7
| | | | | | | | | | | infinite loop by constantly trying to create the parent path. This can happen if the path is a relative filename and the current directory was removed. Thanks to Daniel D. for the hint in fixing it. llvm-svn: 176226
* Fix a race condition in llvm::sys::path::unique_file: when we end upDouglas Gregor2013-01-101-4/+7
| | | | | | | failing to create the unique file because the path doesn't exist, don't fail if someone else manages to create the path before we do. llvm-svn: 172032
* Go ahead and get rid of the old page size interface and convert all theChandler Carruth2012-12-311-1/+1
| | | | | | | users over to the new one. No sense maintaining this "compatibility" layer it seems. llvm-svn: 171331
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-301-1/+1
| | | | | | | | | | | | | | Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. llvm-svn: 168996
* PathV2: Fix a possible infinite loop.Daniel Dunbar2012-11-151-3/+4
| | | | | | | | | | - The code could infinite loop trying to create unique files, if the directory containing the unique file exists, but open() calls on non-existent files in the path return ENOENT. This is true on the /dev/fd filesystem, for example. - Will add a clang side test case for this. llvm-svn: 168081
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-151-1/+1
| | | | llvm-svn: 161978
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-151-0/+112
| | | | llvm-svn: 161976
* stdcxx's cstdio doesn't include stdio.h, but the code using PathV2.incJoerg Sonnenberger2012-08-101-0/+6
| | | | | | includes both. Deal with feof and ferror potentially being macros. llvm-svn: 161658
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-201-7/+71
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. llvm-svn: 158770
* Use access(2) instead of stat(2) to check if a file exists.Benjamin Kramer2012-06-021-2/+1
| | | | | | | | | | | Apart from being slightly cheaper, this fixes a real bug that hits 32 bit linux systems. When passing a file larger than 2G to be linked (which isn't that uncommon with large projects such as WebKit), clang's driver checks if the file exists but the file size doesn't fit in an off_t and stat(2) fails with EOVERFLOW. Clang then says that the file doesn't exist instead of passing it to the linker. llvm-svn: 157891
* Allow unique_file to take a mode for file permissions, but defaultEric Christopher2012-05-111-3/+4
| | | | | | | | to user only read/write. Part of rdar://11325849 llvm-svn: 156591
* [Support] Fix up comments.Daniel Dunbar2012-05-051-5/+3
| | | | llvm-svn: 156239
* [Support] Rewrite sys::fs::unique_file to not be stupid with /dev/urandom.Daniel Dunbar2012-05-051-19/+5
| | | | | | | | - Just use sys::Process::GetRandomNumber instead of having two poor implementations. - This is ~70 times (!) faster on my OS X machine. llvm-svn: 156238
* Conflict with st_dev/st_ino identifiers under Debian GNU/HurdSylvestre Ledru2012-04-231-4/+4
| | | | | | | | | | | | | The problem is that the struct file_status on UNIX systems has two members called st_dev and st_ino; those are also members of the struct stat, and they are reserved identifiers which can also be provided as #define (and this is the case for st_dev on Hurd). The solution (attached) is to rename them, for example adding a "fs_" prefix (= file status) to them. Patch by Pino Toscano llvm-svn: 155354
* Fix the build under Debian GNU/Hurd.Sylvestre Ledru2012-04-111-0/+10
| | | | | | Thanks to Pino Toscano for the patch llvm-svn: 154500
* Change default error_code ctor to a 'named ctor' so it's more self-documenting.David Blaikie2012-02-091-17/+17
| | | | | | | | | | | Unify default construction of error_code uses on this idiom so that users don't feel compelled to make static globals for naming convenience. (unfortunately I couldn't make the original ctor private as some APIs don't return their result, instead using an out parameter (that makes sense to default construct) - which is a bit of a pity. I did, however, find/fix some cases of unnecessary default construction of error_code before I hit the unfixable cases) llvm-svn: 150197
* Revert r146363 to allow buildbots to make forward progress.Chad Rosier2011-12-121-7/+0
| | | | | | | Original commit message: Support/FileSystem: Implement canonicalize. llvm-svn: 146378
* Support/FileSystem: Implement bool equivalent(file_status A, file_status B);Michael J. Spencer2011-12-121-21/+13
| | | | llvm-svn: 146364
* Support/FileSystem: Implement canonicalize.Michael J. Spencer2011-12-121-0/+7
| | | | llvm-svn: 146363
* Support/FileSystem: Implement recursive_directory_iterator and makeMichael J. Spencer2011-12-081-3/+4
| | | | | | directory_iterator preserve InputIterator semantics on copy. llvm-svn: 146200
* Include limits.h to make sure PATH_MAX is known on Solaris 10.Bill Wendling2011-09-141-0/+3
| | | | | | Patch by Joakim Johansson! llvm-svn: 139743
* Add an optional 'bool makeAbsolute' in llvm::sys::fs::unique_file function.Argyrios Kyrtzidis2011-07-281-8/+11
| | | | | | | If true and 'model' parameter is not an absolute path, a temp directory will be prepended. Make it true by default to match current behaviour. llvm-svn: 136310
* revert r128199 until it can be made to work with Frontend/dependency-gen.c.Andrew Trick2011-03-241-5/+9
| | | | llvm-svn: 128218
* Remove all uses of PATH_MAX and MAXPATHLEN from PathV2.Michael J. Spencer2011-03-241-9/+5
| | | | llvm-svn: 128199
* Rip out realpath() support. It's expensive, and often a bad idea, andDouglas Gregor2011-02-091-30/+0
| | | | | | I have another way to achieve the same goal. llvm-svn: 125239
* Attempt to fix the build after r125228.Cameron Zwarich2011-02-091-2/+2
| | | | llvm-svn: 125236
* Add llvm::sys::path::canonical(), which provides the canonicalizedDouglas Gregor2011-02-091-0/+30
| | | | | | | | | | name of a path, after resolving symbolic links and eliminating excess path elements such as "foo/../" and "./". This routine still needs a Windows implementation, but I don't have a Windows machine available. Help? Please? llvm-svn: 125228
* Fix rename.Michael J. Spencer2011-01-161-2/+11
| | | | llvm-svn: 123604
* Support/PathV2: Implement get_magic.Michael J. Spencer2011-01-151-0/+31
| | | | llvm-svn: 123544
* Support/PathV2: Implement directory iteration on POSIX.Michael J. Spencer2011-01-051-0/+54
| | | | llvm-svn: 122879
* Support/PathV2: Change most functions in the path namespace to return their workMichael J. Spencer2010-12-071-2/+1
| | | | | | via their return value instead of an out parameter. llvm-svn: 121149
OpenPOWER on IntegriCloud