[Lldb-commits] [PATCH] D105215: [lldb] Remove CPlusPlusLanguage from Mangled

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 8 13:56:53 PDT 2021



> On Jul 8, 2021, at 12:25 PM, Alex Langford via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> bulbazord added a comment.
> 
> In D105215#2850988 <https://reviews.llvm.org/D105215#2850988>, @jingham wrote:
> 
>> In D105215#2850821 <https://reviews.llvm.org/D105215#2850821>, @bulbazord wrote:
>> 
>>> I kind of feel that `Language::GetDemangledFunctionNameWithoutArguments` may be a bit too specific for a generalized language plugins. I think it may be worth it to make `Mangled` an interface that language plugins can implement (e.g. `CPlusPlusMangledName`) but I haven't totally thought out what the ramifications of that would be yet.
>> 
>> The name is unfortunate, but the notion that function types have an identifier, that is then decorated by arguments and maybe return types, seems pretty common.  So in this particular case, maybe we just need a better name?  GetBaseName isn't right since this function also returns any namespace information.  Maybe GetFullyQualifiedBaseName?
> 
> This may be my ignorance of other languages speaking, but `GetFullyQualifiedBaseName` sounds a little more specific to C++. I'm not sure if other languages use this terminology, so I tried to keep it as generic as possible.
> 

Many other languages (except for C and Fortran) have some notion of namespaces & classes which qualify a bare function identifier.  And most have contexts in which you can use just the identifier and others where you can or have to include the namespace/class qualifiers.  "FullyQualifiedBaseName" was my best shot at describing this difference.  Mangling/Demangling seemed to me to have a more C++ specific flavor, and plus GetDemangledFunctionNameWithoutArguments only obliquely tells you you will be getting the full path to the name, which you infer because the C++ demangled name includes this info.

But I was mostly arguing that the concept, which I understood to be "give me the full path to this identifier", is a general one, regardless of the name.

Jim



> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D105215/new/
> 
> https://reviews.llvm.org/D105215
> 



More information about the lldb-commits mailing list