[PATCH] D57618: [ADT] Add a fallible_iterator wrapper.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 10:53:43 PST 2019


rupprecht requested changes to this revision.
rupprecht added inline comments.
This revision now requires changes to proceed.


================
Comment at: tools/llvm-objcopy/llvm-objcopy.cpp:176
   }
   if (Err)
     return createFileError(Config.InputFilename, std::move(Err));
----------------
When I remove this Error check at trunk, I can get 6 tests to fail:

```
$ ninja check-llvm-tools-llvm-objcopy
...
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
...
Failing Tests (6):
    LLVM :: tools/llvm-objcopy/ELF/basic-archive-copy.test
    LLVM :: tools/llvm-objcopy/ELF/deterministic-archive.test
    LLVM :: tools/llvm-objcopy/ELF/strip-all.test
    LLVM :: tools/llvm-objcopy/ELF/strip-debug.test
    LLVM :: tools/llvm-objcopy/ELF/strip-preserve-atime.test
    LLVM :: tools/llvm-objcopy/ELF/strip-preserve-mtime.test
```

But when I patch in this change and then remove this line, I no longer get an error that Err is unchecked. So, I think something needs to reset Error so that it is unchecked at the end of normal loop iteration.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57618/new/

https://reviews.llvm.org/D57618





More information about the llvm-commits mailing list