[PATCH] D44560: [DWARF] Rework debug line parsing to use llvm::Error and callbacks

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 3 08:58:42 PDT 2018


dblaikie added a comment.

iterator or iterator-like thing. One option would be a callback with Error
when the iterator is retrieved - and that's called back for any error (&
the user wouldn't need to differentiate the different kinds of error - the
iterator would stop when it couldn't continue). Or an Iterator-like but
not-actually-iterator API that exposes the Error during iteration (but
that'd probably look a bit awkward & be something like pair<Error,
Optional<T>> or, yes, as suggested - a separate Error type to communicate
"fail and cotninue" separately from "fail and stop"... )

*ponders* Yeah, sort of feel like the callback would be pretty suitable - a
plain/real iterator that only gives valid line tables (or sufficiently
valid to have some interesting content for dumping, etc?) & anything
invalid triggers the Error callback, etc.

I know I've discussed this sort of API (iteration with an Error callback)
with Lang before - I think he used that in libObject in some places
already? Maybe? Might be worth chatting with him a bit?


Repository:
  rL LLVM

https://reviews.llvm.org/D44560





More information about the llvm-commits mailing list