[PATCH] D100630: [Debug-Info][DBX] DW_TAG_rvalue_reference_type should not be generated when dwarf version is smaller than 4

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 16 19:54:54 PDT 2021


shchenz added a comment.

In D100630#2760972 <https://reviews.llvm.org/D100630#2760972>, @dblaikie wrote:

> This isn't the sort of thing I'd like to leave to a FIXME later - seems like the sort of thing we shouldn't create now to fix later.
>
> @aprantl mind having a second look at this to consider the situation further?

OK. Let me summary the two solutions here:
1: fixed in the FE. See patch https://reviews.llvm.org/D100630?vs=on&id=338035#toc.
Advantage:

- the DWARF info for `DW_TAG_rvalue_reference_type` and `DW_TAG_reference_type` is cached, so we will not have redundant info;
- FE also respects strict dwarf option;

Disadvantage:

- No common interface for strict dwarf option.

2: fixed in the BE. See current patch.
Advantage:

- there is a common interface for tags adding, so we can add strict dwarf support in one place

Disadvantage:

- Redundant DWARF info since the final DWARF info adding in BE has no cache mechanism. And maybe there should be no such mechanism because after we add a DIE tag, we may add an attribute anywhere later, so it is hard to tell the DIE tag is identical when we create the DIE tag. If we optimize the redundant DWARF tag in the place where we add the fix, what about when we need to add another attribute to one of the identical DIE tags? Splitting them again into two different DIE tags?
- IR Metadata does not respect the strict DWARF option.

Welcome your comments? @dblaikie @aprantl @probinson and other reviewers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100630



More information about the llvm-commits mailing list