The work that IRExecutionUnit::CollectFallbackNames is basically the
work that CPlusPlusLanguage::GetDemangledFunctionNameWithoutArguments
does already. It's also (at time or writing) specific to C++, so it can
be folded into IRExecutionUnit::CollectCandidateCPlusPlusNames.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks fine to me. I am assuming the full test suite passes with this change in place?
lldb/source/Expression/IRExecutionUnit.cpp | ||
---|---|---|
717 | Seems like we should be passing in the "Mangled" object into "FindBestAlternateMangledName" in case it has extra information. For example constructors and destructors have many different types (in charge, not in charge, etc). |
It didn't introduce any new test failures on any of my machines.
lldb/source/Expression/IRExecutionUnit.cpp | ||
---|---|---|
717 | Yes, I agree. I plan on tackling that function next. |
I think this looks fine, just verify that this in a C++ case an expression with an extern "C" function call works fine e.g.
extern "C" { int g() { return 10;} } int main() { return g(); // break here and run expr g() }
I discovered the other day that we mangle extern "C" functions in C++ mode and I have a fix I wanted to run by everyone but I have not had a chance to do it yet.
So this case get resolved in CollectFallbackNames(...).
I believe this is already covered by TestExternCSymbols.py in test/API/cpp/extern_c/. CollectFallbackNames did correctly resolve this case, so I made sure this change didn't break that test.
Anything you think I should change or is this good to go?
Seems like we should be passing in the "Mangled" object into "FindBestAlternateMangledName" in case it has extra information. For example constructors and destructors have many different types (in charge, not in charge, etc).