[PATCH] D82630: [ObjectYAML][DWARF] Collect diagnostic message when YAMLParser fails.

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 02:08:45 PDT 2020


Higuoxing created this revision.
Higuoxing added reviewers: jhenderson, grimar, MaskRay.
Herald added subscribers: llvm-commits, hiraditya, mgorny.
Herald added a project: LLVM.
Higuoxing edited the summary of this revision.

Before this patch, the diagnostic message is printed to `errs()` directly, which makes it difficult to use `FailedWithMessage()` in unit testing.
In this patch, we add a custom error handler for YAMLParser, which helps collect diagnostic messages and make it easy to use `FailedWithMessage()` to check error messages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82630

Files:
  llvm/lib/ObjectYAML/DWARFEmitter.cpp
  llvm/unittests/ObjectYAML/CMakeLists.txt
  llvm/unittests/ObjectYAML/DWARFYAMLTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82630.273619.patch
Type: text/x-patch
Size: 3325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200626/8d36c272/attachment.bin>


More information about the llvm-commits mailing list