aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorAlexey Lapshin <a.v.lapshin@mail.ru>2020-02-27 17:53:00 +0300
committerAlexey Lapshin <a.v.lapshin@mail.ru>2020-02-27 18:32:40 +0300
commitf943443e65115c83648f1185adedb3d333f8619f (patch)
tree839d194365d44ea8aeb7838981b78a9660cd3200 /clang/lib/Basic/Module.cpp
parent1b811ff8a935fafb279ad9bad36d36058a129b42 (diff)
downloadllvm-f943443e65115c83648f1185adedb3d333f8619f.zip
llvm-f943443e65115c83648f1185adedb3d333f8619f.tar.gz
llvm-f943443e65115c83648f1185adedb3d333f8619f.tar.bz2
[Debuginfo][NFC] Unify error reporting routines inside DebugInfoDWARF.
Summary: Error reporting in DebugInfoDWARF library currently done in three ways : 1. Direct calls to WithColor::error()/WithColor::warning() 2. ErrorPolicy defaultErrorHandler(Error E); 3. void dumpWarning(Error Warning); additionally, other locations could have more variations: lld/ELF/SyntheticSection.cpp if (Error e = cu->tryExtractDIEsIfNeeded(false)) { error(toString(sec) + ": " + toString(std::move(e))); DebugInfo/DWARF/DWARFUnit.cpp if (Error e = tryExtractDIEsIfNeeded(CUDieOnly)) WithColor::error() << toString(std::move(e)); Thus error reporting could look inconsistent. To have a consistent error messages it is necessary to have a possibility to redefine error reporting functions. This patch creates two handlers and allows to redefine them. It also patches all places inside DebugInfoDWARF to use these handlers. The intention is always to use following handlers for error reporting purposes inside DebugInfoDWARF: DebugInfo/DWARF/DWARFContext.h std::function<void(Error E)> RecoverableErrorHandler = WithColor::defaultErrorHandler; std::function<void(Error E)> WarningHandler = WithColor::defaultWarningHandler; This is last patch from series of patches: D74481, D74635, D75118. Reviewers: jhenderson, dblaikie, probinson, aprantl, JDevlieghere Reviewed By: jhenderson Subscribers: grimar, hiraditya, llvm-commits Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D74308
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions