[all-commits] [llvm/llvm-project] 60eb06: [lldb][TypeSystemClang] Honor DW_AT_rvalue_referen...

Michael137 via All-commits all-commits at lists.llvm.org
Tue Sep 27 10:04:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 60eb06be6d23e3c5fd80113143784aac0d962965
      https://github.com/llvm/llvm-project/commit/60eb06be6d23e3c5fd80113143784aac0d962965
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  [lldb][TypeSystemClang] Honor DW_AT_rvalue_reference when creating C++ FunctionPrototypes

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

Differential Revision: https://reviews.llvm.org/D134661




More information about the All-commits mailing list