[PATCH] D73264: [DWARF] Do not pass Version to DWARFExpression. NFCI.

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 09:05:51 PST 2020


probinson added a comment.

Reviewing the DWARF spec for DW_OP_call_ref:
This operator does not exist in DWARF v2.  In v3 and onward, its operand is specified as 4- or 8-byte depending on the DWARF-32/64 format.  There is non-normative commentary that says this is the same interpretation as DW_FORM_ref_addr, which is true for v3 and onward.
While the interpretation of DW_FORM_ref_addr did change from v2 to v3, I think that's not relevant to DW_OP_call_ref, because the normative text for its operand has always explicitly specified that it is format-dependent.
So, I think it is correct to remove getRefAddrSize() from DWARFExpression, and have the SizeRefAddr case be strictly format-dependent.

Removing the Version field also seems appropriate, even though it's a bit of churn.  Version would be most helpful for something like strict verification; on the other hand, all the operator descriptions carry the version-when-first-defined, and the verify() call takes a DWARFUnit* which will specify the version to verify against.

One thing is missing: There should be a test to verify we are handling DW_OP_call_ref in a V2 unit according to the format rather than the address size.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73264/new/

https://reviews.llvm.org/D73264





More information about the llvm-commits mailing list