[Lldb-commits] [PATCH] D131335: WIP: [lldb] abi_tag support 3/3 - Use mangle tree API to determine approximate mangled matches
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 9 10:31:51 PDT 2022
aprantl added inline comments.
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:607
+ std::vector<ConstString> param_matches;
+ for (size_t i = 0; i < alternates.size(); i++) {
+ ConstString alternate_mangled_name = alternates[i];
----------------
Could this be `for (ConstString alternate_mangled_name : alternates)` ?
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:607
+ std::vector<ConstString> param_matches;
+ for (size_t i = 0; i < alternates.size(); i++) {
+ ConstString alternate_mangled_name = alternates[i];
----------------
aprantl wrote:
> Could this be `for (ConstString alternate_mangled_name : alternates)` ?
Comment what the loop is doing?
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:612
+ ManglingParser<NodeAllocator> alternate_parser(
+ alternate, alternate + std::strlen(alternate));
+ if (auto const *alt_node = alternate_parser.parse()) {
----------------
`alternate_mangled_name.GetLength()` ?
It might sill need to call strlen under the hood, but it could do something more efficient.
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:639
+ // No perfect match. Return one of the approximate
+ // matches as a best match
+ if (param_matches.size())
----------------
`.`
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:1515
+void CPlusPlusLanguage::CollectAlternateFunctionNamesItanium(
+ std::vector<ConstString> &results, ConstString name,
+ const SymbolContext &sc) const {
----------------
why not return the vector?
================
Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:1522
+ using namespace llvm::itanium_demangle;
+ ManglingParser<NodeAllocator> parser(mangled, mangled + std::strlen(mangled));
+ auto const *node = parser.parse();
----------------
I'd rather ask the conststring for its length again
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131335/new/
https://reviews.llvm.org/D131335
More information about the lldb-commits
mailing list