summaryrefslogtreecommitdiff
path: root/include/llvm/Support/FileSystem.h
Commit message (Collapse)AuthorAge
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-15
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194852 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove declared but not implemented function.Rafael Espindola2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193637 91177308-0d34-0410-b5e6-96231b3b80d8
* Speling fixes.Benjamin Kramer2013-10-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193165 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/FileSystem.h: Remove a trailing comma in enum file_magic::Impl.NAKAMURA Takumi2013-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192745 91177308-0d34-0410-b5e6-96231b3b80d8
* Path: Recognize Windows compiled resource file.Rui Ueyama2013-10-15
| | | | | | | | | | | | | | Some background: One can pass compiled resource files (.res files) directly to the linker on Windows. If a resource file is given, the linker will run "cvtres" command in background to convert the resource file to a COFF file to link it. What I'm trying to do with this patch is to make the linker to recognize the resource file by file magic, so that it can run cvtres command. Differential Revision: http://llvm-reviews.chandlerc.com/D1943 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192742 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in assert message.Nick Lewycky2013-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190034 91177308-0d34-0410-b5e6-96231b3b80d8
* Make directory iterator sentinels free.Benjamin Kramer2013-08-09
| | | | | | | This trades some complexity in operator== for not introducing static objects into any functions using recursive directory iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188081 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose that the unique file ID has a device and a file component.Rafael Espindola2013-08-01
| | | | | | | The use of sd_dev and st_ino has reached libclang, so expose the two components in UniqueID so that we can use it in clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187616 91177308-0d34-0410-b5e6-96231b3b80d8
* Make file_status::getUniqueID const.Rafael Espindola2013-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187383 91177308-0d34-0410-b5e6-96231b3b80d8
* Include st_dev to make the result of getUniqueID actually unique.Rafael Espindola2013-07-29
| | | | | | This will let us use getUniqueID instead of st_dev directly on clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187378 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Rafael Espindola2013-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186561 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simpler version of is_directory. It will be used in clang.Rafael Espindola2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186486 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a wrapper for open.Rafael Espindola2013-07-16
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186447 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a version of sys::fs::status that uses fstat.Rafael Espindola2013-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186378 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead friending status, provide windows and posix constructors to file_status.Rafael Espindola2013-07-16
| | | | | | | This opens the way of having static helpers in the .inc files that can construct a file_status. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186376 91177308-0d34-0410-b5e6-96231b3b80d8
* Update doxygen comment to match renamed parameters.Benjamin Kramer2013-07-10
| | | | | | Found by -Wdocumentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186021 91177308-0d34-0410-b5e6-96231b3b80d8
* Use status to implement file_size.Rafael Espindola2013-07-10
| | | | | | | | | | The status function is already using a syscall that returns the file size. Remember it and implement file_size as a simple wrapper. No functionally change, but clients that already use status now can avoid calling file_size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186016 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format this enum.Rafael Espindola2013-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185835 91177308-0d34-0410-b5e6-96231b3b80d8
* We now always create files with the correct permissions. Simplify the interface.Rafael Espindola2013-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185834 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unique_file now that it is unused.Rafael Espindola2013-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185728 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-05
| | | | | | | | | | | | | | This function is complementary to createTemporaryFile. It handles the case were the unique file is *not* temporary: we will rename it in the end. Since we will rename it, the file has to be in the same filesystem as the final destination and we don't prepend the system temporary directory. This has a small semantic difference from unique_file: the default mode is 0666. This matches the behavior of most unix tools. For example, with this change lld now produces files with the same permissions as ld. I will add a test of this change when I port clang over to createUniqueFile (next commit). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185726 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a higher level createTemporaryFile function.Rafael Espindola2013-07-05
| | | | | | | | This function is inspired by clang's Driver::GetTemporaryPath. It hides the pattern used for uniquing and requires simple file names that are always placed in the system temporary directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185716 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't ask for a mode when we are not keeping the file.Rafael Espindola2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185123 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typoMatt Arsenault2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185120 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a convenience createUniqueDirectory function.Rafael Espindola2013-06-27
| | | | | | | | | | | There are a few valid situation where we care about the structure inside a directory, but not about the directory itself. A simple example is for unit testing directory traversal. PathV1 had a function like this, add one to V2 and port existing users of the created temp file and delete it hack to using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185059 91177308-0d34-0410-b5e6-96231b3b80d8
* Use enums instead of raw octal values.Rafael Espindola2013-06-26
| | | | | | Patch by 罗勇刚(Yonggang Luo). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184971 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a convenience functions that don't return if the directory existed.Rafael Espindola2013-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184955 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a simpler version of remove_all.Rafael Espindola2013-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184919 91177308-0d34-0410-b5e6-96231b3b80d8
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-26
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184914 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a simpler version of is_regular_file.Rafael Espindola2013-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184764 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove last use of PathV1.h from Archive.cpp.Rafael Espindola2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184484 91177308-0d34-0410-b5e6-96231b3b80d8
* make getLastModificationTime const. Move it with the other getters.Rafael Espindola2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184478 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a setLastModificationAndAccessTime to PathV2.Rafael Espindola2013-06-20
| | | | | | With this we can remove the last use of PathV1 from llvm-ar.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184464 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for getting the last modification time from a file_status.Rafael Espindola2013-06-20
| | | | | | Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184450 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the transitional GetUniqueID.Rafael Espindola2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184433 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.Rafael Espindola2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184431 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified the implementation of fs::GetUniqueID on Windows such that it ↵Aaron Ballman2013-06-19
| | | | | | actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184351 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a can_write function to PathV2.Rafael Espindola2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184233 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a GetUniqueID that will replace the uniqueID of PathV1.h.Rafael Espindola2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184217 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a version of unique_file that return just the file name.Rafael Espindola2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184206 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic support for parsing Mach-O universal binaries in LLVMObject libraryAlexey Samsonov2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184191 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1.h in LTOCodeGenerator.cppRafael Espindola2013-06-17
| | | | | | | This patch also adds a simpler version of sys::fs::remove and a tool_output_file constructor for when we already have an open file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184095 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete declared but not implemented functions.Rafael Espindola2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184087 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace use of PathV1.h in Program.cpp.Rafael Espindola2013-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183996 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove sys::identifyFileType.Rafael Espindola2013-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183763 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix variable name style. Don't cast to and from int.Rafael Espindola2013-06-11
| | | | | | | This enables the compiler to see the enum and produce warnings about a switch not being fully covered. Fix one of these warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183749 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing 'e'.Rafael Espindola2013-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183692 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Fix lifetime of file descriptors when using MemoryBuffer.Michael J. Spencer2013-03-14
| | | | | | | Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file descriptor passed in. So don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176995 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix include guards so they exactly match file names.Jakub Staszak2013-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-30
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168996 91177308-0d34-0410-b5e6-96231b3b80d8