OSDN Git Service

[DWARFYAML][debug_info] Use 'AbbrCode' to index the abbreviation.
authorXing GUO <higuoxing@gmail.com>
Mon, 22 Jun 2020 13:33:00 +0000 (21:33 +0800)
committerXing GUO <higuoxing@gmail.com>
Mon, 22 Jun 2020 13:34:02 +0000 (21:34 +0800)
commit3a48a632d00ef1c98042140f402337fe13cdff52
tree9ce9476369e4646f375392992c599437d5e1417c
parent48d1a2d6d06e41b6dc8ff7bdf4a1277120367dc7
[DWARFYAML][debug_info] Use 'AbbrCode' to index the abbreviation.

Before this patch, we use `(uint32_t)AbbrCode - (uint32_t)FirstAbbrCode` to index the abbreviation. It's impossible for we to use the preceeding abbreviation of the previous one (e.g., if the previous DIE's `AbbrCode` is 2, we are unable to use the abbreviation with index 1). In this patch, we use `AbbrCode` to index the abbreviation directly.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D82173
llvm/lib/ObjectYAML/DWARFVisitor.cpp
llvm/test/tools/yaml2obj/ELF/DWARF/debug-info.yaml