summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-01 06:05:21 +0000
committerChris Lattner <sabre@nondot.org>2008-04-01 06:05:21 +0000
commita542518315c1200b35ac17a90c5c7d560d42ef14 (patch)
treed6dd8c065994acd6c056d2766c3c758240807dc8 /clang/lib/Basic/SourceManager.cpp
parent3089e1d82e7560026831296b78b079bfce7dde19 (diff)
downloadbcm5719-llvm-a542518315c1200b35ac17a90c5c7d560d42ef14.tar.gz
bcm5719-llvm-a542518315c1200b35ac17a90c5c7d560d42ef14.zip
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
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud