summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unique_file now that it is unused.Rafael Espindola2013-07-051-17/+0
| | | | llvm-svn: 185728
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-051-0/+11
| | | | | | | | | | | | | | 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). llvm-svn: 185726
* Add a higher level createTemporaryFile function.Rafael Espindola2013-07-051-0/+34
| | | | | | | | 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. llvm-svn: 185716
* Improve comment.Rafael Espindola2013-06-281-4/+3
| | | | llvm-svn: 185141
* Improvements to unique_file and createUniqueDirectory.Rafael Espindola2013-06-281-20/+31
| | | | | | | | | | | | | | | | | | | * Don't try to create parent directories in unique_file. It had two problem: * It violates the contract that it is atomic. If the directory creation success and the file creation fails, we would return an error but the file system was modified. * When creating a temporary file clang would have to first check if the parent directory existed or not to avoid creating one when it was not supposed to. * More efficient implementations of createUniqueDirectory and the unique_file that produces only the file name. Now all 3 just call into a static function passing what they want (name, file or directory). Clang also has to be updated, so tests might fail if a bot picks up this commit and not the corresponding clang one. llvm-svn: 185126
* Don't ask for a mode when we are not keeping the file.Rafael Espindola2013-06-281-2/+2
| | | | llvm-svn: 185123
* Add a convenience createUniqueDirectory function.Rafael Espindola2013-06-271-0/+11
| | | | | | | | | | | 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 PathV2 to just Path now that it is the only one.Rafael Espindola2013-06-261-0/+969
| | | | llvm-svn: 185015
* PathV1 is deprecated since the 18th of Dec 2010. Remove it.Rafael Espindola2013-06-261-78/+0
| | | | llvm-svn: 184960
* Remove Path::isObjectFile.Rafael Espindola2013-06-191-8/+0
| | | | llvm-svn: 184305
* Inline Path::isBitcodeFile into only use and remove it.Rafael Espindola2013-06-121-8/+0
| | | | llvm-svn: 183840
* Remove Path::hasMagicNumber.Rafael Espindola2013-06-121-7/+0
| | | | llvm-svn: 183838
* Include PathV1.h in files that use it.Rafael Espindola2013-06-111-0/+1
| | | | | | This is preparation for replacing Path.h with PathV2.h. llvm-svn: 183782
* Remove Path::getDirname.Rafael Espindola2013-06-111-40/+0
| | | | llvm-svn: 183780
* Remove GetDLLSuffix.Rafael Espindola2013-06-111-4/+0
| | | | llvm-svn: 183777
* Remove GetSystemLibraryPaths.Rafael Espindola2013-06-111-19/+0
| | | | llvm-svn: 183770
* Remove unused FindLibrary function.Rafael Espindola2013-06-111-17/+0
| | | | llvm-svn: 183764
* Remove sys::identifyFileType.Rafael Espindola2013-06-111-117/+0
| | | | llvm-svn: 183763
* Pass a StringRef to sys::identifyFileType.Rafael Espindola2013-06-101-6/+6
| | | | llvm-svn: 183669
* Fix an out of bounds array access.Rafael Espindola2013-06-101-2/+3
| | | | | | | We were looking at Magic[5] without checking Length. Since this path would not return unless Length >= 18 anyway, just move the >= 18 check up. llvm-svn: 183666
* Update for current naming conventions.Rafael Espindola2013-06-101-30/+31
| | | | | | I will change identifyFileType to use a StringRef in the next patch. llvm-svn: 183664
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170902
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* PR13013: ELF Type identification fails for MSB type ELF files.Meador Inge2012-06-251-2/+5
| | | | | | | | | Fix 'sys::IdentifyFileType' to work with big and little endian byte orderings when reading the ELF object file type. Initial patch by Stefan Hepp. llvm-svn: 159138
* Support/FileSystem: Add file_magic and move a vew clients over to it.Michael J. Spencer2011-12-131-12/+12
| | | | llvm-svn: 146523
* Cleanup whitespace.Michael J. Spencer2011-12-131-1/+1
| | | | llvm-svn: 146521
* Remove a couple unused methods. PR11201.Eli Friedman2011-11-011-10/+0
| | | | llvm-svn: 143452
* ObjectFile: Add support for mach-o-style dSYM companion files.Benjamin Kramer2011-09-141-1/+1
| | | | llvm-svn: 139676
* Add support for 64-bit object files to Path.Eric Christopher2011-04-221-4/+10
| | | | llvm-svn: 129975
* Assorted bugfixes in object file handling:Eric Christopher2011-04-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | | - Adds support for sniffing PE/COFF files on win32 (.exe and .dll) which are COFF files that have an MS-DOS compatibility stub on the front of them. - Fixes a bug in the COFFObjectFile's support for the Microsoft COFF extension for long symbol names, wherein it was attempting to parse the leading '/' in an extended symbol name reference as part of the integer offset. - Fixes bugs in COFFObjectFile and ELFObjectFile wherein section and symbol iterators were being returned with uninitialized bytes; the type DataRefImpl is a union between 2 32-bit words (d.a and d.b) and a single intptr_t word (p). Only p was being initialized, so in 32-bit builds the result would be iterators with random upper 32-bit words in their DataRefImpls. This caused random failures when seeking around in object files. Patch by Graydon Hoare! llvm-svn: 128799
* Support/PathV2: Add identify_magic.Michael J. Spencer2011-01-151-34/+23
| | | | llvm-svn: 123548
* Support/Path: Deprecate PathV1::exists and replace all uses with ↵Michael J. Spencer2011-01-101-0/+1
| | | | | | PathV2::fs::exists. llvm-svn: 123151
* Support/Path: Deprecate Path::hasMagicNumber and replace all uses with ↵Michael J. Spencer2010-12-281-1/+5
| | | | | | fs::has_magic. llvm-svn: 122589
* Delete Path::appendSuffix's return value; it wasn't used anywhere, whichDan Gohman2010-12-011-8/+1
| | | | | | is fine since isn't really necessary to check isValid there anyway. llvm-svn: 120538
* Merge System into Support.Michael J. Spencer2010-11-291-0/+296
llvm-svn: 120298
OpenPOWER on IntegriCloud