Evan Cheng
d9353009b7
Fix more -Wshorten-64-to-32 warnings.
...
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Gabor Greif
134707f8e8
fcntl.h is pretty standard on unix (without the sys/)
...
llvm-svn: 50475
2008-04-30 08:53:22 +00:00
Bill Wendling
fb7564e94c
Fix compilation errors on MSVC. Patch by Argiris Kirtzidis!
...
llvm-svn: 49055
2008-04-01 22:09:20 +00:00
Chris Lattner
d141d16ed7
Change the MemoryBuffer::getFile* methods to take just a pointer to the
...
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
2008-04-01 18:04:03 +00:00
Chris Lattner
7f88d9043f
Reimplement MemoryBuffer::getFile with three enhancements:
...
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
2008-04-01 06:05:21 +00:00
Chris Lattner
b29e4e90bc
Remove the MappedFile::charBase member, rename base -> getBase() and
...
make getBase() return a const-correct pointer.
llvm-svn: 49025
2008-04-01 03:40:53 +00:00
Chris Lattner
f2309c208a
Remove MappedFile support for mapping files for write and exec
...
and shared. This complicates the design, is not used, and probably
doesn't even work.
llvm-svn: 49022
2008-04-01 03:10:22 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
56d872fcbb
Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
...
a valid but empty buffer if stdin is empty.
llvm-svn: 44219
2007-11-18 18:52:28 +00:00
Chris Lattner
a65ec649fd
Add new MemoryBuffer::getMemBufferCopy method.
...
llvm-svn: 42815
2007-10-09 21:46:38 +00:00
Reid Spencer
e8aa5a5832
Make getSTDIN return null if the standard input is empty, as the header file
...
documentation implies and as its uses depend.
llvm-svn: 40939
2007-08-08 20:01:58 +00:00
Nick Lewycky
61fa7b9861
Fix undefined behaviour reported by the new --enable-expensive-checks option.
...
llvm-svn: 37829
2007-07-01 03:06:30 +00:00
Chris Lattner
b601311b07
fix a memory leak
...
llvm-svn: 36981
2007-05-11 00:43:26 +00:00
Jeff Cohen
2e8263c013
Unbreak VC++ build.
...
llvm-svn: 36901
2007-05-07 15:21:46 +00:00
Chris Lattner
112d26a164
Enhance MemoryBuffer to return error messages in strings if they occur.
...
llvm-svn: 36899
2007-05-06 23:32:36 +00:00
Chris Lattner
9fa29b4027
Fix MemoryBuffer::getFile to return null if it has an error opening the
...
file instead of aborting.
llvm-svn: 36858
2007-05-06 07:24:46 +00:00
Jeff Cohen
7cfc4b404f
Fix MemoryBuffer breakage correctly.
...
llvm-svn: 36561
2007-04-29 14:43:31 +00:00
Jeff Cohen
349056458a
Unbreak build.
...
llvm-svn: 36559
2007-04-29 14:21:44 +00:00
Chris Lattner
4749cca517
Add a new memorybuffer class, to unify all the file reading code in the system
...
llvm-svn: 36553
2007-04-29 06:58:52 +00:00