This is an archive of the discontinued LLVM Phabricator instance.

Refactor/simplify llvm-symbolizer code.
AcceptedPublic

Authored by samsonov on Oct 20 2014, 3:07 PM.

Details

Reviewers
glider
Summary

This change rewrites significant part of llvm-symbolizer code,
as it has grown convoluted after a number of recent changes.

Most significantly, it simplifies ownership strategy: parsed binaries
and objects are now wrapped in OwningBinary<> or std::unique_ptr and
are always owned by LLVMSymbolizer object (so there's no need for explicit
destructor), and LLVMSymbolizer::loadObject / loadBinary methods
encapsulate calls to methods of LLVMObject and return raw pointers,
to objects owned by LLVMSymbolizer.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 15154.Oct 20 2014, 3:07 PM
samsonov retitled this revision from to Refactor/simplify llvm-symbolizer code..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: glider.
samsonov added a subscriber: Unknown Object (MLST).
glider edited edge metadata.Oct 20 2014, 4:42 PM

Looks mostly good

tools/llvm-symbolizer/LLVMSymbolize.cpp
339

I suggest to move the .gnu_debuglink part into a helper function so that findDbgObj is more readable.

347

"getBinaryPointer", maybe?

samsonov updated this revision to Diff 15159.Oct 20 2014, 5:52 PM
samsonov edited edge metadata.

Address comments.

tools/llvm-symbolizer/LLVMSymbolize.cpp
339

Done

347

Done

samsonov updated this revision to Diff 15160.Oct 20 2014, 5:52 PM

Remove irrelevant file.

glider accepted this revision.Oct 20 2014, 6:05 PM
glider edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 20 2014, 6:05 PM
samsonov updated this revision to Diff 15725.Nov 3 2014, 11:42 AM
samsonov edited edge metadata.

Rebase to trunk.

Looks like patch was not committed. Does it still make sense?