[DWARFYAML][debug_info] Pull out dwarf::FormParams from DWARFYAML::Unit.
authorXing GUO <higuoxing@gmail.com>
Thu, 6 Aug 2020 08:37:52 +0000 (16:37 +0800)
committerXing GUO <higuoxing@gmail.com>
Thu, 6 Aug 2020 08:39:00 +0000 (16:39 +0800)
commit4357986b411dd164932c66ebfe4a9cf96a7d74cd
tree3e78b19ec865ef96b4bed6845bd05a786b313920
parent6148cca70888ead020a808279043fd013ca72a2a
[DWARFYAML][debug_info] Pull out dwarf::FormParams from DWARFYAML::Unit.

Unit.Format, Unit.Version and Unit.AddrSize are replaced with
dwarf::FormParams in D84496 to get rid of unnecessary functions
getOffsetSize() and getRefSize(). However, that change makes it
difficult to make AddrSize optional (Optional<uint8_t>). This change
pulls out dwarf::FormParams from DWARFYAML::Unit and use it as a helper
struct in DWARFYAML::emitDebugInfo().

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D85296
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/lib/ObjectYAML/DWARFEmitter.cpp
llvm/lib/ObjectYAML/DWARFYAML.cpp
llvm/tools/obj2yaml/dwarf2yaml.cpp