[DebugInfo] Common behavior for error types
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 31 Aug 2018 17:41:58 +0000 (17:41 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 31 Aug 2018 17:41:58 +0000 (17:41 +0000)
commit6a7efef4af55b995fdfe9a0819adcb823cbb6191
treef9d4ac0479cec3f173385e9d585ae1e7453ba586
parentb7bb9f0078e27bf39d73aa4a5ba31e9e02087216
[DebugInfo] Common behavior for error types

Following D50807, and heading towards D50664, this intermediary change does the following:

1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807).
2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations.
3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit)
4. Update custom error messages to follow the same formatting: (\w\s*)+\.
5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose.
6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level.

Differential Revision: https://reviews.llvm.org/D51499

llvm-svn: 341228
25 files changed:
lld/COFF/PDB.cpp
llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
llvm/include/llvm/DebugInfo/MSF/MSFError.h
llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
llvm/include/llvm/DebugInfo/PDB/GenericError.h
llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
llvm/lib/DebugInfo/CodeView/CodeViewError.cpp
llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
llvm/lib/DebugInfo/MSF/MSFError.cpp
llvm/lib/DebugInfo/PDB/DIA/DIAError.cpp
llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
llvm/lib/DebugInfo/PDB/GenericError.cpp
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/RawError.cpp
llvm/lib/DebugInfo/PDB/PDB.cpp
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
llvm/lib/Support/BinaryStreamError.cpp
llvm/test/DebugInfo/PDB/pdb-invalid-type.test
llvm/test/DebugInfo/PDB/pdbdump-headers.test
llvm/test/tools/llvm-readobj/codeview-merging-cycle.test
llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test
llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
llvm/tools/obj2yaml/Error.cpp