#
e0df357d |
| 08-Nov-2017 |
Rafael Espindola <rafael.espindola@gmail.com> |
Convert FileOutputBuffer to Expected. NFC.
llvm-svn: 317649
|
#
a16fe65b |
| 01-Nov-2017 |
Rui Ueyama <ruiu@google.com> |
Rewrite FileOutputBuffer as two separate classes.
This patch is to rewrite FileOutputBuffer as two separate classes; one for file-backed output buffer and the other for memory-backed output buffer.
Rewrite FileOutputBuffer as two separate classes.
This patch is to rewrite FileOutputBuffer as two separate classes; one for file-backed output buffer and the other for memory-backed output buffer. I think the new code is easier to follow because two different implementations are now actually separated as different classes.
Unlike the previous implementation, the class that does not replace the final output file using rename(2) does not create a temporary file at all. Instead, it allocates memory using mmap(2) and use it. I think this is an improvement because it is now guaranteed that the temporary memory region doesn't trigger any I/O and there's now zero chance to leave a temporary file behind. Also, it shouldn't impose new restrictions because were using mmap IO too.
Differential Revision: https://reviews.llvm.org/D39449
llvm-svn: 317127
show more ...
|
Revision tags: llvmorg-5.0.1-rc1 |
|
#
23fa4de2 |
| 27-Sep-2017 |
Rui Ueyama <ruiu@google.com> |
Do not remove a target file in FileOutputBuffer::create().
FileOutputBuffer::create() attempts to remove a target file if the file is a regular one, which results in an unexpected result in a failur
Do not remove a target file in FileOutputBuffer::create().
FileOutputBuffer::create() attempts to remove a target file if the file is a regular one, which results in an unexpected result in a failure scenario.
If something goes wrong and the user of FileOutputBuffer decides to not call commit(), it leaves nothing. An existing file is removed, and no new file is created.
What we should do is to atomically replace an existing file with a new file using rename(), so that it wouldn't remove an existing file without creating a new one.
Differential Revision: https://reviews.llvm.org/D38283
llvm-svn: 314345
show more ...
|
Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1 |
|
#
fed8b570 |
| 13-Mar-2017 |
Rui Ueyama <ruiu@google.com> |
Make FileOutputBuffer fail early if you pass a directory.
Previously, it created a temporary directory and then failed when FileOutputBuffer tried to rename that file to the destination file (which
Make FileOutputBuffer fail early if you pass a directory.
Previously, it created a temporary directory and then failed when FileOutputBuffer tried to rename that file to the destination file (which is actually a directory name).
Differential Revision: https://reviews.llvm.org/D30912
llvm-svn: 297679
show more ...
|
Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1 |
|
#
d4b24eda |
| 09-Jan-2017 |
Rafael Espindola <rafael.espindola@gmail.com> |
Support outputting to /dev/null.
When writing to a non regular file we cannot rename to it. Since we have to write, we may as well create a temporary file to avoid trying to create an unique file in
Support outputting to /dev/null.
When writing to a non regular file we cannot rename to it. Since we have to write, we may as well create a temporary file to avoid trying to create an unique file in /dev when trying to write to /dev/null.
llvm-svn: 291485
show more ...
|
Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
#
1a4398a1 |
| 02-Sep-2016 |
Reid Kleckner <rnk@google.com> |
Fix a real temp file leak in FileOutputBuffer
If we failed to commit the buffer but did not die to a signal, the temp file would remain on disk on Windows. Having an open file mapping and file handl
Fix a real temp file leak in FileOutputBuffer
If we failed to commit the buffer but did not die to a signal, the temp file would remain on disk on Windows. Having an open file mapping and file handle prevents the file from being deleted. I am choosing not to add an assertion of success on the temp file removal, since virus scanners and other environmental things can often cause removal to fail in real world tools.
Also fix more temp file leaks in unit tests.
llvm-svn: 280445
show more ...
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
7dbb5778 |
| 18-Sep-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove temporary file on signal.
Without this lld leaves temporary files behind when it crashes.
llvm-svn: 247994
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4 |
|
#
169284a6 |
| 13-Aug-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Return ErrorOr from FileOutputBuffer::create. NFC.
llvm-svn: 244848
|
Revision tags: llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1 |
|
#
f00654e3 |
| 23-Jun-2015 |
Alexander Kornienko <alexfh@google.com> |
Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.
llvm-svn: 240390
|
#
70bc5f13 |
| 19-Jun-2015 |
Alexander Kornienko <alexfh@google.com> |
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-c
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/
Thanks to Eugene Kosov for the original patch!
llvm-svn: 240137
show more ...
|
Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1 |
|
#
16132e6f |
| 23-Mar-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
Purge unused includes throughout libSupport.
NFC.
llvm-svn: 232976
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1 |
|
#
da9bc2e5 |
| 06-Mar-2015 |
Rui Ueyama <ruiu@google.com> |
Support: Improve performance of FileOutputBuffer on Windows
We extend an underlying file before mmap'ing it, but it's not needed on Windows. Extending file is slow on Windows, so we should avoid doi
Support: Improve performance of FileOutputBuffer on Windows
We extend an underlying file before mmap'ing it, but it's not needed on Windows. Extending file is slow on Windows, so we should avoid doing that. The difference gets larger as the size of an output file gets larger. It shove off 2 seconds out of 25 seconds when linking chrome.dll with LLD, for example.
llvm-svn: 231452
show more ...
|
Revision tags: llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1 |
|
#
d9903888 |
| 14-Jan-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the Inst
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order.
llvm-svn: 225974
show more ...
|
Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2 |
|
#
c69f13bf |
| 12-Dec-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Move the resize file feature from mapped_file_region to the only user.
This removes a duplicated stat on every file that llvm-ar looks at.
llvm-svn: 224138
|
#
5753cf3c |
| 12-Dec-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove unused feature. NFC.
llvm-svn: 224135
|
#
7eb1f185 |
| 11-Dec-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove a convoluted way of calling close by moving the call to the only caller.
As a bonus we can actually check the return value.
llvm-svn: 224046
|
Revision tags: llvmorg-3.5.1-rc1, llvmorg-3.5.0 |
|
#
f55e31a9 |
| 02-Sep-2014 |
David Blaikie <dblaikie@gmail.com> |
unique_ptrify FileOutputBuffer::FileOutputBuffer
llvm-svn: 216921
|
Revision tags: llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1 |
|
#
b61064ed |
| 19-Jul-2014 |
David Blaikie <dblaikie@gmail.com> |
Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ".reset()"
It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave
Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ".reset()"
It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future.
llvm-svn: 213438
show more ...
|
#
2a826e40 |
| 13-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration.
Thi
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration.
This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code.
llvm-svn: 210920
show more ...
|
#
db4ed0bd |
| 13-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove 'using std::errro_code' from lib.
llvm-svn: 210871
|
#
3acea398 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't use 'using std::error_code' in include/llvm.
This should make sure that most new uses use the std prefix.
llvm-svn: 210835
|
#
a6e9c3e4 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove system_error.h.
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch.
llvm-svn: 210803
|
#
ed6882b8 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't import make_error_code into the llvm namespace.
llvm-svn: 210772
|
#
5c4f8294 |
| 11-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use std::error_code instead of llvm::error_code.
The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace
Use std::error_code instead of llvm::error_code.
The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards.
The cases where the general idea needed some tweaking:
* std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch.
* Template specialization had to be moved to the std namespace in this patch set already.
* The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time.
Despite these shortcomings I think this is still a good thing. Some reasons:
* The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++.
llvm-svn: 210687
show more ...
|
#
03bddfee |
| 31-May-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use error_code() instead of error_code::succes()
There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code.
llvm-svn: 209952
|