1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/lib
Kevin Enderby 8994e20f69 Reapply r250906 with many suggested updates from Rafael Espindola.
The needed lld matching changes to be submitted immediately next,
but this revision will cause lld failures with this alone which is expected.

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.

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

These changes will require corresponding changes to the lld project.  That will be
committed immediately after this change.  But this revision will cause lld failures
with this alone which is expected.

llvm-svn: 252192
2015-11-05 19:24:56 +00:00
..
Analysis Fix LoopAccessAnalysis when potentially nullptr check are involved 2015-11-05 05:49:43 +00:00
AsmParser AsmParser: Remove implicit ilist iterator conversions, NFC 2015-10-20 01:12:49 +00:00
Bitcode Fix Abbrev emission in WriteIdentificationBlock 2015-11-05 00:25:03 +00:00
CodeGen Fix some Clang-tidy modernize warnings, other minor fixes. 2015-11-04 22:32:32 +00:00
DebugInfo [LLVMSymbolize] Reduce indentation by using helper function. NFC. 2015-11-04 00:30:26 +00:00
ExecutionEngine Reapply r250906 with many suggested updates from Rafael Espindola. 2015-11-05 19:24:56 +00:00
Fuzzer [libFuzzer] print a bit fewer lines 2015-11-05 01:19:42 +00:00
IR [IR] Add bounds checking to dataOperandHasImpliedAttr 2015-11-05 01:53:26 +00:00
IRReader Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LibDriver [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
LineEditor
Linker [ThinLTO] Always set linkage type to external when converting alias 2015-11-04 16:01:16 +00:00
LTO Reapply "LTO: Disable extra verify runs in release builds" 2015-09-15 23:05:59 +00:00
MC Fix pr24832. 2015-11-05 00:10:08 +00:00
Object Reapply r250906 with many suggested updates from Rafael Espindola. 2015-11-05 19:24:56 +00:00
Option [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
Passes [PM] Port StripDeadPrototypes to the new pass manager 2015-10-30 23:28:12 +00:00
ProfileData [PGO] Use template file to define runtime structures 2015-11-05 00:47:26 +00:00
Support Fix a signed/unsigned mismatch warning; NFC. 2015-11-05 14:22:56 +00:00
TableGen [TblGen] ArrayRefize TGParser. No functional change intended. 2015-10-24 12:46:45 +00:00
Target [DebugInfo] Fix ARM/AArch64 prologue_end position. Related to D11268. 2015-11-05 17:50:17 +00:00
Transforms [SimplifyLibCalls] Use hasFloatVersion(). NFCI. 2015-11-05 19:18:23 +00:00
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00