This is an archive of the discontinued LLVM Phabricator instance.

Make the symbol demangling loop order independent
AbandonedPublic

Authored by scott.smith on Apr 27 2017, 4:47 PM.

Details

Reviewers
clayborg
Group Reviewers
Restricted Project
Summary

Currently, the loop will insert entries into the class_contexts set, and then use the absence or presence to affect decisions made by later iterations of the same loop.

In order to support parallelizing the loop, this change moves those decisions to always occur after the main loop, instead of sometimes occurring after the loop.

Diff Detail

Repository
rL LLVM

Event Timeline

scott.smith created this revision.Apr 27 2017, 4:47 PM

I welcome any suggestions on how to update the comments near the code I touched. I can make the code functionally the same, but it doesn't mean I know why it's doing what it's doing :-)

source/Symbol/Symtab.cpp
382

Note the old code checked that symbol_contexts[] (aka const_context above) is "true." However, because of the code above, we would never get here unless it is true. So I removed the check.

385

Note that adding to m_method_to_index happened in both code paths in the old code, so I moved it up to the main loop.

scott.smith retitled this revision from Make the ELF symbol demangling loop order independent to Make the symbol demangling loop order independent.Apr 27 2017, 4:50 PM
jingham added a subscriber: jingham.

Adding Greg as a reviewer. You can generally see from the CODE_OWNERS.txt file who has overall responsibility for areas in lldb, and you should at least assign them as a reviewer. For Symbol parsing stuff that's definitely Greg.

scott.smith abandoned this revision.Apr 27 2017, 7:14 PM

Turns out I'm planning on making more drastic changes to this loop, so there's no point in reviewing this step.

labath added a subscriber: labath.Apr 28 2017, 3:32 AM

If you're going to be making drastic changes here, could you please look at the possibility of making a more targeted test, rather than relying on the "run the whole debugger and set a breakpoint" type of tests to verify the finer details of the implementation. I was able to do a unit test for a bug in elf parsing code in D32434, which is not that far from here. That gives me hope it may be possible, but it's hard to say without knowing what kind of changes you would like to make.