This is an archive of the discontinued LLVM Phabricator instance.

Use ForEachExternalModule in ParseTypeFromClangModule (NFC)
ClosedPublic

Authored by aprantl on Nov 13 2019, 5:10 PM.

Details

Summary

I wanted to further simplify ParseTypeFromClangModule by replacing the hand-rolled loop with ForEachExternalModule, and then realized that ForEachExternalModule also had the problem of visiting the same leaf node an exponential number of times in the worst-case. This adds a set of searched_symbol_files set to the function as well as the ability to early-exit from it.

Diff Detail

Event Timeline

aprantl created this revision.Nov 13 2019, 5:10 PM
teemperor accepted this revision.Nov 14 2019, 6:32 AM

LGTM minus some small changes.

lldb/include/lldb/Symbol/SymbolFile.h
127

"this compilation unit", that doesn't really fit to the SymbolFile class. Maybe we could just do like @see CompileUnit::ForEachExternalModule?

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2512

unrelated whitespace change?

This revision is now accepted and ready to land.Nov 14 2019, 6:32 AM
This revision was automatically updated to reflect the committed changes.
aprantl marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptNov 14 2019, 9:02 AM