[Lldb-commits] [PATCH] D134661: [lldb][TypeSystemClang] Honor DW_AT_rvalue_reference when creating C++ FunctionPrototypes

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 26 11:48:12 PDT 2022


Michael137 created this revision.
Michael137 added reviewers: aprantl, labath.
Herald added a reviewer: shafik.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Currently funciton lookup in the expression evaluator
fails to disambiguate member functions the are overloaded
on lvalue/rvalue reference-qualifiers. This happens because
we unconditionally set a `FunctionPrototype`s
`ExtProtoInfo::RefQualifier` to `RQ_None`. We lose
the ref-qualifiers in the synthesized AST and `clang::Sema`
fails to pick a correct overload candidate.

DWARF emits information about a function's ref-qualifiers
in the form of a boolean `DW_AT_rvalue_reference` (for rvalues)
and `DW_AT_reference` (for lvalues).

This patch sets the `FunctionPrototype::ExtProtoInfo::RefQualifier`
based on the DWARF attributes above.

**Testing**

- Added API test

llvm/llvm-project issue #57866


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134661

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  lldb/test/API/lang/cpp/function-ref-qualifiers/Makefile
  lldb/test/API/lang/cpp/function-ref-qualifiers/TestCppFunctionQualifiers.py
  lldb/test/API/lang/cpp/function-ref-qualifiers/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134661.462982.patch
Type: text/x-patch
Size: 7573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220926/f8bcf9cc/attachment.bin>


More information about the lldb-commits mailing list