[all-commits] [llvm/llvm-project] a58c2e: Fix DWARFDie::getDeclFile(...) to work with DW_AT_...
Greg Clayton via All-commits
all-commits at lists.llvm.org
Mon Aug 23 15:43:36 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a58c2e4af06c9d1d6d6559cf29da4384cd7e828e
https://github.com/llvm/llvm-project/commit/a58c2e4af06c9d1d6d6559cf29da4384cd7e828e
Author: Greg Clayton <gclayton at fb.com>
Date: 2021-08-23 (Mon, 23 Aug 2021)
Changed paths:
M llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
M llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
M llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
M llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp
Log Message:
-----------
Fix DWARFDie::getDeclFile(...) to work with DW_AT_specification.
DWARFDie::getDeclFile(...) previously only supported getting the DW_AT_decl_file if the DIE itself contained the DW_AT_decl_file attribute, or if the DIE had a DW_AT_abstract_origin that pointed to another DIE that had a DW_AT_decl_file. This patch allows the function to get the right attribute value if there is a DW_AT_specification that points to another DIE. We also test that if a DW_AT_abtract_origin or DW_AT_specification points to a DIE in another CU with a DW_FORM_ref_addr, that the right line table is used to extract the file index.
Full tests were added for the following cases:
- DIE has a DW_AT_decl_file attribute
- DIE has a DW_AT_abtract_origin that points to another die in the same CU
- DIE has a DW_AT_abtract_origin that points to another die in another CU
- DIE has a DW_AT_specification that points to another die in the same CU
- DIE has a DW_AT_specification that points to another die in another CU
Differential Revision: https://reviews.llvm.org/D108480
More information about the All-commits
mailing list