[Lldb-commits] [PATCH] D63591: DWARFDebugLoc: Make parsing and error reporting more robust
Paul Robinson via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 21 06:56:29 PDT 2019
probinson added a comment.
Ah, hadn't considered statefulness. But if you layer another class on top of DataExtractor to handle the error flag, it would have to be replicating all the offset-is-valid checks, because of course DataExtractor itself doesn't return errors.
I have a couple more ideas to toss out there...
- A DataExtractorBase class that returns Optional<whatever>, and then DataExtractor layers on top and converts None to zero, which preserves the non-statefulness as well as the current API. This adds some runtime overhead, not sure how much.
- Or, a template DataExtractorBase that takes an error-handling class as a parameter (sort of like how STL containers take an allocator) and a DataExtractor specialization uses a no-op error-handling class. Should avoid runtime overhead at the cost of template cruft.
CHANGES SINCE LAST ACTION
More information about the lldb-commits