llvm-project/llvm
Kevin Enderby e3bf4fd546 This removes the eating of the error in Archive::Child::getSize() when the characters
in the size field in the archive header for the member is not a number.  To do this we
have all of the needed methods return ErrorOr to push them up until we get out of lib.
Then the tools and can handle the error in whatever way is appropriate for that tool.

So the solution is to plumb all the ErrorOr stuff through everything that touches archives.
This include its iterators as one can create an Archive object but the first or any other
Child object may fail to be created due to a bad size field in its header.

Thanks to Lang Hames on the changes making child_iterator contain an
ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add
operator overloading for * and -> .

We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash”
and using report_fatal_error() to move the error checking will cause the program to
stop, neither of which are really correct in library code. There are still some uses of
these that should be cleaned up in this library code for other than the size field.

Also corrected the code where the size gets us to the “at the end of the archive”
which is OK but past the end of the archive will return object_error::parse_failed now.

The test cases use archives with text files so one can see the non-digit character,
in this case a ‘%’, in the size field.

llvm-svn: 250906
2015-10-21 16:59:24 +00:00
..
autoconf Don't use bashism/kshism of test ==. From Kamil Rytarowski. 2015-09-12 16:30:32 +00:00
bindings Remove DIFile from createSubroutineType. 2015-10-15 06:56:10 +00:00
cmake [CMake] Refactor subdirectory inclusion code to take a project name. 2015-10-20 16:42:58 +00:00
docs [CMake] Adding LLVM_CREATE_XCODE_TOOLCHAIN to the CMake documentation page. 2015-10-15 20:12:08 +00:00
examples [JIT/Examples] Fix Fibonacci so that it runs again. 2015-10-17 06:36:46 +00:00
include This removes the eating of the error in Archive::Child::getSize() when the characters 2015-10-21 16:59:24 +00:00
lib This removes the eating of the error in Archive::Child::getSize() when the characters 2015-10-21 16:59:24 +00:00
projects
resources
test This removes the eating of the error in Archive::Child::getSize() when the characters 2015-10-21 16:59:24 +00:00
tools This removes the eating of the error in Archive::Child::getSize() when the characters 2015-10-21 16:59:24 +00:00
unittests [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
utils Lit: Rework r249161; Move RLIMIT_NPROC to main.py. 2015-10-15 15:37:13 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt [CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED ...) 2015-10-20 18:16:37 +00:00
CODE_OWNERS.TXT CODE_OWNERS.TXT is supposed to be sorted by surname 2015-09-07 00:41:40 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in We're actually -Wmissing-field-initializers clean thanks to the cmake 2015-08-07 16:44:47 +00:00
Makefile.rules We're actually -Wmissing-field-initializers clean thanks to the cmake 2015-08-07 16:44:47 +00:00
README.txt
configure Don't use bashism/kshism of test ==. From Kamil Rytarowski. 2015-09-12 16:30:32 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.