projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Move the resize file feature from mapped_file_region to the only user.
[oota-llvm.git]
/
lib
/
Support
/
FileOutputBuffer.cpp
diff --git
a/lib/Support/FileOutputBuffer.cpp
b/lib/Support/FileOutputBuffer.cpp
index e6e4da346520cfb53e585fb7118d6bd58dbfd7b1..df4ae9322bcdffdc486c7617a4a236f16d656bcd 100644
(file)
--- a/
lib/Support/FileOutputBuffer.cpp
+++ b/
lib/Support/FileOutputBuffer.cpp
@@
-77,6
+77,10
@@
FileOutputBuffer::create(StringRef FilePath, size_t Size,
if (EC)
return EC;
+ EC = sys::fs::resize_file(FD, Size);
+ if (EC)
+ return EC;
+
auto MappedFile = llvm::make_unique<mapped_file_region>(
FD, mapped_file_region::readwrite, Size, 0, EC);
int Ret = close(FD);