llvm-mirror/lib/Support
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
..
Allocator.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Annotation.cpp Add explicit keywords. 2008-02-20 16:44:09 +00:00
APFloat.cpp Add a method to APFloat to convert directly from APInt. 2008-02-29 01:26:11 +00:00
APInt.cpp A quick nm audit turned up several fixed tables and objects that were 2008-03-25 21:45:14 +00:00
APSInt.cpp Added FoldingSet style 'profiling' support for APSInt. 2008-01-19 04:31:12 +00:00
CommandLine.cpp Add explicit keywords. 2008-03-25 22:06:05 +00:00
ConstantRange.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Debug.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Dwarf.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
FileUtilities.cpp Change DiffFilesWithTolerance to be written in terms of MemoryBuffer, 2008-04-01 03:39:49 +00:00
FoldingSet.cpp Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings. 2008-02-20 11:08:44 +00:00
GraphWriter.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
IsInf.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
IsNAN.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Makefile remove attribution from lib Makefiles. 2007-12-29 20:09:26 +00:00
ManagedStatic.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
MemoryBuffer.cpp Reimplement MemoryBuffer::getFile with three enhancements: 2008-04-01 06:05:21 +00:00
PluginLoader.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SlowOperationInformer.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SmallPtrSet.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Statistic.cpp Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings. 2008-02-20 11:08:44 +00:00
Streams.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
StringExtras.cpp Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings. 2008-02-20 11:08:44 +00:00
StringMap.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
StringPool.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
SystemUtils.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Timer.cpp Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00