summaryrefslogtreecommitdiff
path: root/lib/Support/FileUtilities.cpp
Commit message (Collapse)AuthorAge
* MemoryBuffer::getFile handles zero sized files, no need to duplicate the test.Rafael Espindola2013-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186018 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a use of PathV1.h.Rafael Espindola2013-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183982 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PathV1.h in FileUtilities.h.Rafael Espindola2013-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183941 91177308-0d34-0410-b5e6-96231b3b80d8
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-12
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Change default error_code ctor to a 'named ctor' so it's more self-documenting.David Blaikie2012-02-09
| | | | | | | | | | | 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150197 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-16
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace.Michael J. Spencer2010-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121382 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-09
| | | | | | error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* fpcmp: Fix bug where fpcmp wouldn't early exit when files obviously differ andDaniel Dunbar2010-06-15
| | | | | | no tolerance is set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106033 91177308-0d34-0410-b5e6-96231b3b80d8
* fpcmp: Fix a possible infinite loop when comparing something like:Daniel Dunbar2010-06-15
| | | | | | | | | 1..19 ok to 1..20 o k (yes, the odd space is necessary). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106032 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert some users of ftostr to raw_ostream.Benjamin Kramer2010-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94808 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the MemoryBuffer::getFile* methods to take just a pointer to theChris Lattner2008-04-01
| | | | | | | | | start of a filename, not a filename+length. All clients can produce a null terminated name, and the system api's require null terminated strings anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
* Change DiffFilesWithTolerance to be written in terms of MemoryBuffer,Chris Lattner2008-04-01
| | | | | | | | | not an mmapped file. This more closely matches its requirements and provides an implicitly null terminated buffer, something this routine had to emulate itself before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49024 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MappedFile support for mapping files for write and execChris Lattner2008-04-01
| | | | | | | | and shared. This complicates the design, is not used, and probably doesn't even work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49022 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-20
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the code and fix a typo.Lauro Ramos Venancio2008-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46458 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix fpcmp infinite loop when comparing "29-266" with "29-268".Lauro Ramos Venancio2008-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46455 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1291:Reid Spencer2007-04-07
| | | | | | | | Change uses of sys::Path class to sys::PathWithStatus in those places where the file status information is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35743 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR789:Reid Spencer2007-03-29
| | | | | | | | | Make the sys::Path::getFileStatus function more efficient by having it return a pointer to the FileStatus structure rather than copy it. Adjust uses of the function accordingly. Also, fix some memory issues in sys::Path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR789:Reid Spencer2007-03-29
| | | | | | | Updates for change in interface of getFileStatus method of sys::Path class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35458 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the absolute/relative tolerance information easier to read/understand.Reid Spencer2006-11-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31908 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant <cmath>.Jim Laskey2006-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
* Beef up the output from DiffFilesWithTolerance by setting the error codeReid Spencer2006-10-18
| | | | | | | | to describe the difference being reported. This assists with understanding differences an llvm-test and should help with bugpoint too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31044 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-23
| | | | | | | | Final remove of exception handling from this file. lib/System can no longer throw exceptions so there's no need for try/catch blocks here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29848 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-22
| | | | | | | | | | | Adjust users of MappedFile to its new non-throwing interface. Note that in most cases the lazy step of just throwing after a call to MappedFile was installed. This was done in the name of incremental changes. Getting rid of the new throw statements will take adjustment of interfaces and propagation of errors to higher levels. Those changes will come in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29817 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Path::getStatusInfo to return a boolean and error string on an errorChris Lattner2006-07-28
| | | | | | | | | instead of throwing an exception. This reduces the amount of code that is exposed to exceptions (e.g. FileUtilities), though it is clearly only one step along the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29395 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR777:Reid Spencer2006-05-15
| | | | | | | | Add an additional catch block to ensure that this function can't throw any exceptions, even one's we're not expecting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28309 91177308-0d34-0410-b5e6-96231b3b80d8
* 200.sixtrack prints FP numbers with a very strange notation that uses DChris Lattner2005-08-02
| | | | | | | | instead of E for exponentials (e.g. 1.234D-43). Add support for this notation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22574 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we would consider " .99" and "1.0" different because of theChris Lattner2005-03-17
| | | | | | | leading whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20647 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of doing a manual comparison loop, just use memcmp, thanks to JohnCChris Lattner2005-02-15
| | | | | | | for the suggestion! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20203 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this more efficient now that we know both files are the same length.Chris Lattner2005-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20202 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spellingMisha Brukman2005-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20201 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust DiffFilesWithTolerance to help poor cygwin's mmap facility byReid Spencer2005-02-15
| | | | | | | | | | | handling zero length files a little more intelligently. If both files are zero length then we return 0 (true) indicating a match. If only one of the files is zero length then we return 1 (false) indicating that the files differ. If the files don't agree in length then they can't match so we skip the first loop that looks for a quick match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20200 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash comparing empty file against nonempty file.Chris Lattner2005-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19782 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DiffFilesWithTolerance take sys::Path's instead of std::stringsChris Lattner2005-01-23
| | | | | | | Delete dead functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19771 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in previous checkinChris Lattner2005-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19769 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new method, refactored out of fpcmpChris Lattner2005-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19766 91177308-0d34-0410-b5e6-96231b3b80d8
* Use binary mode for reading/writing bytecode filesJeff Cohen2005-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-22
| | | | | | | Move non-portable FDHandle class to its only user: lib/Debugger git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19106 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-16
| | | | | | | | | * Remove the "removeFile" function, now implemented by the sys::Path::destroyFile method. * Make the FileRemove work with a sys::Path instead of a std::string git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18999 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-15
| | | | | | | | Remove getUniqueFilename and CopyFile. These are now implemented by sys::Path::makeUnique and sys::CopyFile, respectively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18946 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-13
| | | | | | | | | Remove the MakeFileReadable and MakeFileExecutable functions which are no longer present in LLVM. They have been replaced with the sys::Path methods makeReadable and makeExecutable, respectively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18910 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-13
| | | | | | | | | The ReadFileIntoAddressSpace and UnmapFileFromAddressSpace functions are no longer used by LLVM. Remove them. Replacement functionality for both functions is now encapsulated in the sys::MappedFile class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18903 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351: \Reid Spencer2004-12-13
| | | | | | | | | The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18892 91177308-0d34-0410-b5e6-96231b3b80d8