mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 12:25:46 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user