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

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 19:43:30 PDT 2021


dblaikie added a comment.

In D100630#2749550 <https://reviews.llvm.org/D100630#2749550>, @shchenz wrote:

> In D100630#2748899 <https://reviews.llvm.org/D100630#2748899>, @dblaikie wrote:
>
>> Does this cause duplicate DW_TAG_reference_types in the output, if the input IR Has both DW_TAG_reference_type and DW_TAG_rvalue_reference_types?
>
> Yes, it will cause such issue in theory. I can not cook a case that has a DW_TAG_reference_type to a DW_TAG_rvalue_reference_types or has a DW_TAG_rvalue_reference_types to a DW_TAG_reference_type for now. Is there such usage that we both be rvalue-reference and lvalue-reference to a basic type?

Ah, I was less thinking of a case of an rvalue reference and a normal reference in the same chain - I was thinking more about two unrelated reference types.

Try some code like:

  void f1(int &&x, int &y) {
  }

I'm guessing without this change - you get 'x's type pointing to the rvalue_reference_type, 'y's type pointing to the reference_type, and both of those pointing to the 'int' DW_TAG_basic_type.

But with this change I'm worried you'll get two copies of the DW_TAG_reference_type - one that replaces the rvalue reference, and then the real one. Instead you should get one copy that both 'x' and 'y' refer to, I think.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100630



More information about the cfe-commits mailing list