[Lldb-commits] [PATCH] D17274: improve readability and performance of ClangExpressionParser::FindFunctionInModule
Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 25 05:11:47 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261861: Improve readability and performance of ClangExpressionParser… (authored by aidandodds).
Changed prior to commit:
http://reviews.llvm.org/D17274?vs=48003&id=49045#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17274
Files:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -542,13 +542,12 @@
llvm::Module *module,
const char *orig_name)
{
- for (llvm::Module::iterator fi = module->getFunctionList().begin(), fe = module->getFunctionList().end();
- fi != fe;
- ++fi)
+ for (const auto &func : module->getFunctionList())
{
- if (fi->getName().str().find(orig_name) != std::string::npos)
+ const StringRef &name = func.getName();
+ if (name.find(orig_name) != StringRef::npos)
{
- mangled_name.SetCString(fi->getName().str().c_str());
+ mangled_name.SetString(name);
return true;
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17274.49045.patch
Type: text/x-patch
Size: 997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160225/412e4614/attachment.bin>
More information about the lldb-commits
mailing list