Use a DenseMap for looking up functions by UID in CompileUnit::FindFunctionByUID

Summary:
Instead of iterating over our vector of functions, we might as well use a map here to
directly get the function we need.

Thanks to Vedant for pointing this out.

Reviewers: vsk

Reviewed By: vsk

Subscribers: mgrang, lldb-commits

Differential Revision: https://reviews.llvm.org/D50225

llvm-svn: 339504
This commit is contained in:
Raphael Isemann
2018-08-11 23:40:27 +00:00
parent 9b60b9289c
commit a7f19e5fda
3 changed files with 46 additions and 49 deletions

View File

@@ -371,15 +371,13 @@ void Module::ParseAllDebugSymbols() {
symbols->ParseCompileUnitFunctions(sc);
for (size_t func_idx = 0;
(sc.function = sc.comp_unit->GetFunctionAtIndex(func_idx).get()) !=
nullptr;
++func_idx) {
sc.comp_unit->ForeachFunction([&sc, &symbols](const FunctionSP &f) {
sc.function = f.get();
symbols->ParseFunctionBlocks(sc);
// Parse the variables for this function and all its blocks
symbols->ParseVariablesForContext(sc);
}
return false;
});
// Parse all types for this compile unit
sc.function = nullptr;