diff options
| author | Aidan Dodds <aidan@codeplay.com> | 2016-02-25 13:07:04 +0000 |
|---|---|---|
| committer | Aidan Dodds <aidan@codeplay.com> | 2016-02-25 13:07:04 +0000 |
| commit | b129847aaa62ff8308f201def03da5473ea556b9 (patch) | |
| tree | 0686602b2d30c2e9cb027c47279b454397734c32 /lldb/source/Plugins/ExpressionParser | |
| parent | 46458d0bcc00f8eb9eb47964ddee25b82a4344f7 (diff) | |
| download | bcm5719-llvm-b129847aaa62ff8308f201def03da5473ea556b9.tar.gz bcm5719-llvm-b129847aaa62ff8308f201def03da5473ea556b9.zip | |
Improve readability and performance of ClangExpressionParser::FindFunctionInModule
Committed on behalf of: Luke Drummond
Differential Revision: http://reviews.llvm.org/D17274
llvm-svn: 261861
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index 2fded88a0ea..5b99bd5382a 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -542,13 +542,12 @@ static bool FindFunctionInModule (ConstString &mangled_name, 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; } } |

