diff options
author | Geoffrey Martin-Noble <gcmn@google.com> | 2020-09-02 15:00:26 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-09-02 15:00:26 -0700 |
commit | 848b0e244c9ff5413c2eee6357d5faab1402d619 (patch) | |
tree | 4679cbb2d52918ca61f873af7711121264864e4c /llvm/lib/Support/VirtualFileSystem.cpp | |
parent | 1284dc34abd11ce4275ad21c0470ad8c679b59b7 (diff) | |
download | llvm-848b0e244c9ff5413c2eee6357d5faab1402d619.zip llvm-848b0e244c9ff5413c2eee6357d5faab1402d619.tar.gz llvm-848b0e244c9ff5413c2eee6357d5faab1402d619.tar.bz2 |
Improve error handling for SmallVector programming errors
This patch changes errors in `SmallVector::grow` that are independent of
memory capacity to be reported using report_fatal_error or
std::length_error instead of report_bad_alloc_error, which falsely signals
an OOM.
It also cleans up a few related things:
- makes report_bad_alloc_error to print the failure reason passed
to it.
- fixes the documentation to indicate that report_bad_alloc_error
calls `abort()` not "an assertion"
- uses a consistent name for the size/capacity argument to `grow`
and `grow_pod`
Reviewed By: mehdi_amini, MaskRay
Differential Revision: https://reviews.llvm.org/D86892
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
0 files changed, 0 insertions, 0 deletions