[Symbolize] Improve the ownership of parsed objects.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Dec 2015 22:02:14 +0000 (22:02 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Dec 2015 22:02:14 +0000 (22:02 +0000)
commit1eaae4c3b1c2aa921b087eba07c2754ab84ae202
treef2e1081e2e5753bce0600923a378edb84f1c4dfb
parent718a9b2844b9cfe1232d1c7d880c8203d45c8353
[Symbolize] Improve the ownership of parsed objects.

This code changes the way Symbolize handles parsed binaries: now
parsed OwningBinary<Binary> is not broken into (binary, memory buffer)
pair, and is just stored as-is in a cache. ObjectFile components
of Mach-O universal binaries are also stored explicitly in a
separate cache.

Additionally, this change:
* simplifies the code that parses/caches binaries: it's now done
  in a single place, not three different functions.
* makes flush() method behave as expected, and actually clear
  the cached parsed binaries and objects.
* fixes a dangling pointer issue described in
  http://reviews.llvm.org/D15638

llvm-svn: 256041
llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp