Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add missing standard headers. Patch by Joerg Sonnenberger! | Nick Lewycky | 2010-12-19 | 1 | -0/+1 |
| | | | | llvm-svn: 122193 | ||||
* | MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵ | Michael J. Spencer | 2010-12-16 | 1 | -34/+38 |
| | | | | | | via an out parm. llvm-svn: 121958 | ||||
* | Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵ | Michael J. Spencer | 2010-12-09 | 1 | -18/+20 |
| | | | | | | error_code &ec. And fix clients. llvm-svn: 121379 | ||||
* | Merge System into Support. | Michael J. Spencer | 2010-11-29 | 1 | -9/+9 |
| | | | | llvm-svn: 120298 | ||||
* | add a MemoryBuffer::getOpenFile method, which turns an open | Chris Lattner | 2010-11-23 | 1 | -0/+7 |
| | | | | | | file descriptor into a MemoryBuffer (and closes the FD). llvm-svn: 120065 | ||||
* | Revert functionality doug added in r98575 that was never | Chris Lattner | 2010-11-23 | 1 | -15/+11 |
| | | | | | | documented and only used by some clang stuff I just removed. llvm-svn: 120002 | ||||
* | Rewrite MemoryBuffer::getSTDIN to use read(2) and a SmallVector buffer. | Benjamin Kramer | 2010-06-25 | 1 | -15/+15 |
| | | | | llvm-svn: 106856 | ||||
* | Bring back the empty vector workaround I removed in r106839. Looks like MSVC ↵ | Benjamin Kramer | 2010-06-25 | 1 | -1/+2 |
| | | | | | | needs it. llvm-svn: 106841 | ||||
* | Tweak MemoryBuffer to allocate the class itself, the name and possibly the | Benjamin Kramer | 2010-06-25 | 1 | -70/+60 |
| | | | | | | | | | | buffer in the same chunk of memory. 2 less mallocs for every uninitialized MemoryBuffer and 1 less malloc for every MemoryBuffer pointing to a memory range translate into 20% less mallocs on clang -cc1 -Eonly Cocoa_h.m. llvm-svn: 106839 | ||||
* | Add overloads for getFile and getFileOrSTDIN which take a const char * | Dan Gohman | 2010-06-24 | 1 | -3/+17 |
| | | | | | | | instead of a StringRef, avoiding the need to copy the string in the common case. llvm-svn: 106754 | ||||
* | Add an explicit keyword. | Dan Gohman | 2010-06-22 | 1 | -1/+1 |
| | | | | llvm-svn: 106538 | ||||
* | Add basic error checking to MemoryBuffer::getSTDIN. | Dan Gohman | 2010-05-27 | 1 | -2/+7 |
| | | | | llvm-svn: 104855 | ||||
* | stringref-ize the MemoryBuffer::get apis. This requires | Chris Lattner | 2010-04-05 | 1 | -11/+8 |
| | | | | | | a co-committed clang patch. llvm-svn: 100485 | ||||
* | Remove accidental include and add a comment. | Benjamin Kramer | 2010-04-01 | 1 | -2/+2 |
| | | | | llvm-svn: 100107 | ||||
* | Various improvements to MemoryBuffer::getFile: | Benjamin Kramer | 2010-04-01 | 1 | -17/+26 |
| | | | | | | | | | | - Use a RAII object to close the FD. - Use sys::StrError instead of thread-unsafe strerror calls. - Recover gracefully if read returns zero. This works around an issue on DragonFlyBSD where /dev/null has an st_size of 136 but we can't read 136 bytes from it. llvm-svn: 100106 | ||||
* | Extend MemoryBuffer::getFile() to take an optional "stat" structure | Douglas Gregor | 2010-03-15 | 1 | -7/+10 |
| | | | | | | | pointer. If given, the structure will be set with the stat information from the file actually read. llvm-svn: 98575 | ||||
* | Replace a temporary std::string with SmallString. | Benjamin Kramer | 2010-02-26 | 1 | -1/+2 |
| | | | | llvm-svn: 97259 | ||||
* | sizeof(char) is always 1. | Chris Lattner | 2009-12-23 | 1 | -2/+2 |
| | | | | llvm-svn: 92079 | ||||
* | return more useful error messages by using strerror to format errno | Chris Lattner | 2009-12-01 | 1 | -3/+3 |
| | | | | | | instead of returning an ambiguous reason. llvm-svn: 90275 | ||||
* | Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a ↵ | Daniel Dunbar | 2009-11-10 | 1 | -16/+14 |
| | | | | | | | | lame API. Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs. llvm-svn: 86630 | ||||
* | A value is only assigned to errno if NumRead equals -1, so do | Duncan Sands | 2009-11-04 | 1 | -1/+1 |
| | | | | | | not reason based on errno if NumRead has a different value. llvm-svn: 86046 | ||||
* | Make this code more robust by not thinking we are making progress | Duncan Sands | 2009-11-03 | 1 | -1/+1 |
| | | | | | | if zero bytes were read. llvm-svn: 85922 | ||||
* | Tweak MemoryBuffer::getSTDIN so that it returns after the first EOF. | Eli Friedman | 2009-05-18 | 1 | -3/+6 |
| | | | | | | | It doesn't matter for piped input, but it's annoying when typing at the console. llvm-svn: 71998 | ||||
* | Switch from new[] + delete[] to malloc + free since llvm does not catch C++ ↵ | Evan Cheng | 2009-02-13 | 1 | -3/+3 |
| | | | | | | exceptions. llvm-svn: 64448 | ||||
* | If new[] fails, return 0 rather then trying to dereference a null pointer. | Evan Cheng | 2009-02-13 | 1 | -3/+12 |
| | | | | llvm-svn: 64444 | ||||
* | Fix more -Wshorten-64-to-32 warnings. | Evan Cheng | 2008-05-05 | 1 | -3/+3 |
| | | | | llvm-svn: 50659 | ||||
* | fcntl.h is pretty standard on unix (without the sys/) | Gabor Greif | 2008-04-30 | 1 | -2/+1 |
| | | | | llvm-svn: 50475 | ||||
* | Fix compilation errors on MSVC. Patch by Argiris Kirtzidis! | Bill Wendling | 2008-04-01 | 1 | -1/+2 |
| | | | | llvm-svn: 49055 | ||||
* | Change the MemoryBuffer::getFile* methods to take just a pointer to the | Chris Lattner | 2008-04-01 | 1 | -13/+8 |
| | | | | | | | | 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. llvm-svn: 49041 | ||||
* | Reimplement MemoryBuffer::getFile with three enhancements: | Chris Lattner | 2008-04-01 | 1 | -85/+64 |
| | | | | | | | | | | | | | | | | | | | | | 1) stop using MappedFile. 2) if profitable use the sys::path::MapInFilePages api to read the file. 3) otherwise fallback to read. When sys::path::MapInFilePages is implemented, this provides several benefits: #1: this avoids fragmenting memory for small files. #2: this avoids extraneous stat calls when the file size is known. #3: this only keeps the file descriptor open while reading the file, not for the duration of the lifetime of the memory buffer. This fixes a serious clang FD 'leak' problem. I believe that this will work on a win32 machine, but I don't have one to test on. I'd appreciate it if someone could check. llvm-svn: 49031 | ||||
* | Remove the MappedFile::charBase member, rename base -> getBase() and | Chris Lattner | 2008-04-01 | 1 | -3/+4 |
| | | | | | | make getBase() return a const-correct pointer. llvm-svn: 49025 | ||||
* | Remove MappedFile support for mapping files for write and exec | Chris Lattner | 2008-04-01 | 1 | -1/+1 |
| | | | | | | | and shared. This complicates the design, is not used, and probably doesn't even work. llvm-svn: 49022 | ||||
* | Remove attribution from file headers, per discussion on llvmdev. | Chris Lattner | 2007-12-29 | 1 | -2/+2 |
| | | | | llvm-svn: 45418 | ||||
* | Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN ↵ | Chris Lattner | 2007-11-18 | 1 | -0/+18 |
| | | | | | | | | return a valid but empty buffer if stdin is empty. llvm-svn: 44219 | ||||
* | Add new MemoryBuffer::getMemBufferCopy method. | Chris Lattner | 2007-10-09 | 1 | -2/+15 |
| | | | | llvm-svn: 42815 | ||||
* | Make getSTDIN return null if the standard input is empty, as the header file | Reid Spencer | 2007-08-08 | 1 | -2/+4 |
| | | | | | | documentation implies and as its uses depend. llvm-svn: 40939 | ||||
* | Fix undefined behaviour reported by the new --enable-expensive-checks option. | Nick Lewycky | 2007-07-01 | 1 | -1/+2 |
| | | | | llvm-svn: 37829 | ||||
* | fix a memory leak | Chris Lattner | 2007-05-11 | 1 | -1/+1 |
| | | | | llvm-svn: 36981 | ||||
* | Unbreak VC++ build. | Jeff Cohen | 2007-05-07 | 1 | -0/+2 |
| | | | | llvm-svn: 36901 | ||||
* | Enhance MemoryBuffer to return error messages in strings if they occur. | Chris Lattner | 2007-05-06 | 1 | -7/+11 |
| | | | | llvm-svn: 36899 | ||||
* | Fix MemoryBuffer::getFile to return null if it has an error opening the | Chris Lattner | 2007-05-06 | 1 | -8/+20 |
| | | | | | | file instead of aborting. llvm-svn: 36858 | ||||
* | Fix MemoryBuffer breakage correctly. | Jeff Cohen | 2007-04-29 | 1 | -1/+1 |
| | | | | llvm-svn: 36561 | ||||
* | Unbreak build. | Jeff Cohen | 2007-04-29 | 1 | -1/+2 |
| | | | | llvm-svn: 36559 | ||||
* | Add a new memorybuffer class, to unify all the file reading code in the system | Chris Lattner | 2007-04-29 | 1 | -0/+239 |
llvm-svn: 36553 |