Page MenuHomePhabricator

[lldb] abi_tag support 3/4 - Add char const* overload for SymbolNameFitsToLanguage
AbandonedPublicDraft

Authored by Michael137 on Aug 6 2022, 10:46 AM.

Details

Reviewers
aprantl
Summary

This patch adds a new overload to Language::SymbolNameFitsToLanguage
that only requires a char const* parameter instead of a Mangled
object. This is useful for future efforts in which parts of the
CPlusPlusLanguage plugin will avoid using Mangled in favour
of the Itanium mangle tree API.

Diff Detail

Event Timeline

Michael137 created this revision.Aug 6 2022, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2022, 10:46 AM
aprantl added inline comments.Aug 8 2022, 10:50 AM
lldb/include/lldb/Target/Language.h
210
  1. Would it be worth hiding this implementation detail inside the function? Ie., would it make sense to pass a Mangled and then have the implementation of SymbolNameFitsToLanguage extract the raw mangled string from it?
  1. We usually try to avoid APIs that take a char * and use StringRefs. Or is the cxx demangler API using char * too?
Michael137 added inline comments.Aug 8 2022, 1:31 PM
lldb/include/lldb/Target/Language.h
210

Would it be worth hiding this implementation detail inside the function? Ie., would it make sense to pass a Mangled and then have the implementation of SymbolNameFitsToLanguage extract the raw mangled string from it?

I wanted to avoid creating a Mangled object in the code-path where we use the mangle tree API since we'd then be demangling the function symbol twice. But you're right, we can just keep this in class CPlusPlusLanguage I plan to only use it there.

We usually try to avoid APIs that take a char * and use StringRefs. Or is the cxx demangler API using char * too?

Yup StringRef would make sense

Michael137 abandoned this revision.Aug 8 2022, 3:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 3:59 PM