summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Path.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-111-0/+37
| | | | | | | | 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/+2
| | | | | | | | | | | | 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
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+2
| | | | | | | | | | 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
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-051-0/+29
| | | | | | | | | When using a //net/ path, we were transforming the trailing / into a '.' when the path was just the root path and we were iterating backwards. Forwards iteration and other kinds of root path (C:\, /) were already correct. llvm-svn: 202999
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-021-1/+1
| | | | | | directly, and remove the macro. llvm-svn: 202612
* [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth2014-03-011-2/+0
| | | | llvm-svn: 202583
* 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
* Fix windows unittest I missed in the raw_fd_ostream constructor change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202050
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-231-17/+24
| | | | | | | | | | | | | | | 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
* Introduce llvm::sys::path::home_directory.Peter Collingbourne2014-01-311-0/+13
| | | | | | | | | 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
* Remove remove_all. A compiler has no need for recursively deleting a directory.Rafael Espindola2014-01-101-2/+15
| | | | llvm-svn: 198955
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-151-0/+2
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
* Recognize 0x0000 as a COFF file magic.Rui Ueyama2013-11-141-0/+2
| | | | | | | | | | | | | | | Summary: Some machine-type-neutral object files containing only undefined symbols actually do exist in the Windows standard library. Need to recognize them as COFF files. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2164 llvm-svn: 194734
* Path: Add tests for existing file magics.Rui Ueyama2013-11-131-6/+36
| | | | llvm-svn: 194607
* Whitespace.Rui Ueyama2013-11-131-3/+3
| | | | llvm-svn: 194605
* Try to fix the build on windows.Rafael Espindola2013-10-251-2/+2
| | | | llvm-svn: 193431
* Fixes a bug when iterating on pathsTareq A. Siraj2013-08-121-0/+69
| | | | | | | | | This fixes the incorrect implementation of iterating on file/directory paths. Differential Review: http://llvm-reviews.chandlerc.com/D1277 llvm-svn: 188183
* Fix windows' implementation of status when a file doesn't exist.Rafael Espindola2013-07-311-0/+4
| | | | | | | | | The unix one was returning no_such_file_or_directory, but the windows one was return success. Update the one one caller that was depending on the old behavior. llvm-svn: 187463
* Implement getUniqueID for directories on windows.Rafael Espindola2013-07-301-0/+13
| | | | llvm-svn: 187441
* Include st_dev to make the result of getUniqueID actually unique.Rafael Espindola2013-07-291-3/+3
| | | | | | This will let us use getUniqueID instead of st_dev directly on clang. llvm-svn: 187378
* Don't end a file name with a dot. It looks odd.Rafael Espindola2013-07-251-0/+5
| | | | llvm-svn: 187124
* Add a unit test for checking that we respect the F_Binary flag.Rafael Espindola2013-07-191-0/+31
| | | | llvm-svn: 186676
* Remove dead code.Rafael Espindola2013-07-181-7/+1
| | | | llvm-svn: 186561
* Add a wrapper for open.Rafael Espindola2013-07-161-2/+1
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). llvm-svn: 186447
* We now always create files with the correct permissions. Simplify the interface.Rafael Espindola2013-07-081-28/+0
| | | | llvm-svn: 185834
* Fix windows build.Rafael Espindola2013-07-051-1/+1
| | | | llvm-svn: 185730
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-7/+7
| | | | llvm-svn: 185719
* Add a convenience createUniqueDirectory function.Rafael Espindola2013-06-271-5/+1
| | | | | | | | | | | 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. llvm-svn: 185059
* Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.Rafael Espindola2013-06-201-4/+4
| | | | llvm-svn: 184431
* Modified the implementation of fs::GetUniqueID on Windows such that it ↵Aaron Ballman2013-06-191-0/+36
| | | | | | actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID. llvm-svn: 184351
* Move PathV2.h to Path.hRafael Espindola2013-06-111-1/+1
| | | | | | | Most clients have already been moved from Path V1 to V2. The ones using V1 now include PathV1.h explicitly. llvm-svn: 183801
* [Support][FileSystem] Fix identify_magic for big endian ELF.Michael J. Spencer2013-04-051-2/+10
| | | | llvm-svn: 178905
* Test case for graceful handling of long file names on Windows. Patch thanks ↵Aaron Ballman2013-03-161-0/+12
| | | | | | to Paul Robinson! llvm-svn: 177223
* [Support][Test] Missed this in the API change.Michael J. Spencer2013-03-141-0/+1
| | | | llvm-svn: 176996
* Sort the #include lines for unittest/...Chandler Carruth2012-12-041-2/+1
| | | | llvm-svn: 169250
* 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
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-151-1/+1
| | | | llvm-svn: 161979
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-151-26/+33
| | | | llvm-svn: 161976
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.NAKAMURA Takumi2012-06-241-0/+2
| | | | llvm-svn: 159099
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.NAKAMURA Takumi2012-06-241-1/+2
| | | | llvm-svn: 159098
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-201-0/+65
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. llvm-svn: 158770
* Revert r146363 to allow buildbots to make forward progress.Chad Rosier2011-12-121-28/+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-0/+8
| | | | llvm-svn: 146364
* Support/FileSystem: Implement canonicalize.Michael J. Spencer2011-12-121-0/+28
| | | | llvm-svn: 146363
* unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for ↵NAKAMURA Takumi2011-12-091-1/+4
| | | | | | | end iterator. FIXME: It should be more robust. llvm-svn: 146294
* unittests/SupportTests: Fix test. pop modifies the current entry, thus theMichael J. Spencer2011-12-091-5/+2
| | | | | | dontlookhere check must be after it. llvm-svn: 146217
* unittests/SupportTests: Add some outs()'s to debug the issues on some bots.Michael J. Spencer2011-12-091-0/+3
| | | | | | | I have run these tests under many configurations on the exact same OS as the failures, and I can't reproduce them :(. llvm-svn: 146214
* Support/FileSystem: Implement recursive_directory_iterator and makeMichael J. Spencer2011-12-081-0/+51
| | | | | | directory_iterator preserve InputIterator semantics on copy. llvm-svn: 146200
* Adds llvm::sys::path::is_separator() to test whether a char is a path separatorZhanyong Wan2011-02-111-0/+13
| | | | | | on the host OS. Reviewed by dgregor. llvm-svn: 125406
* Unittests/Support/Path: Tweak test.Michael J. Spencer2011-01-151-1/+1
| | | | llvm-svn: 123546
OpenPOWER on IntegriCloud